[Xfce4-commits] [panel-plugins/xfce4-hardware-monitor-plugin] 12/13: Colors are based on unsigned ints, not ints
noreply at xfce.org
noreply at xfce.org
Wed Aug 12 18:39:16 CEST 2015
This is an automated email from the git hooks/post-receive script.
omegaphil pushed a commit to branch master
in repository panel-plugins/xfce4-hardware-monitor-plugin.
commit dd4319a6ecc7aaa7a4d04f4f9170825273fc9666
Author: OmegaPhil <OmegaPhil at startmail.com>
Date: Mon Aug 10 21:11:34 2015 +0100
Colors are based on unsigned ints, not ints
---
src/applet.cpp | 9 +++++----
src/applet.hpp | 11 ++++++-----
src/curve-view.cpp | 4 ++--
3 files changed, 13 insertions(+), 11 deletions(-)
diff --git a/src/applet.cpp b/src/applet.cpp
index 2e57584..d9a7b76 100644
--- a/src/applet.cpp
+++ b/src/applet.cpp
@@ -437,7 +437,8 @@ unsigned int Applet::get_fg_color()
0x83A67FB0, 0xC1665AB0, 0x7590AEB0, 0xE0C39ED0, 0x887FA3B0
};
- // Saving 'current' next color
+ /* Saving 'current' next color - note that this is an index into the colors,
+ * not a color itself */
int color = next_color;
// Updating next_color
@@ -496,7 +497,7 @@ const Glib::ustring Applet::get_viewer_type()
return viewer_type;
}
-int Applet::get_background_color() const
+unsigned int Applet::get_background_color() const
{
return background_color;
}
@@ -607,12 +608,12 @@ void Applet::set_viewer_text_overlay_font(const Glib::ustring font_details)
viewer_text_overlay_font = font_details;
}
-const int Applet::get_viewer_text_overlay_color() const
+const unsigned int Applet::get_viewer_text_overlay_color() const
{
return viewer_text_overlay_color;
}
-void Applet::set_viewer_text_overlay_color(const int color)
+void Applet::set_viewer_text_overlay_color(const unsigned int color)
{
viewer_text_overlay_color = color;
}
diff --git a/src/applet.hpp b/src/applet.hpp
index cf7607e..e179ec6 100644
--- a/src/applet.hpp
+++ b/src/applet.hpp
@@ -64,7 +64,7 @@ public:
* be publically available through GConf, but are private data in the
* object */
const Glib::ustring get_viewer_type();
- int get_background_color() const;
+ unsigned int get_background_color() const;
gboolean get_use_background_color() const;
int get_viewer_size() const;
void set_viewer_size(const int size);
@@ -80,8 +80,8 @@ public:
void set_viewer_text_overlay_use_font(bool enabled);
const Glib::ustring get_viewer_text_overlay_font();
void set_viewer_text_overlay_font(const Glib::ustring font_details);
- const int get_viewer_text_overlay_color() const;
- void set_viewer_text_overlay_color(const int color);
+ const unsigned int get_viewer_text_overlay_color() const;
+ void set_viewer_text_overlay_color(const unsigned int color);
const CurveView::TextOverlayPosition get_viewer_text_overlay_position();
void set_viewer_text_overlay_position(CurveView::TextOverlayPosition
position);
@@ -122,10 +122,11 @@ private:
bool viewer_text_overlay_enabled, viewer_text_overlay_use_font;
Glib::ustring viewer_text_overlay_format_string, viewer_text_overlay_separator,
viewer_text_overlay_font;
- int viewer_text_overlay_color;
+ unsigned int viewer_text_overlay_color;
CurveView::TextOverlayPosition viewer_text_overlay_position;
- int viewer_size, background_color, next_color;
+ unsigned int background_color;
+ int viewer_size, next_color;
gboolean use_background_color;
Glib::RefPtr<Gdk::Pixbuf> icon;
std::auto_ptr<Gtk::AboutDialog> about;
diff --git a/src/curve-view.cpp b/src/curve-view.cpp
index 78b8595..f23b674 100644
--- a/src/curve-view.cpp
+++ b/src/curve-view.cpp
@@ -223,7 +223,7 @@ void CurveView::do_attach(Monitor *monitor)
// Saving color
xfce_rc_set_group(settings_w, dir.c_str());
- xfce_rc_write_int_entry(settings_w, "color", int(color));
+ xfce_rc_write_int_entry(settings_w, "color", color);
// Close settings file
xfce_rc_close(settings_w);
@@ -376,7 +376,7 @@ void CurveView::do_draw_loop()
if (text_overlay->property_font() != font_details)
text_overlay->property_font() = font_details;
- int color = applet->get_viewer_text_overlay_color();
+ unsigned int color = applet->get_viewer_text_overlay_color();
if (text_overlay->property_fill_color_rgba() != color)
text_overlay->property_fill_color_rgba() = color;
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list