[gnome-clocks] Expertimnt with alarm css



commit 7e35f129770e0476821d79f2f66fc3d3d59a9a39
Author: Paolo Borelli <pborelli gnome org>
Date:   Wed Dec 5 22:10:46 2012 +0100

    Expertimnt with alarm css
    
    Try to implement Andreas' mockup

 data/gtk-style.css     |   26 ++++++++++++--------------
 gnomeclocks/widgets.py |   12 +++++++-----
 2 files changed, 19 insertions(+), 19 deletions(-)
---
diff --git a/data/gtk-style.css b/data/gtk-style.css
index 1e78cf6..651dbf4 100644
--- a/data/gtk-style.css
+++ b/data/gtk-style.css
@@ -63,28 +63,26 @@
 
 .clocks-digital-renderer.active {
     background-color: transparent;
-    background-image: linear-gradient(to bottom,
-                                      rgb(223, 0, 0),
-                                      rgb(164, 0, 0)
-                                      );
+    background-image: -gtk-gradient(radial,
+                                    center center, 0,
+                                    center bottom, 1.0,
+                                    from(rgb(223, 0, 0)), to(rgb(164, 0, 0)));
     color: white;
 }
 
-.clocks-digital-renderer.active.inner {
+.clocks-digital-renderer.active:prelight {
     background-color: transparent;
-    background-image: linear-gradient(to bottom,
-                                      rgba(255, 255, 255, 0.3),
-                                      rgba(255, 255, 255, 0.1)
-                                      );
+    background-image: -gtk-gradient(radial,
+                                    center center, 0,
+                                    center bottom, 1.0,
+                                    from(rgb(223, 0, 0)), to(shade(rgb(164, 0, 0), 1.1)));
     color: white;
 }
 
-.clocks-digital-renderer.active.inner:prelight {
+.clocks-digital-renderer.active.inner {
     background-color: transparent;
-    background-image: linear-gradient(to bottom,
-                                      rgba(255, 255, 255, 0.4),
-                                      rgba(255, 255, 255, 0.15)
-                                      );
+    background-image: none;
+    color: white;
 }
 
 .clocks-go {
diff --git a/gnomeclocks/widgets.py b/gnomeclocks/widgets.py
index f782685..c8b6997 100644
--- a/gnomeclocks/widgets.py
+++ b/gnomeclocks/widgets.py
@@ -70,8 +70,6 @@ class DigitalClockRenderer(Gtk.CellRendererPixbuf):
         self.icon_size = 40
 
     def do_render(self, cr, widget, background_area, cell_area, flags):
-        Gtk.CellRendererPixbuf.do_render(self, cr, widget, background_area, cell_area, flags)
-
         context = widget.get_style_context()
 
         context.save()
@@ -81,11 +79,15 @@ class DigitalClockRenderer(Gtk.CellRendererPixbuf):
         cr.save()
         Gdk.cairo_rectangle(cr, cell_area)
         cr.clip()
-        cr.translate(cell_area.x, cell_area.y)
 
         # draw background
-        Gtk.render_frame(context, cr, 0, 0, cell_area.width, cell_area.height)
-        Gtk.render_background(context, cr, 0, 0, cell_area.width, cell_area.height)
+        if self.props.pixbuf:
+            Gtk.CellRendererPixbuf.do_render(self, cr, widget, background_area, cell_area, flags)
+        else:
+            Gtk.render_frame(context, cr, cell_area.x, cell_area.y, cell_area.width, cell_area.height)
+            Gtk.render_background(context, cr, cell_area.x, cell_area.y, cell_area.width, cell_area.height)
+
+        cr.translate(cell_area.x, cell_area.y)
 
         # for now the space around the digital clock is hardcoded and
         # relative to the image width (not the width of the cell which



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