[cheese] Replaced GtkRcStyle with GtkStyleContext



commit 35e01b4d4f289b4a09829a361a6281bdb6421b34
Author: Patricia Santana Cruz <patriciasc openismus com>
Date:   Fri Feb 18 14:40:12 2011 +0100

    Replaced GtkRcStyle with GtkStyleContext

 data/Makefile.am              |    6 +++---
 data/cheese.css               |    3 ++-
 src/cheese-main.vala          |    2 --
 src/cheese-window.vala        |   15 +++++++++++++++
 src/thumbview/eog-thumb-nav.c |    4 +++-
 5 files changed, 23 insertions(+), 7 deletions(-)
---
diff --git a/data/Makefile.am b/data/Makefile.am
index 7f5c458..e02f76a 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -8,8 +8,8 @@ desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
 gsettings_SCHEMAS = org.gnome.Cheese.gschema.xml
 @GSETTINGS_RULES@
 
-gtkrcdir = $(pkgdatadir)
-gtkrc_DATA = gtkrc
+cssdir = $(pkgdatadir)
+css_DATA = cheese.css
 
 pkgdata_DATA = \
 	cheese-main-window.ui	\
@@ -28,7 +28,7 @@ EXTRA_DIST = \
 	$(gsettings_SCHEMAS) \
 	$(service_in_files) \
 	$(pkgdata_DATA) \
-	$(gtkrc_DATA)
+        $(css_DATA)
 
 clean-local :
 	rm -f *~
diff --git a/data/cheese.css b/data/cheese.css
index 6ee548f..6e71f80 100644
--- a/data/cheese.css
+++ b/data/cheese.css
@@ -1,4 +1,5 @@
-* {
+GtkScrollbar#hscrollbar,
+GtkScrollbar#vscrollbar {
   -GtkScrollbar-has-backward-stepper: 0;
   -GtkScrollbar-has-secondary-backward-stepper: 0;
   -GtkScrollbar-has-forward-stepper: 0;
diff --git a/src/cheese-main.vala b/src/cheese-main.vala
index 928d284..760fbd1 100644
--- a/src/cheese-main.vala
+++ b/src/cheese-main.vala
@@ -148,8 +148,6 @@ public class Cheese.Main : Gtk.Application
     Intl.bind_textdomain_codeset (Config.GETTEXT_PACKAGE, "UTF-8");
     Intl.textdomain (Config.GETTEXT_PACKAGE);
 
-    //Gtk.rc_parse (GLib.Path.build_filename (Config.PACKAGE_DATADIR, "gtkrc"));
-
     GtkClutter.init (ref args);
 
     Cheese.Main app;
diff --git a/src/cheese-window.vala b/src/cheese-window.vala
index 84ac245..e324a07 100644
--- a/src/cheese-window.vala
+++ b/src/cheese-window.vala
@@ -1184,6 +1184,21 @@ public class Cheese.MainWindow : Gtk.Window
     thumb_view = new Cheese.ThumbView ();
     thumb_nav  = new Eog.ThumbNav (thumb_view, false);
 
+    Gtk.CssProvider css;
+    try
+    {
+      css = new Gtk.CssProvider();
+      css.load_from_path (GLib.Path.build_filename (Config.PACKAGE_DATADIR, "cheese.css"));
+    }
+    catch (Error e)
+    {
+      stdout.printf ("Error: %s\n", e.message);
+    }
+
+    Gtk.StyleContext context;
+    context = thumb_view.get_style_context ();
+    context.add_provider (css, 600);
+
     thumb_view.button_press_event.connect (on_thumbnail_mouse_button_press);
 
     this.add (main_vbox);
diff --git a/src/thumbview/eog-thumb-nav.c b/src/thumbview/eog-thumb-nav.c
index 427ff00..8eab49d 100644
--- a/src/thumbview/eog-thumb-nav.c
+++ b/src/thumbview/eog-thumb-nav.c
@@ -472,7 +472,9 @@ eog_thumb_nav_init (EogThumbNav *nav)
   priv->sw = gtk_scrolled_window_new (NULL, NULL);
 
   gtk_widget_set_name (gtk_scrolled_window_get_hscrollbar (GTK_SCROLLED_WINDOW (priv->sw)),
-                       "eog-image-collection-scrollbar");
+                       "hscrollbar");
+  gtk_widget_set_name (gtk_scrolled_window_get_vscrollbar (GTK_SCROLLED_WINDOW (priv->sw)),
+                       "vscrollbar");
 
   gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (priv->sw),
                                        GTK_SHADOW_IN);



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