Skip to content

Commit 5b472a6

Browse files
committed
Remove the "coming soon" dialog and hide not-yet-ready features/tools
1 parent 74d9c91 commit 5b472a6

File tree

18 files changed

+124
-239
lines changed

18 files changed

+124
-239
lines changed

editor/src/messages/dialog/dialog_message.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ pub enum DialogMessage {
2525
localized_commit_date: String,
2626
localized_commit_year: String,
2727
},
28-
RequestComingSoonDialog {
29-
issue: Option<u32>,
30-
},
3128
RequestDemoArtworkDialog,
3229
RequestExportDialog,
3330
RequestLicensesDialogWithLocalizedCommitDate {

editor/src/messages/dialog/dialog_message_handler.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use super::simple_dialogs::{self, AboutGraphiteDialog, ComingSoonDialog, DemoArtworkDialog, LicensesDialog};
1+
use super::simple_dialogs::{self, AboutGraphiteDialog, DemoArtworkDialog, LicensesDialog};
22
use crate::messages::dialog::simple_dialogs::LicensesThirdPartyDialog;
33
use crate::messages::layout::utility_types::widget_prelude::*;
44
use crate::messages::prelude::*;
@@ -62,10 +62,6 @@ impl MessageHandler<DialogMessage, DialogMessageContext<'_>> for DialogMessageHa
6262

6363
dialog.send_dialog_to_frontend(responses);
6464
}
65-
DialogMessage::RequestComingSoonDialog { issue } => {
66-
let dialog = ComingSoonDialog { issue };
67-
dialog.send_dialog_to_frontend(responses);
68-
}
6965
DialogMessage::RequestDemoArtworkDialog => {
7066
let dialog = DemoArtworkDialog;
7167
dialog.send_dialog_to_frontend(responses);

editor/src/messages/dialog/simple_dialogs/coming_soon_dialog.rs

Lines changed: 0 additions & 48 deletions
This file was deleted.

editor/src/messages/dialog/simple_dialogs/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
mod about_graphite_dialog;
22
mod close_all_documents_dialog;
33
mod close_document_dialog;
4-
mod coming_soon_dialog;
54
mod demo_artwork_dialog;
65
mod error_dialog;
76
mod licenses_dialog;
@@ -10,7 +9,6 @@ mod licenses_third_party_dialog;
109
pub use about_graphite_dialog::AboutGraphiteDialog;
1110
pub use close_all_documents_dialog::CloseAllDocumentsDialog;
1211
pub use close_document_dialog::CloseDocumentDialog;
13-
pub use coming_soon_dialog::ComingSoonDialog;
1412
pub use demo_artwork_dialog::ARTWORK;
1513
pub use demo_artwork_dialog::DemoArtworkDialog;
1614
pub use error_dialog::ErrorDialog;

editor/src/messages/frontend/frontend_message.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,6 @@ pub enum FrontendMessage {
224224
#[serde(rename = "dataBuffer")]
225225
data_buffer: JsRawBuffer,
226226
},
227-
UpdateDocumentModeLayout {
228-
diff: Vec<WidgetDiff>,
229-
},
230227
UpdateDocumentRulers {
231228
origin: (f64, f64),
232229
spacing: f64,

editor/src/messages/input_mapper/input_mappings.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ use crate::messages::input_mapper::utility_types::misc::{KeyMappingEntries, Mapp
88
use crate::messages::portfolio::document::node_graph::utility_types::Direction;
99
use crate::messages::portfolio::document::utility_types::clipboards::Clipboard;
1010
use crate::messages::portfolio::document::utility_types::misc::GroupFolderType;
11+
use crate::messages::portfolio::utility_types::KeyboardPlatformLayout;
1112
use crate::messages::prelude::*;
1213
use crate::messages::tool::tool_messages::brush_tool::BrushToolMessageOptionsUpdate;
1314
use crate::messages::tool::tool_messages::select_tool::SelectToolPointerKeys;
@@ -493,16 +494,20 @@ pub fn input_mappings() -> Mapping {
493494
pub fn zoom_with_scroll() -> Mapping {
494495
use InputMapperMessage::*;
495496

497+
// 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
498+
let keyboard_platform = GLOBAL_PLATFORM.get().copied().unwrap_or_default().as_keyboard_platform_layout();
499+
496500
let mut mapping = input_mappings();
497501

498502
let remove = [
499503
entry!(WheelScroll; modifiers=[Control], action_dispatch=NavigationMessage::CanvasZoomMouseWheel),
504+
entry!(WheelScroll; modifiers=[Command], action_dispatch=NavigationMessage::CanvasZoomMouseWheel),
500505
entry!(WheelScroll; modifiers=[Shift], action_dispatch=NavigationMessage::CanvasPanMouseWheel { use_y_as_x: true }),
501506
entry!(WheelScroll; action_dispatch=NavigationMessage::CanvasPanMouseWheel { use_y_as_x: false }),
502507
];
503508
let add = [
504-
entry!(WheelScroll; modifiers=[Control], action_dispatch=NavigationMessage::CanvasPanMouseWheel { use_y_as_x: true }),
505-
entry!(WheelScroll; modifiers=[Shift], action_dispatch=NavigationMessage::CanvasPanMouseWheel { use_y_as_x: false }),
509+
entry!(WheelScroll; modifiers=[Control], action_dispatch=NavigationMessage::CanvasPanMouseWheel { use_y_as_x: keyboard_platform == KeyboardPlatformLayout::Mac }),
510+
entry!(WheelScroll; modifiers=[Shift], action_dispatch=NavigationMessage::CanvasPanMouseWheel { use_y_as_x: keyboard_platform != KeyboardPlatformLayout::Mac }),
506511
entry!(WheelScroll; action_dispatch=NavigationMessage::CanvasZoomMouseWheel),
507512
];
508513

editor/src/messages/layout/layout_message_handler.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,6 @@ impl LayoutMessageHandler {
505505
LayoutTarget::DialogColumn1 => FrontendMessage::UpdateDialogColumn1 { diff },
506506
LayoutTarget::DialogColumn2 => FrontendMessage::UpdateDialogColumn2 { diff },
507507
LayoutTarget::DocumentBar => FrontendMessage::UpdateDocumentBarLayout { diff },
508-
LayoutTarget::DocumentMode => FrontendMessage::UpdateDocumentModeLayout { diff },
509508
LayoutTarget::LayersPanelBottomBar => FrontendMessage::UpdateLayersPanelBottomBarLayout { diff },
510509
LayoutTarget::LayersPanelControlLeftBar => FrontendMessage::UpdateLayersPanelControlBarLeftLayout { diff },
511510
LayoutTarget::LayersPanelControlRightBar => FrontendMessage::UpdateLayersPanelControlBarRightLayout { diff },

editor/src/messages/layout/utility_types/layout_widget.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ pub enum LayoutTarget {
2929
DialogColumn2,
3030
/// Contains the widgets located directly above the canvas to the right, for example the zoom in and out buttons.
3131
DocumentBar,
32-
/// Contains the dropdown for design / select / guide mode found on the top left of the canvas.
33-
DocumentMode,
3432
/// Controls for adding, grouping, and deleting layers at the bottom of the Layers panel.
3533
LayersPanelBottomBar,
3634
/// Blending options at the top of the Layers panel.
@@ -45,7 +43,7 @@ pub enum LayoutTarget {
4543
PropertiesPanel,
4644
/// The contextual input key/mouse combination shortcuts shown in the status bar at the bottom of the window.
4745
StatusBarHints,
48-
/// The bar directly above the canvas, left-aligned and to the right of the document mode dropdown.
46+
/// The left side of the control bar directly above the canvas.
4947
ToolOptions,
5048
/// The vertical buttons for all of the tools on the left of the canvas.
5149
ToolShelf,

editor/src/messages/portfolio/document/document_message_handler.rs

Lines changed: 35 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use crate::messages::portfolio::document::overlays::grid_overlays::{grid_overlay
1717
use crate::messages::portfolio::document::overlays::utility_types::{OverlaysType, OverlaysVisibilitySettings};
1818
use crate::messages::portfolio::document::properties_panel::properties_panel_message_handler::PropertiesPanelMessageContext;
1919
use crate::messages::portfolio::document::utility_types::document_metadata::{DocumentMetadata, LayerNodeIdentifier};
20-
use crate::messages::portfolio::document::utility_types::misc::{AlignAggregate, AlignAxis, DocumentMode, FlipAxis, PTZ};
20+
use crate::messages::portfolio::document::utility_types::misc::{AlignAggregate, AlignAxis, FlipAxis, PTZ};
2121
use crate::messages::portfolio::document::utility_types::network_interface::{FlowType, InputConnector, NodeTemplate};
2222
use crate::messages::portfolio::document::utility_types::nodes::RawBuffer;
2323
use crate::messages::portfolio::utility_types::PanelType;
@@ -91,8 +91,6 @@ pub struct DocumentMessageHandler {
9191
pub commit_hash: String,
9292
/// The current pan, tilt, and zoom state of the viewport's view of the document canvas.
9393
pub document_ptz: PTZ,
94-
/// The current mode that the document is in, which starts out as Design Mode. This choice affects the editing behavior of the tools.
95-
pub document_mode: DocumentMode,
9694
/// The current mode that the user has set for rendering the document within the viewport.
9795
/// This is usually "Normal" but can be set to "Outline" or "Pixels" to see the canvas differently.
9896
#[serde(alias = "view_mode")]
@@ -164,7 +162,6 @@ impl Default for DocumentMessageHandler {
164162
collapsed: CollapsedLayers::default(),
165163
commit_hash: GRAPHITE_GIT_COMMIT_HASH.to_string(),
166164
document_ptz: PTZ::default(),
167-
document_mode: DocumentMode::DesignMode,
168165
render_mode: RenderMode::default(),
169166
overlays_visibility_settings: OverlaysVisibilitySettings::default(),
170167
rulers_visible: true,
@@ -1859,8 +1856,6 @@ impl DocumentMessageHandler {
18591856
pub commit_hash: String,
18601857
/// The current pan, tilt, and zoom state of the viewport's view of the document canvas.
18611858
pub document_ptz: PTZ,
1862-
/// The current mode that the document is in, which starts out as Design Mode. This choice affects the editing behavior of the tools.
1863-
pub document_mode: DocumentMode,
18641859
/// The current mode that the user has set for rendering the document within the viewport.
18651860
/// This is usually "Normal" but can be set to "Outline" or "Pixels" to see the canvas differently.
18661861
pub view_mode: RenderMode,
@@ -1880,7 +1875,6 @@ impl DocumentMessageHandler {
18801875
collapsed: old_message_handler.collapsed,
18811876
commit_hash: old_message_handler.commit_hash,
18821877
document_ptz: old_message_handler.document_ptz,
1883-
document_mode: old_message_handler.document_mode,
18841878
render_mode: old_message_handler.view_mode,
18851879
overlays_visibility_settings: old_message_handler.overlays_visibility_settings,
18861880
rulers_visible: old_message_handler.rulers_visible,
@@ -2193,36 +2187,36 @@ impl DocumentMessageHandler {
21932187
}
21942188

21952189
pub fn update_document_widgets(&self, responses: &mut VecDeque<Message>, animation_is_playing: bool, time: Duration) {
2196-
// Document mode (dropdown menu at the left of the bar above the viewport, before the tool options)
2197-
2198-
let layout = Layout(vec![LayoutGroup::Row {
2199-
widgets: vec![
2200-
// DropdownInput::new(
2201-
// vec![vec![
2202-
// MenuListEntry::new(format!("{:?}", DocumentMode::DesignMode))
2203-
// .label(DocumentMode::DesignMode.to_string())
2204-
// .icon(DocumentMode::DesignMode.icon_name()),
2205-
// MenuListEntry::new(format!("{:?}", DocumentMode::SelectMode))
2206-
// .label(DocumentMode::SelectMode.to_string())
2207-
// .icon(DocumentMode::SelectMode.icon_name())
2208-
// .on_commit(|_| DialogMessage::RequestComingSoonDialog { issue: Some(330) }.into()),
2209-
// MenuListEntry::new(format!("{:?}", DocumentMode::GuideMode))
2210-
// .label(DocumentMode::GuideMode.to_string())
2211-
// .icon(DocumentMode::GuideMode.icon_name())
2212-
// .on_commit(|_| DialogMessage::RequestComingSoonDialog { issue: Some(331) }.into()),
2213-
// ]])
2214-
// .selected_index(Some(self.document_mode as u32))
2215-
// .draw_icon(true)
2216-
// .interactive(false) // TODO: set to true when dialogs are not spawned
2217-
// .widget_instance(),
2218-
// Separator::new(SeparatorType::Section).widget_instance(),
2219-
],
2220-
}]);
2221-
2222-
responses.add(LayoutMessage::SendLayout {
2223-
layout,
2224-
layout_target: LayoutTarget::DocumentMode,
2225-
});
2190+
// // Document mode (dropdown menu at the left of the bar above the viewport, before the tool options)
2191+
// let layout = Layout(vec![LayoutGroup::Row {
2192+
// widgets: vec![
2193+
// DropdownInput::new(
2194+
// vec![vec![
2195+
// MenuListEntry::new(format!("{:?}", DocumentMode::DesignMode))
2196+
// .label(DocumentMode::DesignMode.to_string())
2197+
// .icon(DocumentMode::DesignMode.icon_name()),
2198+
// // TODO: See issue #330
2199+
// MenuListEntry::new(format!("{:?}", DocumentMode::SelectMode))
2200+
// .label(DocumentMode::SelectMode.to_string())
2201+
// .icon(DocumentMode::SelectMode.icon_name())
2202+
// .on_commit(|_| todo!()),
2203+
// // TODO: See issue #331
2204+
// MenuListEntry::new(format!("{:?}", DocumentMode::GuideMode))
2205+
// .label(DocumentMode::GuideMode.to_string())
2206+
// .icon(DocumentMode::GuideMode.icon_name())
2207+
// .on_commit(|_| todo!()),
2208+
// ]])
2209+
// .selected_index(Some(self.document_mode as u32))
2210+
// .draw_icon(true)
2211+
// .interactive(false)
2212+
// .widget_instance(),
2213+
// Separator::new(SeparatorType::Section).widget_instance(),
2214+
// ],
2215+
// }]);
2216+
// responses.add(LayoutMessage::SendLayout {
2217+
// layout,
2218+
// layout_target: LayoutTarget::DocumentMode,
2219+
// });
22262220

22272221
// Document bar (right portion of the bar above the viewport)
22282222

@@ -2581,29 +2575,20 @@ impl DocumentMessageHandler {
25812575
.icon("RenderModeOutline")
25822576
.tooltip_label("Render Mode: Outline")
25832577
.on_update(|_| DocumentMessage::SetRenderMode { render_mode: RenderMode::Outline }.into()),
2578+
// TODO: See issue #320
25842579
// RadioEntryData::new("PixelPreview")
25852580
// .icon("RenderModePixels")
25862581
// .tooltip_label("Render Mode: Pixel Preview")
2587-
// .on_update(|_| DialogMessage::RequestComingSoonDialog { issue: Some(320) }.into()),
2582+
// .on_update(|_| todo!()),
2583+
// TODO: See issue #1845
25882584
// RadioEntryData::new("SvgPreview")
25892585
// .icon("RenderModeSvg")
25902586
// .tooltip_label("Render Mode: SVG Preview")
2591-
// .on_update(|_| DialogMessage::RequestComingSoonDialog { issue: Some(1845) }.into()),
2587+
// .on_update(|_| todo!()),
25922588
])
25932589
.selected_index(Some(self.render_mode as u32))
25942590
.narrow(true)
25952591
.widget_instance(),
2596-
// PopoverButton::new().popover_layout(
2597-
// Layout(vec![
2598-
// LayoutGroup::Row {
2599-
// widgets: vec![TextLabel::new("Render Mode").bold(true).widget_instance()],
2600-
// },
2601-
// LayoutGroup::Row {
2602-
// widgets: vec![TextLabel::new("Coming soon").widget_instance()],
2603-
// },
2604-
// ])
2605-
// .widget_instance(),
2606-
// ),
26072592
Separator::new(SeparatorType::Unrelated).widget_instance(),
26082593
];
26092594

editor/src/messages/portfolio/document/node_graph/node_graph_message_handler.rs

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

0 commit comments

Comments
 (0)