[gnome-clocks] Implement blinking in the paused timer



commit dc83448c17ecb49edeffa771f3b1bc6d3e44a71b
Author: Paolo Borelli <pborelli gnome org>
Date:   Thu Aug 15 21:17:54 2013 +0200

    Implement blinking in the paused timer
    
    The implementation is done with CSS so that we can tweak it or do neat
    things like turning it off in backdrop.

 data/css/gnome-clocks.css |   12 ++++++++++++
 src/timer.vala            |    4 ++++
 2 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/data/css/gnome-clocks.css b/data/css/gnome-clocks.css
index 79b9196..cdf8da8 100644
--- a/data/css/gnome-clocks.css
+++ b/data/css/gnome-clocks.css
@@ -236,3 +236,15 @@
     border-color: #d3d7cf;
 }
 
+ keyframes clocks-blink {
+    0% { color: @theme_fg_color; }
+    100% { color: @insensitive_fg_color; }
+}
+
+.clocks-blink {
+    animation-name: clocks-blink;
+    animation-iteration-count: infinite;  
+    animation-timing-function: cubic-bezier(1.0,0,0,1.0);
+    animation-duration: 1s; 
+}
+
diff --git a/src/timer.vala b/src/timer.vala
index 38ce989..f427289 100644
--- a/src/timer.vala
+++ b/src/timer.vala
@@ -225,6 +225,8 @@ public class MainPanel : Gtk.Stack, Clocks.Clock {
         state = State.RUNNING;
         timer.start ();
         add_tick ();
+        var context = countdown_label.get_style_context ();
+        context.remove_class ("clocks-blink");
     }
 
     private void pause () {
@@ -233,6 +235,8 @@ public class MainPanel : Gtk.Stack, Clocks.Clock {
         span -= timer.elapsed ();
         countdown_frame.pause ();
         remove_tick ();
+        var context = countdown_label.get_style_context ();
+        context.add_class ("clocks-blink");
     }
 
     private void add_tick () {


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