[Summary] Removing indication of the pushed and hovered states for WavesButton and WavesIconButton

This commit is contained in:
VKamyshniy 2014-10-02 00:24:57 +03:00
parent deddd3ad0d
commit a59a9a58fb
2 changed files with 9 additions and 31 deletions

View file

@ -118,13 +118,7 @@ WavesButton::render (cairo_t* cr, cairo_rectangle_t*)
Glib::RefPtr<Gtk::Style> style = get_style();
Gdk::Color bgcolor = style->get_bg ((get_state() == Gtk::STATE_INSENSITIVE) ? Gtk::STATE_INSENSITIVE :
(_hovering ?
(_pushed ?
Gtk::STATE_ACTIVE :
Gtk::STATE_NORMAL ) : // or Gtk::STATE_PRELIGHT if you want hovering
(get_active() ?
Gtk::STATE_ACTIVE :
Gtk::STATE_NORMAL)));
(get_active() ? Gtk::STATE_ACTIVE : Gtk::STATE_NORMAL));
int width = get_width ();
int height = get_height();
@ -186,14 +180,12 @@ WavesButton::render_text (cairo_t* cr)
cairo_new_path (cr);
Gdk::Color fgcolor = style->get_fg ((get_state() == Gtk::STATE_INSENSITIVE) ? Gtk::STATE_INSENSITIVE :
(_hovering ?
(_pushed ?
Gtk::STATE_ACTIVE :
Gtk::STATE_PRELIGHT ) :
(get_active() ?
Gtk::STATE_ACTIVE :
Gtk::STATE_NORMAL)));
Gdk::Color fgcolor = style->get_fg ((get_state() == Gtk::STATE_INSENSITIVE) ?
Gtk::STATE_INSENSITIVE :
(get_active() ?
Gtk::STATE_ACTIVE :
Gtk::STATE_NORMAL));
cairo_set_source_rgba (cr, fgcolor.get_red_p(), fgcolor.get_green_p(), fgcolor.get_blue_p(), 1);
/* align text */

View file

@ -57,22 +57,8 @@ WavesIconButton::render (cairo_t* cr, cairo_rectangle_t*)
if (pixbuf == 0) {
pixbuf = (get_state() == Gtk::STATE_INSENSITIVE) ?
(_inactive_pixbuf ? _inactive_pixbuf : _normal_pixbuf) :
(_hovering ?
(_pushed ? (_active_pixbuf ?
_active_pixbuf :
_normal_pixbuf) :
(_prelight_pixbuf ?
_prelight_pixbuf :
(get_active() ?
(_active_pixbuf ?
_active_pixbuf :
_normal_pixbuf) :
_normal_pixbuf))) :
(get_active() ?
(_active_pixbuf ?
_active_pixbuf :
_normal_pixbuf) :
_normal_pixbuf));
(get_active() ? (_active_pixbuf ? _active_pixbuf : _normal_pixbuf) :
_normal_pixbuf);
}
// pixbuf, if any