[gnome-documents] all: update OSD styling Adwaita changes



commit 4e23f192386564221fa071a80632a9964b270bab
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Thu Apr 19 16:47:05 2012 -0400

    all: update OSD styling Adwaita changes

 src/notifications.js |    4 ++--
 src/selections.js    |   10 +++++-----
 src/utils.js         |    7 +++++++
 3 files changed, 14 insertions(+), 7 deletions(-)
---
diff --git a/src/notifications.js b/src/notifications.js
index 0607a05..554838e 100644
--- a/src/notifications.js
+++ b/src/notifications.js
@@ -26,6 +26,7 @@ const GtkClutter = imports.gi.GtkClutter;
 const _ = imports.gettext.gettext;
 
 const Global = imports.global;
+const Utils = imports.utils;
 
 const Lang = imports.lang;
 const Signals = imports.signals;
@@ -105,8 +106,7 @@ NotificationManager.prototype = {
 
         this.actor = new GtkClutter.Actor({ contents: this.widget,
                                             opacity: 0 });
-        this.actor.get_widget().get_style_context().add_class('documents-osd');
-        this.actor.get_widget().reset_style();
+        Utils.alphaGtkWidget(this.actor.get_widget());
 
         this.widget.add(this._grid);
         this._grid.show();
diff --git a/src/selections.js b/src/selections.js
index 5ee96ec..846c0af 100644
--- a/src/selections.js
+++ b/src/selections.js
@@ -21,6 +21,7 @@
 
 const EvView = imports.gi.EvinceView;
 const Gd = imports.gi.Gd;
+const Gdk = imports.gi.Gdk;
 const GLib = imports.gi.GLib;
 const Gtk = imports.gi.Gtk;
 const GtkClutter = imports.gi.GtkClutter;
@@ -699,13 +700,12 @@ SelectionToolbar.prototype = {
 
         this.widget = new Gtk.Toolbar({ show_arrow: false,
                                         icon_size: Gtk.IconSize.LARGE_TOOLBAR });
+        this.widget.get_style_context().add_class('osd');
 
         this.actor = new GtkClutter.Actor({ contents: this.widget,
                                             show_on_set_parent: false,
                                             opacity: 0 });
-        let actorWidget = this.actor.get_widget();
-        actorWidget.get_style_context().add_class('documents-osd');
-        actorWidget.reset_style();
+        Utils.alphaGtkWidget(this.actor.get_widget());
 
         this._leftBox = new Gtk.Box({ orientation: Gtk.Orientation.HORIZONTAL });
         this._leftGroup = new Gtk.ToolItem({ child: this._leftBox });
@@ -859,11 +859,11 @@ SelectionToolbar.prototype = {
             if (isFavorite) {
                 favoriteLabel = _("Remove from favorites");
                 this._toolbarFavorite.set_active(true);
-                this._toolbarFavorite.get_style_context().add_class('favorite');
+                this._toolbarFavorite.get_style_context().add_class('documents-favorite');
             } else {
                 favoriteLabel = _("Add to favorites");
                 this._toolbarFavorite.set_active(false);
-                this._toolbarFavorite.get_style_context().remove_class('favorite');
+                this._toolbarFavorite.get_style_context().remove_class('documents-favorite');
             }
 
             this._toolbarFavorite.reset_style();
diff --git a/src/utils.js b/src/utils.js
index 4840a4f..d3f060c 100644
--- a/src/utils.js
+++ b/src/utils.js
@@ -110,6 +110,13 @@ function isSearchEvent(event) {
     return retval;
 }
 
+function alphaGtkWidget(widget) {
+    widget.override_background_color(0, new Gdk.RGBA({ red: 0,
+                                                       green: 0,
+                                                       blue: 0,
+                                                       alpha: 0 }));
+}
+
 function debug(str) {
     if (!debugInit) {
         let env = GLib.getenv('DOCUMENTS_DEBUG');



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