diff --git a/plate-tool-web/assets/scss/default_theme/components/_plate_container.scss b/plate-tool-web/assets/scss/default_theme/components/_plate_container.scss index 7add8ef..0dcf6f2 100644 --- a/plate-tool-web/assets/scss/default_theme/components/_plate_container.scss +++ b/plate-tool-web/assets/scss/default_theme/components/_plate_container.scss @@ -41,11 +41,16 @@ div.plate_container { } } - div.plate_container--heatmap-notice { + div.plate_container--upper-left { position: absolute; top: 0.5em; left: 0.5em; + display: flex; + flex-direction: column; + } + + div.plate_container--heatmap-notice { animation: 1s 1 attention_on_load; } } diff --git a/plate-tool-web/src/components/callbacks/main_window_callbacks/settings_callbacks.rs b/plate-tool-web/src/components/callbacks/main_window_callbacks/settings_callbacks.rs index f266c1b..b093de3 100644 --- a/plate-tool-web/src/components/callbacks/main_window_callbacks/settings_callbacks.rs +++ b/plate-tool-web/src/components/callbacks/main_window_callbacks/settings_callbacks.rs @@ -35,6 +35,17 @@ pub fn toggle_volume_heatmap_callback( }) } +pub fn toggle_show_current_coordinates_callback( + main_dispatch: Dispatch, +) -> Callback { + let main_dispatch = main_dispatch.clone(); + Callback::from(move |_| { + main_dispatch.reduce_mut(|state| { + state.preferences.show_current_coordinates ^= true; + }) + }) +} + pub fn change_csv_export_type_callback( main_dispatch: Dispatch, ) -> Callback { diff --git a/plate-tool-web/src/components/main_window.rs b/plate-tool-web/src/components/main_window.rs index 3a5b376..d8d100c 100644 --- a/plate-tool-web/src/components/main_window.rs +++ b/plate-tool-web/src/components/main_window.rs @@ -48,6 +48,11 @@ pub fn MainWindow() -> Html { main_window_callbacks::toggle_volume_heatmap_callback(main_dispatch) }; + let toggle_show_current_coordinates_callback = { + let main_dispatch = main_dispatch.clone(); + main_window_callbacks::toggle_show_current_coordinates_callback(main_dispatch) + }; + let change_csv_export_type_callback = { let main_dispatch = main_dispatch.clone(); main_window_callbacks::change_csv_export_type_callback(main_dispatch) @@ -109,6 +114,7 @@ pub fn MainWindow() -> Html {
+