[gnome-clocks] Use css to fade in the selection bar
- From: Paolo Borelli <pborelli src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-clocks] Use css to fade in the selection bar
- Date: Sun, 24 Feb 2013 15:35:46 +0000 (UTC)
commit 4e99507eaeadfc4307490c7da177d4ff7336102e
Author: Paolo Borelli <pborelli gnome org>
Date: Sun Feb 24 16:35:11 2013 +0100
Use css to fade in the selection bar
data/css/gnome-clocks.css | 9 +++++++++
src/widgets.vala | 9 ++++++++-
2 files changed, 17 insertions(+), 1 deletions(-)
---
diff --git a/data/css/gnome-clocks.css b/data/css/gnome-clocks.css
index 70d162f..4af78aa 100644
--- a/data/css/gnome-clocks.css
+++ b/data/css/gnome-clocks.css
@@ -177,6 +177,15 @@
border-image: url("button-border-stop-active.svg") 3 3 4 3 / 3 3 4 3 stretch;
}
+.clocks-fade {
+ opacity: 0;
+ transition: opacity 300ms;
+}
+
+.clocks-fade-in {
+ opacity: 1;
+}
+
.view.clocks-laps {
font-size: larger;
background-color: @theme_bg_color;
diff --git a/src/widgets.vala b/src/widgets.vala
index 4aacd19..6e87219 100644
--- a/src/widgets.vala
+++ b/src/widgets.vala
@@ -408,7 +408,13 @@ public class ContentView : Gtk.Bin {
}
main_toolbar.set_labels (label, null);
- selection_toolbar.set_visible (n_items != 0);
+ if (n_items != 0) {
+ selection_toolbar.show ();
+ selection_toolbar.get_style_context ().add_class ("clocks-fade-in");
+ } else {
+ selection_toolbar.hide ();
+ selection_toolbar.get_style_context ().remove_class ("clocks-fade-in");
+ }
});
icon_view.item_activated.connect ((path) => {
@@ -436,6 +442,7 @@ public class ContentView : Gtk.Bin {
toolbar.valign = Gtk.Align.END;
toolbar.margin_bottom = 40;
toolbar.get_style_context ().add_class ("osd");
+ toolbar.get_style_context ().add_class ("clocks-fade");
toolbar.set_size_request (SELECTION_TOOLBAR_WIDTH, -1);
toolbar.no_show_all = true;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]