Add icons and tooltips for the previous commit's feature

This commit is contained in:
Keavon Chambers 2025-02-12 01:54:16 -08:00
parent 20a5f71bda
commit 7bbbf7fa7c
6 changed files with 67 additions and 10 deletions

View File

@ -191,14 +191,17 @@ impl LayoutHolder for PathTool {
.widget_holder();
let path_overlay_mode_widget = RadioInput::new(vec![
RadioEntryData::new("1")
.label("1")
RadioEntryData::new("all")
.icon("HandleVisibilityAll")
.tooltip("Show all handles regardless of selection")
.on_update(move |_| PathToolMessage::UpdateOptions(PathOptionsUpdate::OverlayModeType(PathOverlayMode::AllHandles)).into()),
RadioEntryData::new("2")
.label("2")
RadioEntryData::new("selected")
.icon("HandleVisibilitySelected")
.tooltip("Show only handles of the segments connected to selected points")
.on_update(move |_| PathToolMessage::UpdateOptions(PathOptionsUpdate::OverlayModeType(PathOverlayMode::SelectedPointHandles)).into()),
RadioEntryData::new("3")
.label("3")
RadioEntryData::new("frontier")
.icon("HandleVisibilityFrontier")
.tooltip("Show only handles at the frontiers of the segments connected to selected points")
.on_update(move |_| PathToolMessage::UpdateOptions(PathOptionsUpdate::OverlayModeType(PathOverlayMode::FrontierHandles)).into()),
])
.selected_index(Some(self.options.path_overlay_mode as u32))

View File

@ -144,11 +144,13 @@ impl LayoutHolder for PenTool {
widgets.push(
RadioInput::new(vec![
RadioEntryData::new("1")
.label("1")
RadioEntryData::new("all")
.icon("HandleVisibilityAll")
.tooltip("Show all handles regardless of selection")
.on_update(move |_| PenToolMessage::UpdateOptions(PenOptionsUpdate::OverlayModeType(PenOverlayMode::AllHandles)).into()),
RadioEntryData::new("2")
.label("2")
RadioEntryData::new("frontier")
.icon("HandleVisibilityFrontier")
.tooltip("Show only handles at the frontiers of the segments connected to selected points")
.on_update(move |_| PenToolMessage::UpdateOptions(PenOptionsUpdate::OverlayModeType(PenOverlayMode::FrontierHandles)).into()),
])
.selected_index(Some(self.options.pen_overlay_mode as u32))

View File

@ -0,0 +1,18 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
<rect y="7" width="3" height="3" />
<rect x="7" width="3" height="3" />
<rect x="15" y="8" width="1" height="1" />
<rect x="8" y="15" width="1" height="1" />
<path d="M11,3.53c1.71.86,2.92,2.58,3.05,4.6.11-.43.41-.79.81-.98-.45-2.11-1.91-3.84-3.86-4.65v1.03z" />
<path d="M3.53,6c.54-1.07,1.41-1.93,2.47-2.47v-1.03c-1.58.66-2.84,1.92-3.5,3.5h1.03z" />
<path d="M14.05,8.87c-.18,2.78-2.4,5-5.18,5.18.43.11.79.41.98.81,2.51-.53,4.48-2.5,5.01-5.01-.4-.19-.69-.54-.81-.98z" />
<path d="M8.13,14.05c-2.02-.13-3.74-1.34-4.6-3.05h-1.03c.81,1.95,2.54,3.41,4.65,3.86.19-.4.54-.69.98-.81z" />
<path d="M15,9.91v3.09h1v-3h-.5c-.18,0-.34-.04-.5-.09z" />
<path d="M15,4v3.09c.16-.06.32-.09.5-.09h.5v-3h-1z" />
<rect x="4" y="1" width="2" height="1" />
<rect x="11" y="1" width="2" height="1" />
<rect x="1" y="4" width="1" height="2" />
<rect x="1" y="11" width="1" height="2" />
<path d="M7.09,15h-3.09v1h3v-.5c0-.18.04-.34.09-.5z" />
<path d="M9.91,15c.06.16.09.32.09.5v.5h3v-1h-3.09z" />
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -0,0 +1,12 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
<rect y="7" width="3" height="3" />
<rect x="7" width="3" height="3" />
<rect x="15" y="8" width="1" height="1" />
<rect x="8" y="15" width="1" height="1" />
<path d="M11,3.53c1.71.86,2.92,2.58,3.05,4.6.11-.43.41-.79.81-.98-.45-2.11-1.91-3.84-3.86-4.65v1.03z" />
<path d="M3.53,6c.54-1.07,1.41-1.93,2.47-2.47v-1.03c-1.58.66-2.84,1.92-3.5,3.5h1.03z" />
<path d="M14.05,8.87c-.18,2.78-2.4,5-5.18,5.18.43.11.79.41.98.81,2.51-.53,4.48-2.5,5.01-5.01-.4-.19-.69-.54-.81-.98z" />
<path d="M8.13,14.05c-2.02-.13-3.74-1.34-4.6-3.05h-1.03c.81,1.95,2.54,3.41,4.65,3.86.19-.4.54-.69.98-.81z" />
<path d="M15,4v3.09c.16-.06.32-.09.5-.09h.5v-3h-1z" />
<path d="M7.09,15h-3.09v1h3v-.5c0-.18.04-.34.09-.5z" />
</svg>

After

Width:  |  Height:  |  Size: 772 B

View File

@ -0,0 +1,16 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
<rect y="7" width="3" height="3" />
<rect x="7" width="3" height="3" />
<rect x="15" y="8" width="1" height="1" />
<rect x="8" y="15" width="1" height="1" />
<path d="M11,3.53c1.71.86,2.92,2.58,3.05,4.6.11-.43.41-.79.81-.98-.45-2.11-1.91-3.84-3.86-4.65v1.03z" />
<path d="M3.53,6c.54-1.07,1.41-1.93,2.47-2.47v-1.03c-1.58.66-2.84,1.92-3.5,3.5h1.03z" />
<path d="M14.05,8.87c-.18,2.78-2.4,5-5.18,5.18.43.11.79.41.98.81,2.51-.53,4.48-2.5,5.01-5.01-.4-.19-.69-.54-.81-.98z" />
<path d="M8.13,14.05c-2.02-.13-3.74-1.34-4.6-3.05h-1.03c.81,1.95,2.54,3.41,4.65,3.86.19-.4.54-.69.98-.81z" />
<path d="M15,4v3.09c.16-.06.32-.09.5-.09h.5v-3h-1z" />
<rect x="4" y="1" width="2" height="1" />
<rect x="11" y="1" width="2" height="1" />
<rect x="1" y="4" width="1" height="2" />
<rect x="1" y="11" width="1" height="2" />
<path d="M7.09,15h-3.09v1h3v-.5c0-.18.04-.34.09-.5z" />
</svg>

After

Width:  |  Height:  |  Size: 946 B

View File

@ -133,6 +133,9 @@ import FrameSelected from "@graphite-frontend/assets/icon-16px-solid/frame-selec
import GraphViewClosed from "@graphite-frontend/assets/icon-16px-solid/graph-view-closed.svg";
import GraphViewOpen from "@graphite-frontend/assets/icon-16px-solid/graph-view-open.svg";
import GraphiteLogo from "@graphite-frontend/assets/icon-16px-solid/graphite-logo.svg";
import HandleVisibilityAll from "@graphite-frontend/assets/icon-16px-solid/handle-visibility-all.svg";
import HandleVisibilityFrontier from "@graphite-frontend/assets/icon-16px-solid/handle-visibility-frontier.svg";
import HandleVisibilitySelected from "@graphite-frontend/assets/icon-16px-solid/handle-visibility-selected.svg";
import HistoryRedo from "@graphite-frontend/assets/icon-16px-solid/history-redo.svg";
import HistoryUndo from "@graphite-frontend/assets/icon-16px-solid/history-undo.svg";
import IconsGrid from "@graphite-frontend/assets/icon-16px-solid/icons-grid.svg";
@ -242,6 +245,9 @@ const SOLID_16PX = {
GraphiteLogo: { svg: GraphiteLogo, size: 16 },
GraphViewClosed: { svg: GraphViewClosed, size: 16 },
GraphViewOpen: { svg: GraphViewOpen, size: 16 },
HandleVisibilityAll: { svg: HandleVisibilityAll, size: 16 },
HandleVisibilityFrontier: { svg: HandleVisibilityFrontier, size: 16 },
HandleVisibilitySelected: { svg: HandleVisibilitySelected, size: 16 },
HistoryRedo: { svg: HistoryRedo, size: 16 },
HistoryUndo: { svg: HistoryUndo, size: 16 },
IconsGrid: { svg: IconsGrid, size: 16 },