[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[PATCH] Adjust main window size based on install type (#667566)



Without the resize flag the live install would shrink the
main window to fit each screen's widget set. With resize=True
it will expand to fit the content, but not shrink. This also
allows maximize() to work and we don't need to set a specific
window size.

Here are the current screen sizing rules:

* Normal Install
  - Full screen
  - Desktop hint (no window decorators)
  - Not resizable
  - If the screen is < 600 the header is removed
* LiveCD
  - Maximized window
  - Resizable
* Forwarded X
  - Not maximized
  - Resizable
---
 pyanaconda/gui.py |   29 +++++++++++++----------------
 1 files changed, 13 insertions(+), 16 deletions(-)

diff --git a/pyanaconda/gui.py b/pyanaconda/gui.py
index 36bcc76..3962475 100755
--- a/pyanaconda/gui.py
+++ b/pyanaconda/gui.py
@@ -1422,30 +1422,27 @@ class InstallControlWindow:
 
     def createWidgets (self):
         self.window.set_title(_("%s Installer") %(productName,))
-        
-        i = self.mainxml.get_widget("headerImage")        
+
+        i = self.mainxml.get_widget("headerImage")
         p = readImageFromFile("anaconda_header.png",
                               dither = False, image = i)
         if p is None:
             print(_("Unable to load title bar"))
-        if (gtk.gdk.screen_height() < 600) or \
-                (gtk.gdk.screen_height() <= 675 and flags.livecdInstall):
+
+        if flags.livecdInstall:
+            i.hide()
+            self.window.set_resizable(True)
+            self.window.maximize()
+        elif flags.preexisting_x11:
+            # Forwarded X11, don't take over their whole screen
             i.hide()
             self.window.set_resizable(True)
-            self.window.set_size_request(-1, -1)
         else:
-            # if we're running in the live mode and the dpi is something weird,
-            # give ourselves as much space as we can.  this gets things to fit
-            # with a dpi of up to 147
-            if flags.livecdInstall:
+            # Normal install, full screen
+            self.window.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_DESKTOP)
+            if gtk.gdk.screen_height() < 600:
                 i.hide()
-            elif flags.preexisting_x11:
-                # running on a pre-existing X, probably through X11 forwarding
-                pass 
-            else:
-                self.window.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_DESKTOP)
-
-        self.window.maximize()
+            self.window.maximize()
 
         if flags.debug:
             self.mainxml.get_widget("debugButton").show_now()
-- 
1.7.3.4


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]