Commit f13e4f32 authored by Guillaume Seguin's avatar Guillaume Seguin

Woops, bring back critical line & use Set/GetSize to track window size #520

parent 815a3f15
...@@ -165,12 +165,10 @@ class PronterWindow(MainWindow, pronsole.pronsole): ...@@ -165,12 +165,10 @@ class PronterWindow(MainWindow, pronsole.pronsole):
# consequences. # consequences.
# -- Okai, it seems it breaks things like update_gviz_params >< # -- Okai, it seems it breaks things like update_gviz_params ><
os.putenv("UBUNTU_MENUPROXY", "0") os.putenv("UBUNTU_MENUPROXY", "0")
style = wx.DEFAULT_FRAME_STYLE size = (self.settings.last_window_width, self.settings.last_window_height)
MainWindow.__init__(self, None, title = _("Pronterface"), size = size)
if self.settings.last_window_maximized: if self.settings.last_window_maximized:
style |= wx.MAXIMIZE self.Maximize()
MainWindow.__init__(self, None, title = _("Pronterface"),
size = size, style = style)
self.SetClientSize(size)
self.SetIcon(wx.Icon(iconfile("pronterface.png"), wx.BITMAP_TYPE_PNG)) self.SetIcon(wx.Icon(iconfile("pronterface.png"), wx.BITMAP_TYPE_PNG))
self.Bind(wx.EVT_SIZE, self.on_resize) self.Bind(wx.EVT_SIZE, self.on_resize)
self.Bind(wx.EVT_MAXIMIZE, self.on_maximize) self.Bind(wx.EVT_MAXIMIZE, self.on_maximize)
...@@ -304,7 +302,7 @@ class PronterWindow(MainWindow, pronsole.pronsole): ...@@ -304,7 +302,7 @@ class PronterWindow(MainWindow, pronsole.pronsole):
if evtsz[0] < area[2] - 20 or evtsz[1] < area[3] - 20: if evtsz[0] < area[2] - 20 or evtsz[1] < area[3] - 20:
self.set("last_window_maximized", False) self.set("last_window_maximized", False)
if not maximized and not self.IsIconized(): if not maximized and not self.IsIconized():
size = self.GetClientSize() size = self.GetSize()
self.set("last_window_width", size[0]) self.set("last_window_width", size[0])
self.set("last_window_height", size[1]) self.set("last_window_height", size[1])
event.Skip() event.Skip()
......
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