Blob Blame History Raw

# HG changeset patch
# User Eero Tamminen <eerot@users.berlios.de>
# Date 1315164472 -10800
# Node ID 679aca45fb459016ba426de78ea7906bab684bc7
# Parent  a99c28bacadd264e195585f961ad98959e922840
hatariui: hatari max window size defaults now to desktop size

(affects initial window size i.e. avoids resize at beginning)

diff -r a99c28bacadd -r 679aca45fb45 python-ui/hatari.py
--- a/python-ui/hatari.py	Sun Sep 04 22:24:01 2011 +0300
+++ b/python-ui/hatari.py	Sun Sep 04 22:27:52 2011 +0300
@@ -266,6 +266,8 @@
 
         self._hatari = hatari
         self._lock_updates = False
+        self._desktop_w = 0
+        self._desktop_h = 0
         self._options = []
 
     def validate(self):
@@ -687,9 +689,17 @@
         self._change_option("--aspect %s" % str(value))
 
     # ------------ max window size ---------------
+    def set_desktop_size(self, w, h):
+        self._desktop_w = w
+        self._desktop_h = h
+
     def get_max_size(self):
         w = self.get("[Screen]", "nMaxWidth")
         h = self.get("[Screen]", "nMaxHeight")
+        # default to desktop size?
+        if not (w or h):
+            w = self._desktop_w
+            h = self._desktop_h
         return (w, h)
 
     def set_max_size(self, w, h):
diff -r a99c28bacadd -r 679aca45fb45 python-ui/hatariui.py
--- a/python-ui/hatariui.py	Sun Sep 04 22:24:01 2011 +0300
+++ b/python-ui/hatariui.py	Sun Sep 04 22:27:52 2011 +0300
@@ -149,6 +149,8 @@
         socket.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse("black"))
         socket.set_events(gtk.gdk.ALL_EVENTS_MASK)
         socket.set_flags(gtk.CAN_FOCUS)
+        # set max Hatari window size = desktop size
+        self.config.set_desktop_size(gtk.gdk.screen_width(), gtk.gdk.screen_height())
         # set initial embedded hatari size
         width, height = self.config.get_window_size()
         socket.set_size_request(width, height)