summaryrefslogtreecommitdiff
path: root/src/tools
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2022-10-12 23:21:09 +0200
committerCarl Hetherington <cth@carlh.net>2022-10-14 11:41:18 +0200
commitd85bd416c6267e9c86948b9b5f2e5dba5e67f755 (patch)
treee60c0ada656c185eef9f581dbc9682fb244ebe57 /src/tools
parentdeb61d087799d18cce97b1f0f99fe036d2214a42 (diff)
Save and restore sash positions in the main DoM.
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/dcpomatic.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc
index a10cb9b35..eec81d3c8 100644
--- a/src/tools/dcpomatic.cc
+++ b/src/tools/dcpomatic.cc
@@ -287,7 +287,11 @@ public:
bool OnSashPositionChange(int new_position) override
{
/* Try to stop the left bit of the splitter getting too small */
- return new_position > _left_panel_minimum_size;
+ auto const ok = new_position > _left_panel_minimum_size;
+ if (ok) {
+ Config::instance()->set_main_divider_sash_position(new_position);
+ }
+ return ok;
}
private:
@@ -297,7 +301,7 @@ private:
/* The window is now fairly big but the left panel is small; this happens when the DCP-o-matic window
* is shrunk and then made larger again. Try to set a sensible left panel size in this case.
*/
- SetSashPosition(_left_panel_minimum_size);
+ SetSashPosition(Config::instance()->main_divider_sash_position().get_value_or(_left_panel_minimum_size));
}
ev.Skip();
@@ -410,7 +414,7 @@ public:
_right_panel->SetSizer(right_sizer);
- _splitter->SplitVertically(left_panel, _right_panel, left_panel->GetSize().GetWidth() + 8);
+ _splitter->SplitVertically(left_panel, _right_panel, Config::instance()->main_divider_sash_position().get_value_or(left_panel->GetSize().GetWidth() + 8));
set_menu_sensitivity ();