[libdazzle] stacklist: add animating style class



commit 6530bbe228673a023d93b93a9ad1856d8576cb33
Author: Christian Hergert <chergert redhat com>
Date:   Fri Aug 4 09:48:12 2017 -0700

    stacklist: add animating style class
    
    This allows us to animate the bold status of the widget, reducing the
    jitter in transitioning to the "sunk" position in the header.

 data/themes/shared/shared-stacklist.css |    4 ++++
 src/widgets/dzl-stack-list.c            |    5 +++++
 2 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/data/themes/shared/shared-stacklist.css b/data/themes/shared/shared-stacklist.css
index 24e5e64..8dc49fa 100644
--- a/data/themes/shared/shared-stacklist.css
+++ b/data/themes/shared/shared-stacklist.css
@@ -25,6 +25,9 @@ dzlstacklist list.stack-header:backdrop {
 dzlstacklist list.stack-header row:not(:last-child) {
   border-bottom: 1px solid rgba(0,0,0,0.1);
 }
+dzlstacklist list.stack-header row:last-child {
+  border-bottom: 1px solid transparent;
+}
 dzlstacklist list:not(.stack-header) row:active,
 dzlstacklist list:not(.stack-header) row:selected,
 dzlstacklist list.stack-header row:not(:last-child):active,
@@ -32,6 +35,7 @@ dzlstacklist list.stack-header row:not(:last-child):selected {
   color: @theme_selected_fg_color;
   background-color: @theme_selected_bg_color;
 }
+dzlstacklist row.animating label:not(.dim-label),
 dzlstacklist list.stack-header row:last-child label:not(.dim-label) {
   font-weight: bold;
 }
diff --git a/src/widgets/dzl-stack-list.c b/src/widgets/dzl-stack-list.c
index 7bc447b..c6e85df 100644
--- a/src/widgets/dzl-stack-list.c
+++ b/src/widgets/dzl-stack-list.c
@@ -24,6 +24,7 @@
 #include "util/dzl-util-private.h"
 #include "widgets/dzl-rect-helper.h"
 #include "widgets/dzl-stack-list.h"
+#include "util/dzl-gtk.h"
 
 #define FADE_DURATION  250
 #define SLIDE_DURATION 350
@@ -212,6 +213,8 @@ dzl_stack_list_end_anim (DzlStackList *self)
   info = g_ptr_array_index (priv->models, priv->models->len - 1);
   header = g_object_ref (priv->animating);
 
+  dzl_gtk_widget_remove_style_class (GTK_WIDGET (header), "animating");
+
   priv->animating = NULL;
 
   if (priv->animation != NULL)
@@ -290,6 +293,8 @@ dzl_stack_list_begin_anim (DzlStackList       *self,
 
   priv->animating = row;
 
+  dzl_gtk_widget_add_style_class (GTK_WIDGET (row), "animating");
+
   g_object_set (priv->animating_rect,
                 "x", begin_area->x,
                 "y", begin_area->y,


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