Commit 7e77d56e authored by Murray Cumming's avatar Murray Cumming

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

parent 0984a7ed
......@@ -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;
......
......@@ -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_;
......
......@@ -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);
}
......
......@@ -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;
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment