[gnote] Remove use of GtkStyle



commit 4e2ee4d67eb84710ad83eff063502a579358f427
Author: Aurimas Äernius <aurisc4 gmail com>
Date:   Sun Mar 11 22:31:15 2012 +0200

    Remove use of GtkStyle

 src/notetag.cpp |   14 ++++----------
 1 files changed, 4 insertions(+), 10 deletions(-)
---
diff --git a/src/notetag.cpp b/src/notetag.cpp
index f3e2c6d..8d8ce2e 100644
--- a/src/notetag.cpp
+++ b/src/notetag.cpp
@@ -303,16 +303,10 @@ namespace gnote {
     if (property_background_set().get_value())
       return property_background_gdk().get_value();
 
-    
-    GtkStyle * s = gtk_rc_get_style_by_paths(gtk_settings_get_default(), "GtkTextView", "GtkTextView", GTK_TYPE_TEXT_VIEW);
-    if (!s) {
-      DBG_OUT("get_background: Style for GtkTextView came back null! Returning white...");
-      Gdk::Color color;
-      color.set_rgb(0xff, 0xff, 0xff); //white, for lack of a better idea
-      return color;
-    }
-    else
-      return Glib::wrap(&(s->bg[GTK_STATE_NORMAL]), true);
+    Gdk::RGBA rgba = Gtk::TextView().get_style_context()->get_background_color();
+    Gdk::Color color;
+    color.set_rgb(rgba.get_red_u(), rgba.get_green_u(), rgba.get_blue_u());
+    return color;
   }
 
   Gdk::Color NoteTag::render_foreground(ContrastPaletteColor symbol)



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