From 9f64305d85a522551e22051091de109726491db1 Mon Sep 17 00:00:00 2001 From: Diego Giovane Pasqualin <dpasqualin@c3sl.ufpr.br> Date: Thu, 13 Mar 2014 11:36:02 -0300 Subject: [PATCH] Revert "ubiquity: Show labels in automatic side-by-side installation" This reverts commit d20c4ae1a7438d2e140a0d6958df4d3ef0657fbd. --- .../lib/ubiquity/ubiquity/frontend/gtk_ui.py | 3 -- .../lib/ubiquity/ubiquity/frontend/gtk_ui.py | 3 -- .../usr/lib/ubiquity/plugins/ubi-partman.py | 4 +- .../usr/lib/ubiquity/ubiquity/gtkwidgets.py | 45 ++++++++++++------- 4 files changed, 32 insertions(+), 23 deletions(-) diff --git a/ubiquity-frontend-gtk-le-light/package/usr/lib/ubiquity/ubiquity/frontend/gtk_ui.py b/ubiquity-frontend-gtk-le-light/package/usr/lib/ubiquity/ubiquity/frontend/gtk_ui.py index 1d67ca05..470b164f 100644 --- a/ubiquity-frontend-gtk-le-light/package/usr/lib/ubiquity/ubiquity/frontend/gtk_ui.py +++ b/ubiquity-frontend-gtk-le-light/package/usr/lib/ubiquity/ubiquity/frontend/gtk_ui.py @@ -253,9 +253,6 @@ class Wizard(BaseFrontend): provider.load_from_data( '''GtkProgressBar { -GtkProgressBar-min-horizontal-bar-height : 10 - } - GtkPaned { - -GtkPaned-handle-size: 10; }''') Gtk.StyleContext.add_provider_for_screen(Gdk.Screen.get_default(), diff --git a/ubiquity-frontend-gtk-le/package/usr/lib/ubiquity/ubiquity/frontend/gtk_ui.py b/ubiquity-frontend-gtk-le/package/usr/lib/ubiquity/ubiquity/frontend/gtk_ui.py index 1d67ca05..470b164f 100644 --- a/ubiquity-frontend-gtk-le/package/usr/lib/ubiquity/ubiquity/frontend/gtk_ui.py +++ b/ubiquity-frontend-gtk-le/package/usr/lib/ubiquity/ubiquity/frontend/gtk_ui.py @@ -253,9 +253,6 @@ class Wizard(BaseFrontend): provider.load_from_data( '''GtkProgressBar { -GtkProgressBar-min-horizontal-bar-height : 10 - } - GtkPaned { - -GtkPaned-handle-size: 10; }''') Gtk.StyleContext.add_provider_for_screen(Gdk.Screen.get_default(), diff --git a/ubiquity-le/package/usr/lib/ubiquity/plugins/ubi-partman.py b/ubiquity-le/package/usr/lib/ubiquity/plugins/ubi-partman.py index 92c0a11e..7d3cd6c5 100644 --- a/ubiquity-le/package/usr/lib/ubiquity/plugins/ubi-partman.py +++ b/ubiquity-le/package/usr/lib/ubiquity/plugins/ubi-partman.py @@ -413,8 +413,10 @@ class PageGtk(PageBase): if 'windows' in title.lower(): PATH = os.environ.get('UBIQUITY_PATH', False) or '/usr/share/ubiquity' icon.logo.set_from_file(os.path.join(PATH, 'pixmaps', 'windows_square.png')) + elif 'buntu' in title.lower(): + icon.set_property('icon-name', 'distributor-logo') else: - icon.set_property('icon-name', 'drive-harddisk') + icon.set_property('icon-name', 'block-device') # TODO See if we can get the filesystem label first in misc.py, # caching lookups. diff --git a/ubiquity-le/package/usr/lib/ubiquity/ubiquity/gtkwidgets.py b/ubiquity-le/package/usr/lib/ubiquity/ubiquity/gtkwidgets.py index 88298d29..f14a12fc 100644 --- a/ubiquity-le/package/usr/lib/ubiquity/ubiquity/gtkwidgets.py +++ b/ubiquity-le/package/usr/lib/ubiquity/ubiquity/gtkwidgets.py @@ -115,30 +115,16 @@ class ResizeWidget(Gtk.HPaned): # The max size (b) that the existing partition can be resized to. self.max_size = max_size - # Use test window to figure out highlight color - test_window = Gtk.Window() - test_label = Gtk.Label() - test_window.add(test_label) - style = test_label.get_style_context() - self.highlight_color = style.get_background_color( - Gtk.StateFlags.SELECTED) - self.highlight_color.alpha = 0.5 - # more recent python-gi has .to_color() override, copy it... - self.highlight_color_rgb = Gdk.Color(65535, 65535, 65535) - # FIXME: Why do we still need these event boxes to get proper bounds # for the linear gradient? self.existing_part = existing_part or PartitionBox() eb = Gtk.EventBox() - eb.modify_bg(Gtk.StateFlags.NORMAL, self.highlight_color_rgb) eb.add(self.existing_part) self.pack1(eb, resize=False, shrink=False) self.new_part = new_part or PartitionBox() eb = Gtk.EventBox() - eb.modify_bg(Gtk.StateFlags.NORMAL, self.highlight_color_rgb) eb.add(self.new_part) self.pack2(eb, resize=False, shrink=False) - self.show_all() # FIXME hideous, but do_realize fails inexplicably. self.connect('realize', self.realize) @@ -205,7 +191,7 @@ class DiskBox(Gtk.Box): GObject.type_register(DiskBox) -class PartitionBox(Gtk.Alignment):\ +class PartitionBox(StylizedFrame): __gtype_name__ = 'PartitionBox' __gproperties__ = { 'title' : (GObject.TYPE_STRING, 'Title', None, 'Title', @@ -244,7 +230,7 @@ class PartitionBox(Gtk.Alignment):\ # 4 px between the title and the extra heading # 5 px between the extra heading and the size # 12 px below the bottom-most element - Gtk.Alignment.__init__(self) + StylizedFrame.__init__(self) vbox = Gtk.Box() vbox.set_orientation(Gtk.Orientation.VERTICAL) self.logo = Gtk.Image.new_from_icon_name(icon_name, @@ -285,6 +271,33 @@ class PartitionBox(Gtk.Alignment):\ size = misc.format_size(size) self.size.set_markup('<span size="x-large">%s</span>' % size) + def render_dots(self): + # FIXME: Dots are rendered over the frame. + s = cairo.ImageSurface(cairo.FORMAT_ARGB32, 2, 2) + cr = cairo.Context(s) + cr.set_source_rgb(*gtk_to_cairo_color('#b6b0a9')) + cr.rectangle(1, 1, 1, 1) + cr.fill() + pattern = cairo.SurfacePattern(s) + return pattern + + def paint_background(self, c): + StylizedFrame.paint_background(self, c) + a = self.get_allocation() + pattern = self.render_dots() + pattern.set_extend(cairo.EXTEND_REPEAT) + c.set_source(pattern) + c.fill_preserve() + + g = cairo.RadialGradient(a.width / 2, a.height / 2, 0, a.width / 2, + a.height / 2, + a.width > a.height and a.width or a.height) + g.add_color_stop_rgba(0.00, 1, 1, 1, 1.00) + g.add_color_stop_rgba(0.25, 1, 1, 1, 0.75) + g.add_color_stop_rgba(0.40, 1, 1, 1, 0.00) + c.set_source(g) + c.fill_preserve() + GObject.type_register(PartitionBox) class StateBox(StylizedFrame): -- GitLab