[PATCH 3/5] Adjust main window size based on install type.

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

 



From: Brian C. Lane <bcl@xxxxxxxxxx>

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

Related: rhbz#663411
---
 gui.py |   29 +++++++++++++----------------
 1 files changed, 13 insertions(+), 16 deletions(-)

diff --git a/gui.py b/gui.py
index c2e2fe9..5e96ed8 100755
--- a/gui.py
+++ b/gui.py
@@ -1549,31 +1549,28 @@ 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 self.anaconda.id.x_already_set:
-                # running on a pre-existing X, probably through X11 forwarding
-                pass
-            else:
-                # normal graphical install or a VNC session
-                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.1.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux