Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,17 @@ Touchpad: <sup>NEXTRELEASE</sup>

If out of range select custom color <sup>0.21.0</sup>

#### Size Selection <sup>NEXTRELEASE</sup>

In the bottom toolbar the size can be edited directly or by + and - buttons.
Minimum is 0.1 and maximum to 99.99.

The bindings are:
- Mouse <kbd>left-button</kbd>, <kbd>wheel</kbd> and key <kbd>up</kbd>/<kbd>down</kbd> step size is 0.1
- Holding <kbd>Shift</kbd> will switch to 0.01 step size
- Mouse <kbd>middle-button</kbd> and <kbd>page up</kbd>/<kbd>page down</kbd> step size is 1.0
- Mouse <kbd>right-button</kbd> jumps to minimum/maximum

#### Tool Selection Shortcuts (configurable) <sup>0.20.0</sup>
Default single-key shortcuts:
- <kbd>p</kbd>: Pointer tool
Expand Down
12 changes: 11 additions & 1 deletion src/sketch_board.rs
Original file line number Diff line number Diff line change
Expand Up @@ -795,6 +795,10 @@ impl SketchBoard {
sender: ComponentSender<Self>,
) -> ToolUpdateResult {
match toolbar_event {
ToolbarEvent::FocusCanvas => {
self.renderer.grab_focus();
ToolUpdateResult::Unmodified
}
ToolbarEvent::ToolSelected(tool) => {
// deactivate old tool and save drawable, if any
let old_tool = self.active_tool.clone();
Expand Down Expand Up @@ -867,7 +871,7 @@ impl SketchBoard {
.borrow_mut()
.handle_event(ToolEvent::StyleChanged(self.style))
}
ToolbarEvent::AnnotationSizeChanged(value) => {
ToolbarEvent::AnnotationSizeFactorChanged(value) => {
self.style.annotation_size_factor = value;
self.active_tool
.borrow_mut()
Expand Down Expand Up @@ -1232,6 +1236,12 @@ impl Component for SketchBoard {
}
}
} else {
if let InputEvent::Mouse(me) = &ie
&& matches!(me.type_, MouseEventType::Click | MouseEventType::BeginDrag)
{
self.renderer.grab_focus();
}

ie.handle_event_mouse_input(&self.renderer);
let active_tool_result = self
.active_tool
Expand Down
Loading
Loading