[regexxer/murrayc-update: 3/12] Replace (deprecated) Gdk::Color with Gdk::RGBA.



commit 7e77d56eb9450d8ebd3cf94debe6560ecdf1d529
Author: Murray Cumming <murrayc murrayc com>
Date:   Mon Feb 29 23:21:07 2016 +0100

    Replace (deprecated) Gdk::Color with Gdk::RGBA.

 src/filetree.cc    |    8 ++++----
 src/filetree.h     |    6 +++---
 src/prefdialog.cc  |    8 ++++----
 src/stringutils.cc |    4 ++--
 src/stringutils.h  |    4 ++--
 5 files changed, 15 insertions(+), 15 deletions(-)
---
diff --git a/src/filetree.cc b/src/filetree.cc
index 58466a1..caa66c4 100644
--- a/src/filetree.cc
+++ b/src/filetree.cc
@@ -286,7 +286,7 @@ void FileTree::on_style_updated()
   pixbuf_load_failed_ = render_icon_pixbuf(Gtk::Stock::MISSING_IMAGE, Gtk::ICON_SIZE_MENU);
 
   Gdk::RGBA rgba = get_style_context()->get_color(Gtk::STATE_FLAG_INSENSITIVE);
-  color_load_failed_.set_rgb_p(rgba.get_red(), rgba.get_green(), rgba.get_blue());
+  color_load_failed_.set_rgba(rgba.get_red(), rgba.get_green(), rgba.get_blue());
 
   Gtk::TreeView::on_style_updated();
 }
@@ -317,7 +317,7 @@ void FileTree::text_cell_data_func(Gtk::CellRenderer* cell, const Gtk::TreeModel
   Gtk::CellRendererText& renderer = dynamic_cast<Gtk::CellRendererText&>(*cell);
   const FileInfoBasePtr  infobase = (*iter)[FileTreeColumns::instance().fileinfo];
 
-  const Gdk::Color* color = 0;
+  const Gdk::RGBA* color = 0;
 
   if (const FileInfoPtr fileinfo = shared_dynamic_cast<FileInfo>(infobase))
   {
@@ -333,9 +333,9 @@ void FileTree::text_cell_data_func(Gtk::CellRenderer* cell, const Gtk::TreeModel
   }
 
   if (color)
-    renderer.property_foreground_gdk() = *color;
+    renderer.property_foreground_rgba() = *color;
   else
-    renderer.property_foreground_gdk().reset_value();
+    renderer.property_foreground_rgba().reset_value();
 
   if (color == &color_modified_)
     renderer.property_style() = Pango::STYLE_OBLIQUE;
diff --git a/src/filetree.h b/src/filetree.h
index ba72227..384b706 100644
--- a/src/filetree.h
+++ b/src/filetree.h
@@ -26,7 +26,7 @@
 #include "signalutils.h"
 #include "undostack.h"
 
-#include <gdkmm/color.h>
+#include <gdkmm/rgba.h>
 #include <gdkmm/pixbuf.h>
 #include <gtkmm/treemodel.h>
 #include <gtkmm/treeview.h>
@@ -97,8 +97,8 @@ private:
   Glib::RefPtr<Gdk::Pixbuf>     pixbuf_file_;
   Glib::RefPtr<Gdk::Pixbuf>     pixbuf_load_failed_;
 
-  Gdk::Color                    color_modified_;
-  Gdk::Color                    color_load_failed_;
+  Gdk::RGBA                    color_modified_;
+  Gdk::RGBA                    color_load_failed_;
 
   TreeRowRefPtr                 last_selected_rowref_;
   FileInfoPtr                   last_selected_;
diff --git a/src/prefdialog.cc b/src/prefdialog.cc
index 782fcbe..c3824f7 100644
--- a/src/prefdialog.cc
+++ b/src/prefdialog.cc
@@ -122,11 +122,11 @@ void PrefDialog::on_conf_value_changed(const Glib::ustring& key)
   }
   else if (key.raw() == conf_key_match_color)
   {
-    button_match_color_->set_color(Gdk::Color(settings->get_string(key)));
+    button_match_color_->set_rgba(Gdk::RGBA(settings->get_string(key)));
   }
   else if (key.raw() == conf_key_current_match_color)
   {
-    button_current_color_->set_color(Gdk::Color(settings->get_string(key)));
+    button_current_color_->set_rgba(Gdk::RGBA(settings->get_string(key)));
   }
   else if (key.raw() == conf_key_fallback_encoding)
   {
@@ -154,13 +154,13 @@ void PrefDialog::on_textview_font_set()
 
 void PrefDialog::on_match_color_set()
 {
-  const Glib::ustring value = Util::color_to_string(button_match_color_->get_color());
+  const Glib::ustring value = Util::color_to_string(button_match_color_->get_rgba());
   Settings::instance()->set_string(conf_key_match_color, value);
 }
 
 void PrefDialog::on_current_color_set()
 {
-  const Glib::ustring value = Util::color_to_string(button_current_color_->get_color());
+  const Glib::ustring value = Util::color_to_string(button_current_color_->get_rgba());
   Settings::instance()->set_string(conf_key_current_match_color, value);
 }
 
diff --git a/src/stringutils.cc b/src/stringutils.cc
index ef69223..aeb5a17 100644
--- a/src/stringutils.cc
+++ b/src/stringutils.cc
@@ -23,7 +23,7 @@
 #include <glib.h>
 #include <glib-object.h>
 #include <glibmm.h>
-#include <gdkmm/color.h>
+#include <gdkmm/rgba.h>
 
 #include <algorithm>
 #include <iomanip>
@@ -680,7 +680,7 @@ Glib::ustring Util::filename_short_display_name(const std::string& filename)
   return Glib::filename_display_name(filename);
 }
 
-Glib::ustring Util::color_to_string(const Gdk::Color& color)
+Glib::ustring Util::color_to_string(const Gdk::RGBA& color)
 {
   std::ostringstream output;
 
diff --git a/src/stringutils.h b/src/stringutils.h
index 8032052..148b8d2 100644
--- a/src/stringutils.h
+++ b/src/stringutils.h
@@ -27,7 +27,7 @@
 #include <string>
 #include <vector>
 
-namespace Gdk { class Color; }
+namespace Gdk { class RGBA; }
 
 namespace Util
 {
@@ -47,7 +47,7 @@ Glib::ustring substitute_references(const Glib::ustring& substitution,
 Glib::ustring filename_short_display_name(const std::string& filename);
 
 Glib::ustring int_to_string(int number);
-Glib::ustring color_to_string(const Gdk::Color& color);
+Glib::ustring color_to_string(const Gdk::RGBA& color);
 
 int enum_from_nick_impl(GType type, const Glib::ustring& nick);
 Glib::ustring enum_to_nick_impl(GType type, int value);


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