[nemiver] Bug 692965 - Fix colour issues with dark theme.



commit 1ef54607bfb463f07e7139b861dcdd1246e613d3
Author: Ignazio Sgalmuzzo <ignaker gmail com>
Date:   Sun Mar 26 20:02:07 2017 +0200

    Bug 692965 - Fix colour issues with dark theme.
    
        * src/persp/dbgperspective/nmv-registers-view.cc
        * src/persp/dbgperspective/nmv-variables-utils.cc
        * src/persp/dbgperspective/nmv-variables-utils.h
        * src/persp/dbgperspective/nmv-vars-treeview.cc:
        Replace deprecated foreground-gdk property with foreground-rgba,
        fixing dark theme text color issues.
    
    Signed-off-by: Hubert Figuière <hub figuiere net>

 src/persp/dbgperspective/nmv-registers-view.cc  |   12 ++++--------
 src/persp/dbgperspective/nmv-variables-utils.cc |    8 ++------
 src/persp/dbgperspective/nmv-variables-utils.h  |    2 +-
 src/persp/dbgperspective/nmv-vars-treeview.cc   |    4 ++--
 4 files changed, 9 insertions(+), 17 deletions(-)
---
diff --git a/src/persp/dbgperspective/nmv-registers-view.cc b/src/persp/dbgperspective/nmv-registers-view.cc
index 135838f..6d53ef8 100644
--- a/src/persp/dbgperspective/nmv-registers-view.cc
+++ b/src/persp/dbgperspective/nmv-registers-view.cc
@@ -38,7 +38,7 @@ struct RegisterColumns : public Gtk::TreeModelColumnRecord {
     Gtk::TreeModelColumn<IDebugger::register_id_t> id;
     Gtk::TreeModelColumn<Glib::ustring> name;
     Gtk::TreeModelColumn<Glib::ustring> value;
-    Gtk::TreeModelColumn<Gdk::Color> fg_color;
+    Gtk::TreeModelColumn<Gdk::RGBA> fg_color;
 
     RegisterColumns ()
     {
@@ -102,7 +102,7 @@ public:
         tree_view->append_column_editable (_("Value"), get_columns ().value);
         Gtk::TreeViewColumn * col = tree_view->get_column (2);
         col->add_attribute (*col->get_first_cell (),
-                            "foreground-gdk",
+                            "foreground-rgba",
                             get_columns ().fg_color);
         Gtk::CellRendererText* renderer =
                 dynamic_cast<Gtk::CellRendererText*>
@@ -280,16 +280,12 @@ public:
     void set_changed (Gtk::TreeModel::iterator& iter, bool changed = true)
     {
         if (changed) {
-            (*iter)[get_columns ().fg_color]  = Gdk::Color ("red");
+            (*iter)[get_columns ().fg_color]  = Gdk::RGBA ("red");
         } else {
             Gdk::RGBA rgba =
                 tree_view->get_style_context ()->get_color
                                                     (Gtk::STATE_FLAG_NORMAL);
-            Gdk::Color color;
-            color.set_rgb (rgba.get_red (),
-                           rgba.get_green (),
-                           rgba.get_blue ());
-            (*iter)[get_columns ().fg_color] = color;
+            (*iter)[get_columns ().fg_color] = rgba;
         }
     }
 
diff --git a/src/persp/dbgperspective/nmv-variables-utils.cc b/src/persp/dbgperspective/nmv-variables-utils.cc
index cebe8f2..787046d 100644
--- a/src/persp/dbgperspective/nmv-variables-utils.cc
+++ b/src/persp/dbgperspective/nmv-variables-utils.cc
@@ -190,18 +190,14 @@ update_a_variable_node (const IDebugger::VariableSafePtr a_var,
     if (do_highlight) {
         LOG_DD ("do highlight variable");
         (*a_iter)[get_variable_columns ().is_highlighted]=true;
-        (*a_iter)[get_variable_columns ().fg_color] = Gdk::Color ("red");
+        (*a_iter)[get_variable_columns ().fg_color] = Gdk::RGBA ("red");
     } else {
         LOG_DD ("remove highlight from variable");
         (*a_iter)[get_variable_columns ().is_highlighted]=false;
         Gdk::RGBA rgba =
             a_tree_view.get_style_context ()->get_color
                                                   (Gtk::STATE_FLAG_NORMAL);
-        Gdk::Color color;
-        color.set_rgb (rgba.get_red (),
-                       rgba.get_green (),
-                       rgba.get_blue ());
-        (*a_iter)[get_variable_columns ().fg_color] = color;
+        (*a_iter)[get_variable_columns ().fg_color] = rgba;
     }
 
     (*a_iter)[get_variable_columns ().value] = a_var->value ();
diff --git a/src/persp/dbgperspective/nmv-variables-utils.h b/src/persp/dbgperspective/nmv-variables-utils.h
index c90bb1c..801a84e 100644
--- a/src/persp/dbgperspective/nmv-variables-utils.h
+++ b/src/persp/dbgperspective/nmv-variables-utils.h
@@ -56,7 +56,7 @@ struct VariableColumns : public Gtk::TreeModelColumnRecord {
     Gtk::TreeModelColumn<IDebugger::VariableSafePtr> variable;
     Gtk::TreeModelColumn<bool> is_highlighted;
     Gtk::TreeModelColumn<bool> needs_unfolding;
-    Gtk::TreeModelColumn<Gdk::Color> fg_color;
+    Gtk::TreeModelColumn<Gdk::RGBA> fg_color;
     Gtk::TreeModelColumn<bool> variable_value_editable;
 
     VariableColumns ()
diff --git a/src/persp/dbgperspective/nmv-vars-treeview.cc b/src/persp/dbgperspective/nmv-vars-treeview.cc
index 7c924a3..27b1556 100644
--- a/src/persp/dbgperspective/nmv-vars-treeview.cc
+++ b/src/persp/dbgperspective/nmv-vars-treeview.cc
@@ -53,7 +53,7 @@ VarsTreeView::VarsTreeView (Glib::RefPtr<Gtk::TreeStore>& model) :
     THROW_IF_FAIL (col);
     col->set_resizable (true);
     col->add_attribute (*col->get_first_cell (),
-                        "foreground-gdk",
+                        "foreground-rgba",
                         vutil::VariableColumns::FG_COLOR_OFFSET);
 
     append_column (_("Value"), vutil::get_variable_columns ().value);
@@ -61,7 +61,7 @@ VarsTreeView::VarsTreeView (Glib::RefPtr<Gtk::TreeStore>& model) :
     THROW_IF_FAIL (col);
     col->set_resizable (true);
     col->add_attribute (*col->get_first_cell (),
-                        "foreground-gdk",
+                        "foreground-rgba",
                         vutil::VariableColumns::FG_COLOR_OFFSET);
     col->add_attribute (*col->get_first_cell (),
                         "editable",


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