[gnote/stable-0.8] Remove use of GtkStyle
- From: Aurimas Äernius <aurimasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnote/stable-0.8] Remove use of GtkStyle
- Date: Mon, 12 Mar 2012 21:14:48 +0000 (UTC)
commit 9c365f24ef63b6abc01f5ee9b61118ea8f841d26
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]