@@ -17,7 +17,7 @@ use crate::messages::portfolio::document::overlays::grid_overlays::{grid_overlay
1717use crate :: messages:: portfolio:: document:: overlays:: utility_types:: { OverlaysType , OverlaysVisibilitySettings } ;
1818use crate :: messages:: portfolio:: document:: properties_panel:: properties_panel_message_handler:: PropertiesPanelMessageContext ;
1919use 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 } ;
2121use crate :: messages:: portfolio:: document:: utility_types:: network_interface:: { FlowType , InputConnector , NodeTemplate } ;
2222use crate :: messages:: portfolio:: document:: utility_types:: nodes:: RawBuffer ;
2323use 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
0 commit comments