diff options
author | Robin Gareus <robin@gareus.org> | 2014-09-05 02:24:19 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2014-09-05 02:24:19 +0200 |
commit | 48a851011b6134794ce0f64a4866c2e9fc97b058 (patch) | |
tree | c5486c4cdb064961a70220f47f98be267977fae6 /libs/gtkmm2ext/gtkmm2ext/pixfader.h | |
parent | 4c12a01b62d04084fcb50f72bd30f83daaf69461 (diff) |
add pixfader tweaks API:
* change API to hide unity/default value line
* allow to override vertical scroll [1]
* allow changing button event forwarding [2]
[1] override scrolling in track-headers
[2] dbl-click is needed for BarControllers -> switch to SpinBtn
but a plain Slider on a track-header should not forward
these events to the TAV (they may trigger name-edit)
Diffstat (limited to 'libs/gtkmm2ext/gtkmm2ext/pixfader.h')
-rw-r--r-- | libs/gtkmm2ext/gtkmm2ext/pixfader.h | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/libs/gtkmm2ext/gtkmm2ext/pixfader.h b/libs/gtkmm2ext/gtkmm2ext/pixfader.h index 0ec46a1c74..6cf966f1b3 100644 --- a/libs/gtkmm2ext/gtkmm2ext/pixfader.h +++ b/libs/gtkmm2ext/gtkmm2ext/pixfader.h @@ -43,16 +43,17 @@ class LIBGTKMM2EXT_API PixFader : public Gtk::DrawingArea void set_default_value (float); void set_text (const std::string&, bool centered = true, bool expose = true); - void show_unity_line (bool yn); - protected: - Glib::RefPtr<Pango::Layout> _layout; - std::string _text; - int _text_width; - int _text_height; + enum Tweaks { + NoShowUnityLine = 0x1, + NoButtonForward = 0x2, + NoVerticalScroll = 0x4, + }; - Gtk::Adjustment& adjustment; + Tweaks tweaks() const { return _tweaks; } + void set_tweaks (Tweaks); + protected: void on_size_request (GtkRequisition*); void on_size_allocate (Gtk::Allocation& alloc); @@ -73,6 +74,14 @@ class LIBGTKMM2EXT_API PixFader : public Gtk::DrawingArea }; private: + + Glib::RefPtr<Pango::Layout> _layout; + std::string _text; + Tweaks _tweaks; + Gtk::Adjustment& _adjustment; + int _text_width; + int _text_height; + int _span, _girth; int _min_span, _min_girth; int _orien; @@ -86,7 +95,6 @@ class LIBGTKMM2EXT_API PixFader : public Gtk::DrawingArea float _default_value; int _unity_loc; bool _centered_text; - bool _display_unity_line; sigc::connection _parent_style_change; Widget * _current_parent; |