mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-22 05:38:11 +08:00
Add selection cycle and gray pre-selection outlines to the Path tool, and Tab to swap Select/Path tools (#2818)
* Added initial version of this feature for the path tool * Removed debug statements * Thickened the overlay width * Added hover highlighting for path tool * Experimental switch to path tool at leaf layer * Ghost outline initial implementation * Added tab swap for select tool -> path tool * Minor fix for Select Tool dbl click -> Path Tool * Added support for ghosts when using GRS in the path tool * Fixed GRS undo bug, vastly improved hover behavior and now clearly visualize next double click target * Fixed unused import warnings * Updated behavior to handle mouse movement cases, reverted line width to 1px * Fixed merge behavioral issues * Disabled Select Tool to Path Tool double click toggle, fixed single click drill through for special case * Clean up of unused consts and comment * Properly cancel the drill through state when the mouse moves * Fix some stuff --------- Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
co-authored by
Keavon Chambers
parent
d6d1bbb1e6
commit
e89cded4b8
@@ -284,6 +284,16 @@ impl MessageHandler<ToolMessage, ToolMessageContext<'_>> for ToolMessageHandler
|
||||
|
||||
document_data.update_working_colors(responses); // TODO: Make this an event
|
||||
}
|
||||
ToolMessage::ToggleSelectVsPath => {
|
||||
// If we have the select tool active, toggle to the path tool and vice versa
|
||||
let tool_data = &mut self.tool_state.tool_data;
|
||||
let active_tool_type = tool_data.active_tool_type;
|
||||
if active_tool_type == ToolType::Select {
|
||||
responses.add(ToolMessage::ActivateTool { tool_type: ToolType::Path });
|
||||
} else {
|
||||
responses.add(ToolMessage::ActivateTool { tool_type: ToolType::Select });
|
||||
}
|
||||
}
|
||||
ToolMessage::SwapColors => {
|
||||
let document_data = &mut self.tool_state.document_tool_data;
|
||||
|
||||
@@ -359,9 +369,12 @@ impl MessageHandler<ToolMessage, ToolMessageContext<'_>> for ToolMessageHandler
|
||||
|
||||
ActivateToolBrush,
|
||||
|
||||
ToggleSelectVsPath,
|
||||
|
||||
SelectRandomWorkingColor,
|
||||
ResetColors,
|
||||
SwapColors,
|
||||
|
||||
Undo,
|
||||
);
|
||||
list.extend(self.tool_state.tool_data.active_tool().actions());
|
||||
|
||||
Reference in New Issue
Block a user