make CairoWidget respond to gtk_widget_set_state (INSENSITIVE)
git-svn-id: svn://localhost/ardour2/branches/3.0@10413 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
@@ -105,3 +105,19 @@ CairoWidget::set_visual_state (Gtkmm2ext::VisualState s)
|
||||
StateChanged ();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
CairoWidget::on_state_changed (Gtk::StateType)
|
||||
{
|
||||
/* this will catch GTK-level state changes from calls like
|
||||
::set_sensitive()
|
||||
*/
|
||||
|
||||
if (get_state() == Gtk::STATE_INSENSITIVE) {
|
||||
set_visual_state (Gtkmm2ext::VisualState (visual_state() | Gtkmm2ext::Insensitive));
|
||||
} else {
|
||||
set_visual_state (Gtkmm2ext::VisualState (visual_state() & ~Gtkmm2ext::Insensitive));
|
||||
}
|
||||
|
||||
queue_draw ();
|
||||
}
|
||||
|
||||
@@ -48,6 +48,7 @@ protected:
|
||||
virtual void render (cairo_t *) = 0;
|
||||
virtual bool on_expose_event (GdkEventExpose *);
|
||||
void on_size_allocate (Gtk::Allocation &);
|
||||
void on_state_changed (Gtk::StateType);
|
||||
Gdk::Color get_parent_bg ();
|
||||
|
||||
int _width; ///< pixmap width
|
||||
|
||||
Reference in New Issue
Block a user