Files
Graphite/editor/src/messages/tool/tool_message.rs
T
Oliver DaviesandKeavon Chambers e89cded4b8 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>
2025-07-13 08:26:36 +00:00

99 lines
1.8 KiB
Rust

use super::utility_types::ToolType;
use crate::messages::preferences::SelectionMode;
use crate::messages::prelude::*;
use graphene_std::raster::color::Color;
#[impl_message(Message, Tool)]
#[derive(PartialEq, Clone, Debug, serde::Serialize, serde::Deserialize)]
pub enum ToolMessage {
// Sub-messages
#[child]
TransformLayer(TransformLayerMessage),
#[child]
Select(SelectToolMessage),
#[child]
Artboard(ArtboardToolMessage),
#[child]
Navigate(NavigateToolMessage),
#[child]
Eyedropper(EyedropperToolMessage),
#[child]
Fill(FillToolMessage),
#[child]
Gradient(GradientToolMessage),
#[child]
Path(PathToolMessage),
#[child]
Pen(PenToolMessage),
#[child]
Freehand(FreehandToolMessage),
#[child]
Spline(SplineToolMessage),
#[child]
Shape(ShapeToolMessage),
#[child]
Text(TextToolMessage),
#[child]
Brush(BrushToolMessage),
// // #[child]
// Heal(HealToolMessage),
// // #[child]
// Clone(CloneToolMessage),
// // #[child]
// Patch(PatchToolMessage),
// // #[child]
// Relight(RelightToolMessage),
// // #[child]
// Detail(DetailToolMessage),
// Messages
// General tools
ActivateToolSelect,
ActivateToolArtboard,
ActivateToolNavigate,
ActivateToolEyedropper,
ActivateToolFill,
ActivateToolGradient,
// Vector tools
ActivateToolPath,
ActivateToolPen,
ActivateToolFreehand,
ActivateToolSpline,
ActivateToolShapeLine,
ActivateToolShapeRectangle,
ActivateToolShapeEllipse,
ActivateToolShape,
ActivateToolText,
// Raster tools
ActivateToolBrush,
ActivateTool {
tool_type: ToolType,
},
DeactivateTools,
InitTools,
PreUndo,
Redo,
RefreshToolOptions,
ResetColors,
SelectWorkingColor {
color: Color,
primary: bool,
},
SelectRandomWorkingColor {
primary: bool,
},
ToggleSelectVsPath,
SwapColors,
Undo,
UpdateCursor,
UpdateHints,
UpdateSelectionMode {
selection_mode: SelectionMode,
},
}