Commit a94bf324 authored by Guillaume Seguin's avatar Guillaume Seguin

Remember sash positon #467

parent 1798313f
...@@ -166,7 +166,8 @@ class MainWindow(wx.Frame): ...@@ -166,7 +166,8 @@ class MainWindow(wx.Frame):
page2panel2.SetSizer(page2sizer2) page2panel2.SetSizer(page2sizer2)
self.splitterwindow.SetMinimumPaneSize(1) self.splitterwindow.SetMinimumPaneSize(1)
self.splitterwindow.SetSashGravity(0.5) self.splitterwindow.SetSashGravity(0.5)
self.splitterwindow.SplitVertically(page2panel1, page2panel2, 0) self.splitterwindow.SplitVertically(page2panel1, page2panel2,
self.settings.last_sash_position)
self.mainsizer.Add(self.splitterwindow, 1, wx.EXPAND) self.mainsizer.Add(self.splitterwindow, 1, wx.EXPAND)
page1panel.SetSizer(self.mainsizer_page1) page1panel.SetSizer(self.mainsizer_page1)
page2panel.SetSizer(self.mainsizer) page2panel.SetSizer(self.mainsizer)
...@@ -223,7 +224,8 @@ class MainWindow(wx.Frame): ...@@ -223,7 +224,8 @@ class MainWindow(wx.Frame):
rightsizer.Add(self.splitterwindow, 1, wx.EXPAND) rightsizer.Add(self.splitterwindow, 1, wx.EXPAND)
vizpanel = self.newPanel(self.splitterwindow) vizpanel = self.newPanel(self.splitterwindow)
logpanel = self.newPanel(self.splitterwindow) logpanel = self.newPanel(self.splitterwindow)
self.splitterwindow.SplitVertically(vizpanel, logpanel, 0) self.splitterwindow.SplitVertically(vizpanel, logpanel,
self.settings.last_sash_position)
self.splitterwindow.shrinked = False self.splitterwindow.shrinked = False
else: else:
vizpanel = self.newPanel(lowerpanel) vizpanel = self.newPanel(lowerpanel)
......
...@@ -276,6 +276,16 @@ class PronterWindow(MainWindow, pronsole.pronsole): ...@@ -276,6 +276,16 @@ class PronterWindow(MainWindow, pronsole.pronsole):
self.createGui(self.settings.uimode == "Compact", self.createGui(self.settings.uimode == "Compact",
self.settings.controlsmode == "Mini") self.settings.controlsmode == "Mini")
if hasattr(self, "splitterwindow"):
def splitter_resize(event):
self.splitterwindow.UpdateSize()
self.splitterwindow.Bind(wx.EVT_SIZE, splitter_resize)
def sash_position_changed(event):
self.set("last_sash_position", self.splitterwindow.GetSashPosition())
self.splitterwindow.Bind(wx.EVT_SPLITTER_SASH_POS_CHANGED, sash_position_changed)
# Set gcview parameters here as they don't get set when viewers are # Set gcview parameters here as they don't get set when viewers are
# created # created
self.update_gcview_params() self.update_gcview_params()
...@@ -830,6 +840,7 @@ Printrun. If not, see <http://www.gnu.org/licenses/>.""" ...@@ -830,6 +840,7 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
self.settings._add(HiddenSetting("last_window_width", size[0])) self.settings._add(HiddenSetting("last_window_width", size[0]))
self.settings._add(HiddenSetting("last_window_height", size[1])) self.settings._add(HiddenSetting("last_window_height", size[1]))
self.settings._add(HiddenSetting("last_window_maximized", False)) self.settings._add(HiddenSetting("last_window_maximized", False))
self.settings._add(HiddenSetting("last_sash_position", -1))
self.settings._add(HiddenSetting("last_bed_temperature", 0.0)) self.settings._add(HiddenSetting("last_bed_temperature", 0.0))
self.settings._add(HiddenSetting("last_file_path", u"")) self.settings._add(HiddenSetting("last_file_path", u""))
self.settings._add(HiddenSetting("last_temperature", 0.0)) self.settings._add(HiddenSetting("last_temperature", 0.0))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment