diff --git a/src/app.rs b/src/app.rs index bb55ce2..90e367a 100644 --- a/src/app.rs +++ b/src/app.rs @@ -91,14 +91,23 @@ impl GPSApp { let settings = Settings::load_settings(); window.set_size_request(settings.app_width, settings.app_height); + let paned: Paned = builder + .object("graph_dashboard-paned") + .expect("Couldn't get graph_dashboard-paned"); + paned.set_position(settings.app_graph_dashboard_paned_pos); let paned: Paned = builder .object("graph_logs-paned") .expect("Couldn't get graph_logs-paned"); paned.set_position(settings.app_graph_logs_paned_pos); let paned: Paned = builder - .object("graph_favorites-paned") - .expect("Couldn't get graph_favorites-paned"); - paned.set_position(settings.app_graph_favorites_paned_pos); + .object("elements_preview-paned") + .expect("Couldn't get elements_preview-paned"); + paned.set_position(settings.app_elements_preview_paned_pos); + let paned: Paned = builder + .object("elements_properties-paned") + .expect("Couldn't get elements_properties-paned"); + paned.set_position(settings.app_elements_properties_paned_pos); + if settings.app_maximized { window.maximize(); } @@ -147,6 +156,11 @@ impl GPSApp { settings.app_maximized = window.is_maximized(); settings.app_width = window.width(); settings.app_height = window.height(); + let paned: Paned = app + .builder + .object("graph_dashboard-paned") + .expect("Couldn't get graph_dashboard-paned"); + settings.app_graph_dashboard_paned_pos = paned.position(); let paned: Paned = app .builder .object("graph_logs-paned") @@ -154,9 +168,14 @@ impl GPSApp { settings.app_graph_logs_paned_pos = paned.position(); let paned: Paned = app .builder - .object("graph_favorites-paned") - .expect("Couldn't get graph_favorites-paned"); - settings.app_graph_favorites_paned_pos = paned.position(); + .object("elements_preview-paned") + .expect("Couldn't get elements_preview-paned"); + settings.app_elements_preview_paned_pos = paned.position(); + let paned: Paned = app + .builder + .object("elements_properties-paned") + .expect("Couldn't get elements_properties-paned"); + settings.app_elements_properties_paned_pos = paned.position(); Settings::save_settings(&settings); let pop_menu: PopoverMenu = app diff --git a/src/gps.ui b/src/gps.ui index 6f3cbb4..8f82885 100644 --- a/src/gps.ui +++ b/src/gps.ui @@ -42,7 +42,7 @@ _Add plugin app.graph.add-plugin - +
@@ -50,7 +50,7 @@ _Remove favorite app.favorite.remove -
+
@@ -77,9 +77,9 @@ <primary>n - _Add to favorite - app.node.add-to-favorite - <primary>A + _Add to favorite + app.node.add-to-favorite + <primary>A
@@ -91,7 +91,7 @@ 10 - mainwindow + mainwindow 320 260 True @@ -120,7 +120,7 @@ - mainwindow + mainwindow 320 260 True @@ -154,20 +154,20 @@ 800 600 - - - - 3 - 0 - - - primary_menu - - - open-menu-symbolic + + + + 3 + 0 + + + primary_menu - + + open-menu-symbolic + + @@ -226,55 +226,91 @@ 1 + - - vertical - 400 - - - 600 - True - True - True - - - True - True - - - - - + + 600 + True + True + True + + + + vertical + 400 + + + True + True + + + + + + + + + + + + + + + + + + + + + + vertical + 400 + + + + vertical + 400 + + + True + True + + + + - - - - - - True - True - - + + + + True + True + + + + - - + + + + + + True + True + + + + + + + - - - - - - - - - - - - - - - + + + + + + diff --git a/src/settings.rs b/src/settings.rs index c15d3db..1bb3238 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -13,8 +13,10 @@ pub struct Settings { pub app_maximized: bool, pub app_width: i32, pub app_height: i32, + pub app_graph_dashboard_paned_pos: i32, pub app_graph_logs_paned_pos: i32, - pub app_graph_favorites_paned_pos: i32, + pub app_elements_preview_paned_pos: i32, + pub app_elements_properties_paned_pos: i32, } impl Settings { @@ -102,8 +104,10 @@ impl Settings { Settings { app_width: 800, app_height: 600, + app_graph_dashboard_paned_pos: 600, app_graph_logs_paned_pos: 400, - app_graph_favorites_paned_pos: 600, + app_elements_preview_paned_pos: 300, + app_elements_properties_paned_pos: 150, ..Default::default() } }