Remove the "coming soon" dialog and hide not-yet-ready features/tools
Some checks failed
Editor: Dev & CI / build (push) Has been cancelled
Editor: Dev & CI / cargo-deny (push) Has been cancelled

This commit is contained in:
Keavon Chambers 2025-12-04 23:22:48 -08:00
parent 74d9c911bd
commit 5b472a64b2
18 changed files with 122 additions and 237 deletions

View file

@ -25,9 +25,6 @@ pub enum DialogMessage {
localized_commit_date: String,
localized_commit_year: String,
},
RequestComingSoonDialog {
issue: Option<u32>,
},
RequestDemoArtworkDialog,
RequestExportDialog,
RequestLicensesDialogWithLocalizedCommitDate {

View file

@ -1,4 +1,4 @@
use super::simple_dialogs::{self, AboutGraphiteDialog, ComingSoonDialog, DemoArtworkDialog, LicensesDialog};
use super::simple_dialogs::{self, AboutGraphiteDialog, DemoArtworkDialog, LicensesDialog};
use crate::messages::dialog::simple_dialogs::LicensesThirdPartyDialog;
use crate::messages::layout::utility_types::widget_prelude::*;
use crate::messages::prelude::*;
@ -62,10 +62,6 @@ impl MessageHandler<DialogMessage, DialogMessageContext<'_>> for DialogMessageHa
dialog.send_dialog_to_frontend(responses);
}
DialogMessage::RequestComingSoonDialog { issue } => {
let dialog = ComingSoonDialog { issue };
dialog.send_dialog_to_frontend(responses);
}
DialogMessage::RequestDemoArtworkDialog => {
let dialog = DemoArtworkDialog;
dialog.send_dialog_to_frontend(responses);

View file

@ -1,48 +0,0 @@
use crate::messages::layout::utility_types::widget_prelude::*;
use crate::messages::prelude::*;
/// A dialog to notify users of an unfinished issue, optionally with an issue number.
pub struct ComingSoonDialog {
pub issue: Option<u32>,
}
impl DialogLayoutHolder for ComingSoonDialog {
const ICON: &'static str = "Delay";
const TITLE: &'static str = "Coming Soon";
fn layout_buttons(&self) -> Layout {
let widgets = vec![TextButton::new("OK").emphasized(true).on_update(|_| FrontendMessage::DisplayDialogDismiss.into()).widget_instance()];
Layout(vec![LayoutGroup::Row { widgets }])
}
}
impl LayoutHolder for ComingSoonDialog {
fn layout(&self) -> Layout {
let header = vec![TextLabel::new("You've stumbled upon a placeholder").bold(true).widget_instance()];
let row1 = vec![TextLabel::new("This feature is not implemented yet.").widget_instance()];
let mut rows = vec![LayoutGroup::Row { widgets: header }, LayoutGroup::Row { widgets: row1 }];
if let Some(issue) = self.issue {
let row2 = vec![TextLabel::new("But you can help build it! Visit its issue:").widget_instance()];
let row3 = vec![
TextButton::new(format!("GitHub Issue #{issue}"))
.icon(Some("Website".into()))
.flush(true)
.on_update(move |_| {
FrontendMessage::TriggerVisitLink {
url: format!("https://github.com/GraphiteEditor/Graphite/issues/{issue}"),
}
.into()
})
.widget_instance(),
];
rows.push(LayoutGroup::Row { widgets: row2 });
rows.push(LayoutGroup::Row { widgets: row3 });
}
Layout(rows)
}
}

View file

@ -1,7 +1,6 @@
mod about_graphite_dialog;
mod close_all_documents_dialog;
mod close_document_dialog;
mod coming_soon_dialog;
mod demo_artwork_dialog;
mod error_dialog;
mod licenses_dialog;
@ -10,7 +9,6 @@ mod licenses_third_party_dialog;
pub use about_graphite_dialog::AboutGraphiteDialog;
pub use close_all_documents_dialog::CloseAllDocumentsDialog;
pub use close_document_dialog::CloseDocumentDialog;
pub use coming_soon_dialog::ComingSoonDialog;
pub use demo_artwork_dialog::ARTWORK;
pub use demo_artwork_dialog::DemoArtworkDialog;
pub use error_dialog::ErrorDialog;

View file

@ -224,9 +224,6 @@ pub enum FrontendMessage {
#[serde(rename = "dataBuffer")]
data_buffer: JsRawBuffer,
},
UpdateDocumentModeLayout {
diff: Vec<WidgetDiff>,
},
UpdateDocumentRulers {
origin: (f64, f64),
spacing: f64,

View file

@ -8,6 +8,7 @@ use crate::messages::input_mapper::utility_types::misc::{KeyMappingEntries, Mapp
use crate::messages::portfolio::document::node_graph::utility_types::Direction;
use crate::messages::portfolio::document::utility_types::clipboards::Clipboard;
use crate::messages::portfolio::document::utility_types::misc::GroupFolderType;
use crate::messages::portfolio::utility_types::KeyboardPlatformLayout;
use crate::messages::prelude::*;
use crate::messages::tool::tool_messages::brush_tool::BrushToolMessageOptionsUpdate;
use crate::messages::tool::tool_messages::select_tool::SelectToolPointerKeys;
@ -493,16 +494,20 @@ pub fn input_mappings() -> Mapping {
pub fn zoom_with_scroll() -> Mapping {
use InputMapperMessage::*;
// On Mac, the OS already converts Shift+scroll into horizontal scrolling so we have to reverse the behavior from normal to produce the same outcome
let keyboard_platform = GLOBAL_PLATFORM.get().copied().unwrap_or_default().as_keyboard_platform_layout();
let mut mapping = input_mappings();
let remove = [
entry!(WheelScroll; modifiers=[Control], action_dispatch=NavigationMessage::CanvasZoomMouseWheel),
entry!(WheelScroll; modifiers=[Command], action_dispatch=NavigationMessage::CanvasZoomMouseWheel),
entry!(WheelScroll; modifiers=[Shift], action_dispatch=NavigationMessage::CanvasPanMouseWheel { use_y_as_x: true }),
entry!(WheelScroll; action_dispatch=NavigationMessage::CanvasPanMouseWheel { use_y_as_x: false }),
];
let add = [
entry!(WheelScroll; modifiers=[Control], action_dispatch=NavigationMessage::CanvasPanMouseWheel { use_y_as_x: true }),
entry!(WheelScroll; modifiers=[Shift], action_dispatch=NavigationMessage::CanvasPanMouseWheel { use_y_as_x: false }),
entry!(WheelScroll; modifiers=[Control], action_dispatch=NavigationMessage::CanvasPanMouseWheel { use_y_as_x: keyboard_platform == KeyboardPlatformLayout::Mac }),
entry!(WheelScroll; modifiers=[Shift], action_dispatch=NavigationMessage::CanvasPanMouseWheel { use_y_as_x: keyboard_platform != KeyboardPlatformLayout::Mac }),
entry!(WheelScroll; action_dispatch=NavigationMessage::CanvasZoomMouseWheel),
];

View file

@ -505,7 +505,6 @@ impl LayoutMessageHandler {
LayoutTarget::DialogColumn1 => FrontendMessage::UpdateDialogColumn1 { diff },
LayoutTarget::DialogColumn2 => FrontendMessage::UpdateDialogColumn2 { diff },
LayoutTarget::DocumentBar => FrontendMessage::UpdateDocumentBarLayout { diff },
LayoutTarget::DocumentMode => FrontendMessage::UpdateDocumentModeLayout { diff },
LayoutTarget::LayersPanelBottomBar => FrontendMessage::UpdateLayersPanelBottomBarLayout { diff },
LayoutTarget::LayersPanelControlLeftBar => FrontendMessage::UpdateLayersPanelControlBarLeftLayout { diff },
LayoutTarget::LayersPanelControlRightBar => FrontendMessage::UpdateLayersPanelControlBarRightLayout { diff },

View file

@ -29,8 +29,6 @@ pub enum LayoutTarget {
DialogColumn2,
/// Contains the widgets located directly above the canvas to the right, for example the zoom in and out buttons.
DocumentBar,
/// Contains the dropdown for design / select / guide mode found on the top left of the canvas.
DocumentMode,
/// Controls for adding, grouping, and deleting layers at the bottom of the Layers panel.
LayersPanelBottomBar,
/// Blending options at the top of the Layers panel.
@ -45,7 +43,7 @@ pub enum LayoutTarget {
PropertiesPanel,
/// The contextual input key/mouse combination shortcuts shown in the status bar at the bottom of the window.
StatusBarHints,
/// The bar directly above the canvas, left-aligned and to the right of the document mode dropdown.
/// The left side of the control bar directly above the canvas.
ToolOptions,
/// The vertical buttons for all of the tools on the left of the canvas.
ToolShelf,

View file

@ -17,7 +17,7 @@ use crate::messages::portfolio::document::overlays::grid_overlays::{grid_overlay
use crate::messages::portfolio::document::overlays::utility_types::{OverlaysType, OverlaysVisibilitySettings};
use crate::messages::portfolio::document::properties_panel::properties_panel_message_handler::PropertiesPanelMessageContext;
use crate::messages::portfolio::document::utility_types::document_metadata::{DocumentMetadata, LayerNodeIdentifier};
use crate::messages::portfolio::document::utility_types::misc::{AlignAggregate, AlignAxis, DocumentMode, FlipAxis, PTZ};
use crate::messages::portfolio::document::utility_types::misc::{AlignAggregate, AlignAxis, FlipAxis, PTZ};
use crate::messages::portfolio::document::utility_types::network_interface::{FlowType, InputConnector, NodeTemplate};
use crate::messages::portfolio::document::utility_types::nodes::RawBuffer;
use crate::messages::portfolio::utility_types::PanelType;
@ -91,8 +91,6 @@ pub struct DocumentMessageHandler {
pub commit_hash: String,
/// The current pan, tilt, and zoom state of the viewport's view of the document canvas.
pub document_ptz: PTZ,
/// The current mode that the document is in, which starts out as Design Mode. This choice affects the editing behavior of the tools.
pub document_mode: DocumentMode,
/// The current mode that the user has set for rendering the document within the viewport.
/// This is usually "Normal" but can be set to "Outline" or "Pixels" to see the canvas differently.
#[serde(alias = "view_mode")]
@ -164,7 +162,6 @@ impl Default for DocumentMessageHandler {
collapsed: CollapsedLayers::default(),
commit_hash: GRAPHITE_GIT_COMMIT_HASH.to_string(),
document_ptz: PTZ::default(),
document_mode: DocumentMode::DesignMode,
render_mode: RenderMode::default(),
overlays_visibility_settings: OverlaysVisibilitySettings::default(),
rulers_visible: true,
@ -1859,8 +1856,6 @@ impl DocumentMessageHandler {
pub commit_hash: String,
/// The current pan, tilt, and zoom state of the viewport's view of the document canvas.
pub document_ptz: PTZ,
/// The current mode that the document is in, which starts out as Design Mode. This choice affects the editing behavior of the tools.
pub document_mode: DocumentMode,
/// The current mode that the user has set for rendering the document within the viewport.
/// This is usually "Normal" but can be set to "Outline" or "Pixels" to see the canvas differently.
pub view_mode: RenderMode,
@ -1880,7 +1875,6 @@ impl DocumentMessageHandler {
collapsed: old_message_handler.collapsed,
commit_hash: old_message_handler.commit_hash,
document_ptz: old_message_handler.document_ptz,
document_mode: old_message_handler.document_mode,
render_mode: old_message_handler.view_mode,
overlays_visibility_settings: old_message_handler.overlays_visibility_settings,
rulers_visible: old_message_handler.rulers_visible,
@ -2193,36 +2187,36 @@ impl DocumentMessageHandler {
}
pub fn update_document_widgets(&self, responses: &mut VecDeque<Message>, animation_is_playing: bool, time: Duration) {
// Document mode (dropdown menu at the left of the bar above the viewport, before the tool options)
let layout = Layout(vec![LayoutGroup::Row {
widgets: vec![
// DropdownInput::new(
// vec![vec![
// MenuListEntry::new(format!("{:?}", DocumentMode::DesignMode))
// .label(DocumentMode::DesignMode.to_string())
// .icon(DocumentMode::DesignMode.icon_name()),
// MenuListEntry::new(format!("{:?}", DocumentMode::SelectMode))
// .label(DocumentMode::SelectMode.to_string())
// .icon(DocumentMode::SelectMode.icon_name())
// .on_commit(|_| DialogMessage::RequestComingSoonDialog { issue: Some(330) }.into()),
// MenuListEntry::new(format!("{:?}", DocumentMode::GuideMode))
// .label(DocumentMode::GuideMode.to_string())
// .icon(DocumentMode::GuideMode.icon_name())
// .on_commit(|_| DialogMessage::RequestComingSoonDialog { issue: Some(331) }.into()),
// ]])
// .selected_index(Some(self.document_mode as u32))
// .draw_icon(true)
// .interactive(false) // TODO: set to true when dialogs are not spawned
// .widget_instance(),
// Separator::new(SeparatorType::Section).widget_instance(),
],
}]);
responses.add(LayoutMessage::SendLayout {
layout,
layout_target: LayoutTarget::DocumentMode,
});
// // Document mode (dropdown menu at the left of the bar above the viewport, before the tool options)
// let layout = Layout(vec![LayoutGroup::Row {
// widgets: vec![
// DropdownInput::new(
// vec![vec![
// MenuListEntry::new(format!("{:?}", DocumentMode::DesignMode))
// .label(DocumentMode::DesignMode.to_string())
// .icon(DocumentMode::DesignMode.icon_name()),
// // TODO: See issue #330
// MenuListEntry::new(format!("{:?}", DocumentMode::SelectMode))
// .label(DocumentMode::SelectMode.to_string())
// .icon(DocumentMode::SelectMode.icon_name())
// .on_commit(|_| todo!()),
// // TODO: See issue #331
// MenuListEntry::new(format!("{:?}", DocumentMode::GuideMode))
// .label(DocumentMode::GuideMode.to_string())
// .icon(DocumentMode::GuideMode.icon_name())
// .on_commit(|_| todo!()),
// ]])
// .selected_index(Some(self.document_mode as u32))
// .draw_icon(true)
// .interactive(false)
// .widget_instance(),
// Separator::new(SeparatorType::Section).widget_instance(),
// ],
// }]);
// responses.add(LayoutMessage::SendLayout {
// layout,
// layout_target: LayoutTarget::DocumentMode,
// });
// Document bar (right portion of the bar above the viewport)
@ -2581,29 +2575,20 @@ impl DocumentMessageHandler {
.icon("RenderModeOutline")
.tooltip_label("Render Mode: Outline")
.on_update(|_| DocumentMessage::SetRenderMode { render_mode: RenderMode::Outline }.into()),
// TODO: See issue #320
// RadioEntryData::new("PixelPreview")
// .icon("RenderModePixels")
// .tooltip_label("Render Mode: Pixel Preview")
// .on_update(|_| DialogMessage::RequestComingSoonDialog { issue: Some(320) }.into()),
// .on_update(|_| todo!()),
// TODO: See issue #1845
// RadioEntryData::new("SvgPreview")
// .icon("RenderModeSvg")
// .tooltip_label("Render Mode: SVG Preview")
// .on_update(|_| DialogMessage::RequestComingSoonDialog { issue: Some(1845) }.into()),
// .on_update(|_| todo!()),
])
.selected_index(Some(self.render_mode as u32))
.narrow(true)
.widget_instance(),
// PopoverButton::new().popover_layout(
// Layout(vec![
// LayoutGroup::Row {
// widgets: vec![TextLabel::new("Render Mode").bold(true).widget_instance()],
// },
// LayoutGroup::Row {
// widgets: vec![TextLabel::new("Coming soon").widget_instance()],
// },
// ])
// .widget_instance(),
// ),
Separator::new(SeparatorType::Unrelated).widget_instance(),
];

View file

@ -204,7 +204,7 @@ impl<'a> MessageHandler<NodeGraphMessage, NodeGraphMessageContext<'a>> for NodeG
NodeGraphMessage::CreateWire { output_connector, input_connector } => {
// TODO: Add support for flattening NodeInput::Import exports in flatten_with_fns https://github.com/GraphiteEditor/Graphite/issues/1762
if matches!(input_connector, InputConnector::Export(_)) && matches!(output_connector, OutputConnector::Import { .. }) {
responses.add(DialogMessage::RequestComingSoonDialog { issue: Some(1762) });
// We return early for now until this case becomes supported, then we can remove this
return;
}
network_interface.create_wire(&output_connector, &input_connector, selection_network_path);

View file

@ -26,33 +26,33 @@ pub enum AlignAggregate {
Center,
}
#[derive(Default, PartialEq, Eq, Clone, Copy, Debug, serde::Serialize, serde::Deserialize)]
pub enum DocumentMode {
#[default]
DesignMode,
SelectMode,
GuideMode,
}
// #[derive(Default, PartialEq, Eq, Clone, Copy, Debug, serde::Serialize, serde::Deserialize)]
// pub enum DocumentMode {
// #[default]
// DesignMode,
// SelectMode,
// GuideMode,
// }
impl fmt::Display for DocumentMode {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
DocumentMode::DesignMode => write!(f, "Design Mode"),
DocumentMode::SelectMode => write!(f, "Select Mode"),
DocumentMode::GuideMode => write!(f, "Guide Mode"),
}
}
}
// impl fmt::Display for DocumentMode {
// fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
// match self {
// DocumentMode::DesignMode => write!(f, "Design Mode"),
// DocumentMode::SelectMode => write!(f, "Select Mode"),
// DocumentMode::GuideMode => write!(f, "Guide Mode"),
// }
// }
// }
impl DocumentMode {
pub fn icon_name(&self) -> String {
match self {
DocumentMode::DesignMode => "ViewportDesignMode".to_string(),
DocumentMode::SelectMode => "ViewportSelectMode".to_string(),
DocumentMode::GuideMode => "ViewportGuideMode".to_string(),
}
}
}
// impl DocumentMode {
// pub fn icon_name(&self) -> String {
// match self {
// DocumentMode::DesignMode => "ViewportDesignMode".to_string(),
// DocumentMode::SelectMode => "ViewportSelectMode".to_string(),
// DocumentMode::GuideMode => "ViewportGuideMode".to_string(),
// }
// }
// }
/// SnappingState determines the current individual snapping states
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]

View file

@ -250,19 +250,6 @@ impl LayoutHolder for SelectTool {
let disabled = self.tool_data.selected_layers_count < 2;
widgets.push(Separator::new(SeparatorType::Unrelated).widget_instance());
widgets.extend(self.alignment_widgets(disabled));
// widgets.push(
// PopoverButton::new()
// .popover_layout(Layout(vec![
// LayoutGroup::Row {
// widgets: vec![TextLabel::new("Align").bold(true).widget_instance()],
// },
// LayoutGroup::Row {
// widgets: vec![TextLabel::new("Coming soon").widget_instance()],
// },
// ]))
// .disabled(disabled)
// .widget_instance(),
// );
// Flip
let disabled = self.tool_data.selected_layers_count == 0;

View file

@ -5,7 +5,7 @@ use super::tool_messages::*;
use crate::messages::broadcast::BroadcastMessage;
use crate::messages::broadcast::event::EventMessage;
use crate::messages::input_mapper::utility_types::input_keyboard::{Key, KeysGroup, LabeledKeyOrMouseMotion, LabeledShortcut, MouseMotion};
use crate::messages::input_mapper::utility_types::macros::{action_shortcut, action_shortcut_manual};
use crate::messages::input_mapper::utility_types::macros::action_shortcut;
use crate::messages::input_mapper::utility_types::misc::ActionShortcut;
use crate::messages::layout::utility_types::widget_prelude::*;
use crate::messages::portfolio::document::overlays::utility_types::OverlayProvider;
@ -251,7 +251,7 @@ impl LayoutHolder for ToolData {
.tooltip_label(shape.tooltip_label())
.tooltip_description(shape.tooltip_description())
.tooltip_shortcut(action_shortcut!(tool_type_to_activate_tool_message(shape.tool_type()))),
ToolAvailability::ComingSoon(tool) => tool.clone(),
// ToolAvailability::ComingSoon(tool) => tool.clone(),
}
})
.collect::<Vec<_>>()
@ -259,8 +259,6 @@ impl LayoutHolder for ToolData {
.flat_map(|group| {
let separator = std::iter::once(Separator::new(SeparatorType::Section).direction(SeparatorDirection::Vertical).widget_instance());
let buttons = group.into_iter().map(|ToolEntry { tooltip_label, tooltip_description, tooltip_shortcut, tool_type, icon_name }| {
let coming_soon = tooltip_description.contains("Coming soon.");
IconButton::new(icon_name, 32)
.disabled(false)
.active(match tool_type {
@ -276,9 +274,8 @@ impl LayoutHolder for ToolData {
ToolType::Rectangle => ToolMessage::ActivateToolShapeRectangle.into(),
ToolType::Ellipse => ToolMessage::ActivateToolShapeEllipse.into(),
ToolType::Shape => ToolMessage::ActivateToolShape.into(),
_ => {
if !coming_soon { (ToolMessage::ActivateTool { tool_type }).into() } else { (DialogMessage::RequestComingSoonDialog { issue: None }).into() }
}
_ => ToolMessage::ActivateTool { tool_type }.into(),
// _ => if !tooltip_description.contains("Coming soon.") { ToolMessage::ActivateTool { tool_type }.into() } else { Message::NoOp },
}
})
.widget_instance()
@ -324,7 +321,7 @@ impl Default for ToolFsmState {
.filter_map(|tool| match tool {
ToolAvailability::Available(tool) => Some((tool.tool_type(), tool)),
ToolAvailability::AvailableAsShape(_) => None,
ToolAvailability::ComingSoon(_) => None,
// ToolAvailability::ComingSoon(_) => None,
})
.collect(),
},
@ -391,7 +388,7 @@ impl ToolType {
enum ToolAvailability {
Available(Box<Tool>),
AvailableAsShape(ShapeType),
ComingSoon(ToolEntry),
// ComingSoon(ToolEntry),
}
/// List of all the tools in their conventional ordering and grouping.
@ -421,31 +418,29 @@ fn list_tools_in_groups() -> Vec<Vec<ToolAvailability>> {
vec![
// Raster tool group
ToolAvailability::Available(Box::<brush_tool::BrushTool>::default()),
ToolAvailability::ComingSoon(
ToolEntry::new(ToolType::Heal, "RasterHealTool")
.tooltip_label("Heal Tool")
.tooltip_description("Coming soon.")
.tooltip_shortcut(action_shortcut_manual!(Key::KeyJ)),
),
ToolAvailability::ComingSoon(
ToolEntry::new(ToolType::Clone, "RasterCloneTool")
.tooltip_label("Clone Tool")
.tooltip_description("Coming soon.")
.tooltip_shortcut(action_shortcut_manual!(Key::KeyC)),
),
ToolAvailability::ComingSoon(ToolEntry::new(ToolType::Patch, "RasterPatchTool").tooltip_label("Patch Tool").tooltip_description("Coming soon.")),
ToolAvailability::ComingSoon(
ToolEntry::new(ToolType::Detail, "RasterDetailTool")
.tooltip_label("Detail Tool")
.tooltip_description("Coming soon.")
.tooltip_shortcut(action_shortcut_manual!(Key::KeyD)),
),
ToolAvailability::ComingSoon(
ToolEntry::new(ToolType::Relight, "RasterRelightTool")
.tooltip_label("Relight Tool")
.tooltip_description("Coming soon.")
.tooltip_shortcut(action_shortcut_manual!(Key::KeyO)),
),
// ToolAvailability::ComingSoon(
// ToolEntry::new(ToolType::Heal, "RasterHealTool")
// .tooltip_label("Heal Tool")
// .tooltip_shortcut(action_shortcut_manual!(Key::KeyJ)),
// ),
// ToolAvailability::ComingSoon(
// ToolEntry::new(ToolType::Clone, "RasterCloneTool")
// .tooltip_label("Clone Tool")
// .tooltip_shortcut(action_shortcut_manual!(Key::KeyC)),
// ),
// ToolAvailability::ComingSoon(ToolEntry::new(ToolType::Patch, "RasterPatchTool")
// .tooltip_label("Patch Tool"),
// ),
// ToolAvailability::ComingSoon(
// ToolEntry::new(ToolType::Detail, "RasterDetailTool")
// .tooltip_label("Detail Tool")
// .tooltip_shortcut(action_shortcut_manual!(Key::KeyD)),
// ),
// ToolAvailability::ComingSoon(
// ToolEntry::new(ToolType::Relight, "RasterRelightTool")
// .tooltip_label("Relight Tool")
// .tooltip_shortcut(action_shortcut_manual!(Key::KeyO)),
// ),
],
]
}

View file

@ -1,7 +1,6 @@
<script lang="ts">
import { onDestroy, createEventDispatcher, getContext } from "svelte";
import { onDestroy, createEventDispatcher } from "svelte";
import type { Editor } from "@graphite/editor";
import type { HSV, RGB, FillChoice } from "@graphite/messages";
import type { MenuDirection } from "@graphite/messages";
import { Color, contrastingOutlineFactor, Gradient } from "@graphite/messages";
@ -40,8 +39,6 @@
["Magenta", "#ff00ff", "#696969"],
];
const editor = getContext<Editor>("editor");
const dispatch = createEventDispatcher<{ colorOrGradient: FillChoice; startHistoryTransaction: undefined }>();
export let colorOrGradient: FillChoice;
@ -378,13 +375,14 @@
oldIsNone = none;
}
async function activateEyedropperSample() {
// TODO: Replace this temporary solution that only works in Chromium-based browsers with the custom color sampler used by the Eyedropper tool
// TODO: Replace this temporary usage of the browser eyedropper API, that only works in Chromium-based browsers, with the custom color sampler system used by the Eyedropper tool
function eyedropperSupported(): boolean {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
if (!(window as any).EyeDropper) {
editor.handle.eyedropperSampleForColorPicker();
return;
}
return Boolean((window as any).EyeDropper);
}
async function activateEyedropperSample() {
if (!eyedropperSupported()) return;
try {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
@ -451,7 +449,7 @@
<LayoutCol
class="hue-picker"
data-tooltip-label="Hue"
data-tooltip-description={"The shade along the spectrum of the rainbow." + (disabled ? "\n\nDisabled (read-only)." : "")}
data-tooltip-description={`The shade along the spectrum of the rainbow.${disabled ? "\n\nDisabled (read-only)." : ""}`}
on:pointerdown={onPointerDown}
data-hue-picker
>
@ -462,7 +460,7 @@
<LayoutCol
class="alpha-picker"
data-tooltip-label="Alpha"
data-tooltip-description={"The level of translucency." + (disabled ? "\n\nDisabled (read-only)." : "")}
data-tooltip-description={`The level of translucency.${disabled ? "\n\nDisabled (read-only)." : ""}`}
on:pointerdown={onPointerDown}
data-alpha-picker
>
@ -526,7 +524,7 @@
<LayoutRow>
<TextLabel
tooltipLabel="Hex Color Code"
tooltipDescription={"Color code in hexadecimal format. 6 digits if opaque, 8 with alpha.\nAccepts input of CSS color values including named colors."}>Hex</TextLabel
tooltipDescription="Color code in hexadecimal format. 6 digits if opaque, 8 with alpha.\nAccepts input of CSS color values including named colors.">Hex</TextLabel
>
<Separator type="Related" />
<LayoutRow>
@ -539,7 +537,7 @@
}}
centered={true}
tooltipLabel="Hex Color Code"
tooltipDescription={"Color code in hexadecimal format. 6 digits if opaque, 8 with alpha.\nAccepts input of CSS color values including named colors."}
tooltipDescription="Color code in hexadecimal format. 6 digits if opaque, 8 with alpha.\nAccepts input of CSS color values including named colors."
bind:this={hexCodeInputWidget}
/>
</LayoutRow>
@ -677,8 +675,10 @@
/>
{/each}
</button>
<Separator type="Related" />
<IconButton icon="Eyedropper" size={24} {disabled} action={activateEyedropperSample} tooltipLabel="Eyedropper" tooltipDescription="Sample a pixel color from the document." />
{#if eyedropperSupported()}
<Separator type="Related" />
<IconButton icon="Eyedropper" size={24} {disabled} action={activateEyedropperSample} tooltipLabel="Eyedropper" tooltipDescription="Sample a pixel color from the document." />
{/if}
</LayoutRow>
</LayoutCol>
</LayoutRow>

View file

@ -506,7 +506,6 @@
<LayoutCol class="document" on:dragover={(e) => e.preventDefault()} on:drop={dropFile}>
<LayoutRow class="control-bar" classes={{ "for-graph": $document.graphViewOverlayOpen }} scrollableX={true}>
{#if !$document.graphViewOverlayOpen}
<WidgetLayout layout={$document.documentModeLayout} layoutTarget="DocumentMode" />
<WidgetLayout layout={$document.toolOptionsLayout} layoutTarget="ToolOptions" />
<LayoutRow class="spacer" />
<WidgetLayout layout={$document.documentBarLayout} layoutTarget="DocumentBar" />
@ -698,14 +697,14 @@
.icon-button {
margin: 0;
&[data-tooltip-description^="Coming soon."] {
opacity: 0.25;
transition: opacity 0.1s;
// &[data-tooltip-description^="Coming soon."] {
// opacity: 0.25;
// transition: opacity 0.1s;
&:hover {
opacity: 1;
}
}
// &:hover {
// opacity: 1;
// }
// }
&:not(.active) {
.color-general {

View file

@ -1496,7 +1496,6 @@ export type LayoutTarget =
| "DialogColumn1"
| "DialogColumn2"
| "DocumentBar"
| "DocumentMode"
| "LayersPanelBottomBar"
| "LayersPanelControlLeftBar"
| "LayersPanelControlRightBar"
@ -1646,8 +1645,6 @@ export class UpdateDialogColumn2 extends WidgetDiffUpdate {}
export class UpdateDocumentBarLayout extends WidgetDiffUpdate {}
export class UpdateDocumentModeLayout extends WidgetDiffUpdate {}
export class UpdateLayersPanelControlBarLeftLayout extends WidgetDiffUpdate {}
export class UpdateLayersPanelControlBarRightLayout extends WidgetDiffUpdate {}
@ -1721,7 +1718,6 @@ export const messageMakers: Record<string, MessageMaker> = {
UpdateDocumentBarLayout,
UpdateDocumentLayerDetails,
UpdateDocumentLayerStructureJs,
UpdateDocumentModeLayout,
UpdateDocumentRulers,
UpdateDocumentScrollbars,
UpdateExportReorderIndex,

View file

@ -6,7 +6,6 @@ import { type Editor } from "@graphite/editor";
import {
patchLayout,
UpdateDocumentBarLayout,
UpdateDocumentModeLayout,
UpdateToolOptionsLayout,
UpdateToolShelfLayout,
UpdateWorkingColorsLayout,
@ -19,7 +18,6 @@ import type { Layout } from "@graphite/messages";
export function createDocumentState(editor: Editor) {
const state = writable({
// Layouts
documentModeLayout: [] as Layout,
toolOptionsLayout: [] as Layout,
documentBarLayout: [] as Layout,
toolShelfLayout: [] as Layout,
@ -38,14 +36,6 @@ export function createDocumentState(editor: Editor) {
return state;
});
});
editor.subscriptions.subscribeJsMessage(UpdateDocumentModeLayout, async (updateDocumentModeLayout) => {
await tick();
update((state) => {
patchLayout(state.documentModeLayout, updateDocumentModeLayout);
return state;
});
});
editor.subscriptions.subscribeJsMessage(UpdateToolOptionsLayout, async (updateToolOptionsLayout) => {
await tick();

View file

@ -584,15 +584,6 @@ impl EditorHandle {
Ok(())
}
/// Begin sampling a pixel color from the document by entering eyedropper sampling mode
#[wasm_bindgen(js_name = eyedropperSampleForColorPicker)]
pub fn eyedropper_sample_for_color_picker(&self) -> Result<(), JsValue> {
let message = DialogMessage::RequestComingSoonDialog { issue: Some(832) };
self.dispatch(message);
Ok(())
}
/// Update primary color with values on a scale from 0 to 1.
#[wasm_bindgen(js_name = updatePrimaryColor)]
pub fn update_primary_color(&self, red: f32, green: f32, blue: f32, alpha: f32) -> Result<(), JsValue> {