Commit d20c4ae1 by Mozart Pistori Tomazetti

ubiquity: Show labels in automatic side-by-side installation

parent b835d77b
......@@ -253,6 +253,9 @@ 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(),
......
......@@ -253,6 +253,9 @@ 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(),
......
......@@ -413,10 +413,8 @@ 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', 'block-device')
icon.set_property('icon-name', 'drive-harddisk')
# TODO See if we can get the filesystem label first in misc.py,
# caching lookups.
......
......@@ -115,16 +115,30 @@ 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)
......@@ -191,7 +205,7 @@ class DiskBox(Gtk.Box):
GObject.type_register(DiskBox)
class PartitionBox(StylizedFrame):
class PartitionBox(Gtk.Alignment):\
__gtype_name__ = 'PartitionBox'
__gproperties__ = {
'title' : (GObject.TYPE_STRING, 'Title', None, 'Title',
......@@ -230,7 +244,7 @@ class PartitionBox(StylizedFrame):
# 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
StylizedFrame.__init__(self)
Gtk.Alignment.__init__(self)
vbox = Gtk.Box()
vbox.set_orientation(Gtk.Orientation.VERTICAL)
self.logo = Gtk.Image.new_from_icon_name(icon_name,
......@@ -271,33 +285,6 @@ class PartitionBox(StylizedFrame):
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):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment