diff options
Diffstat (limited to 'gtk2_ardour/cairo_widget.h')
-rw-r--r-- | gtk2_ardour/cairo_widget.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/gtk2_ardour/cairo_widget.h b/gtk2_ardour/cairo_widget.h index dc50762b16..b34b305157 100644 --- a/gtk2_ardour/cairo_widget.h +++ b/gtk2_ardour/cairo_widget.h @@ -53,8 +53,18 @@ public: void set_active (bool); bool get_active () { return active_state() != Gtkmm2ext::ActiveState (0); } + /* widgets can be told to only draw their "foreground, and thus leave + in place whatever background is drawn by their parent. the default + is that the widget will fill its event window with the background + color of the parent container. + */ + + void set_draw_background (bool yn); + sigc::signal<void> StateChanged; + static void provide_background_for_cairo_widget (Gtk::Widget& w, const Gdk::Color& bg); + protected: /** Render the widget to the given Cairo context */ virtual void render (cairo_t *) = 0; @@ -63,10 +73,9 @@ protected: void on_state_changed (Gtk::StateType); Gdk::Color get_parent_bg (); - int _width; ///< pixmap width - int _height; ///< pixmap height Gtkmm2ext::ActiveState _active_state; Gtkmm2ext::VisualState _visual_state; + bool _need_bg; private: GdkPixmap* _pixmap; ///< our pixmap |