mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-21 03:28:11 +08:00
Remove the "coming soon" dialog and hide not-yet-ready features/tools
This commit is contained in:
@@ -25,9 +25,6 @@ pub enum DialogMessage {
|
||||
localized_commit_date: String,
|
||||
localized_commit_year: String,
|
||||
},
|
||||
RequestComingSoonDialog {
|
||||
issue: Option<u32>,
|
||||
},
|
||||
RequestDemoArtworkDialog,
|
||||
RequestExportDialog,
|
||||
RequestLicensesDialogWithLocalizedCommitDate {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
@@ -224,9 +224,6 @@ pub enum FrontendMessage {
|
||||
#[serde(rename = "dataBuffer")]
|
||||
data_buffer: JsRawBuffer,
|
||||
},
|
||||
UpdateDocumentModeLayout {
|
||||
diff: Vec<WidgetDiff>,
|
||||
},
|
||||
UpdateDocumentRulers {
|
||||
origin: (f64, f64),
|
||||
spacing: f64,
|
||||
|
||||
@@ -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),
|
||||
];
|
||||
|
||||
|
||||
@@ -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 },
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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(),
|
||||
];
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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)]
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)),
|
||||
// ),
|
||||
],
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user