[PATCH] Update the background image paths used in Fedora.

David Shea dshea at redhat.com
Tue Nov 4 19:01:38 UTC 2014


With stylesheet help from Máirín Duffy.

Copy the RHEL sidebar and topbar background stylesheet blocks into
Fedora.  Change the Fedora background color. Stop gtk from making
buttons on the new background color look bad.

Update assureLogoImage to remove missing sidebar and topbar background
images from the stylesheet.
---
 data/anaconda-gtk.css         | 29 +++++++++--------------------
 pyanaconda/ui/gui/__init__.py | 19 ++++++++++++++++++-
 2 files changed, 27 insertions(+), 21 deletions(-)

diff --git a/data/anaconda-gtk.css b/data/anaconda-gtk.css
index 79220e9..230c961 100644
--- a/data/anaconda-gtk.css
+++ b/data/anaconda-gtk.css
@@ -113,15 +113,15 @@
 /* vendor-specific colors/images */
 
 @define-color redhat #41413e;
- at define-color fedora #006eb4;
+ at define-color fedora #2f4265;
 
-/* swap these into logo & sidebar classes for RHEL */
-/*
 .logo-sidebar {
     background-image: url('/usr/share/anaconda/pixmaps/sidebar-bg.png');
-    background-color: @redhat;
+    background-color: @fedora;
+    background-repeat: no-repeat;
 }
 
+/* logo and sidebar classes for Fedora */
 .logo {
     background-image: url('/usr/share/anaconda/pixmaps/sidebar-logo.png');
     background-position: 50% 20px;
@@ -130,27 +130,16 @@
 }
 
 AnacondaSpokeWindow #nav-box {
-    background-color: @redhat;
+    background-color: @fedora;
     background-image: url('/usr/share/anaconda/pixmaps/topbar-bg.png');
     background-repeat: repeat;
     color: white;
 }
 
-AnacondaSpokeWindow #layout-indicator {
-    color: black;
-}
-*/
-
-/* logo and sidebar classes for Fedora */
-.logo {
-    background-image: url('/usr/share/anaconda/pixmaps/logo.png');
-    background-position: 50% 20px;
-    background-repeat: no-repeat;
-    background-color: transparent;
-}
-
-.logo-sidebar {
-    background-color: @fedora;
+/* Remove the box-shadow from buttons in the nav-box because it adds a white stripe
+ * below the buttons and makes them look dumb */
+AnacondaSpokeWindow #nav-box GtkButton {
+    box-shadow: none;
 }
 
 AnacondaSpokeWindow #nav-box {
diff --git a/pyanaconda/ui/gui/__init__.py b/pyanaconda/ui/gui/__init__.py
index 32023c1..285f9f5 100644
--- a/pyanaconda/ui/gui/__init__.py
+++ b/pyanaconda/ui/gui/__init__.py
@@ -487,7 +487,7 @@ class GraphicalUserInterface(UserInterface):
         # make sure there is a logo image present,
         # otherwise the console will get spammed by errors
         replacement_image_path = None
-        logo_path = "/usr/share/anaconda/pixmaps/logo.png"
+        logo_path = "/usr/share/anaconda/pixmaps/sidebar-logo.png"
         header_path = "/usr/share/anaconda/pixmaps/anaconda_header.png"
         sad_smiley_path = "/usr/share/icons/Adwaita/48x48/emotes/face-crying.png"
         if not os.path.exists(logo_path):
@@ -509,6 +509,23 @@ class GraphicalUserInterface(UserInterface):
             else:
                 log.warning("logo image is missing")
 
+        # Look for the top and sidebar images. If missing remove the background-image
+        replacement_color = "#006eb4"
+        topbar_path = "/usr/share/anaconda/pixmaps/topbar-bg.png"
+        sidebar_path = "/usr/share/anaconda/pixmaps/sidebar-bg.png"
+        if not os.path.exists(topbar_path):
+            provider = Gtk.CssProvider()
+            provider.load_from_data("AnacondaSpokeWindow #nav-box { background-image: none; }")
+            Gtk.StyleContext.add_provider_for_screen(Gdk.Screen.get_default(), provider,
+                    Gtk.STYLE_PROVIDER_PRIORITY_USER)
+
+        if not os.path.exists(sidebar_path):
+            provider = Gtk.CssProvider()
+            provider.load_from_data(".logo-sidebar { background-image: none; }")
+            Gtk.StyleContext.add_provider_for_screen(Gdk.Screen.get_default(), provider,
+                    Gtk.STYLE_PROVIDER_PRIORITY_USER)
+
+
     def _widgetScale(self):
         # First, check if the GDK_SCALE environment variable is already set. If so,
         # leave it alone.
-- 
2.1.0



More information about the anaconda-patches mailing list