diff options
author | Robin Gareus <robin@gareus.org> | 2014-09-02 19:23:18 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2014-09-02 19:23:18 +0200 |
commit | 29b7cb4a057af3adde8d4464fbd1e869c861b8ea (patch) | |
tree | f22afd4321f064f1439bbcc04f5f77b48e5bee07 /gtk2_ardour/ardour_button.h | |
parent | b184df3286599c3d31d97d264cae832550e55641 (diff) |
ArdourButton: prepare for [em] based padding
Diffstat (limited to 'gtk2_ardour/ardour_button.h')
-rw-r--r-- | gtk2_ardour/ardour_button.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gtk2_ardour/ardour_button.h b/gtk2_ardour/ardour_button.h index 75e3a9cd90..0c61a6f101 100644 --- a/gtk2_ardour/ardour_button.h +++ b/gtk2_ardour/ardour_button.h @@ -101,6 +101,9 @@ class ArdourButton : public CairoWidget , public Gtkmm2ext::Activatable void set_fallthrough_to_parent(bool fall) { _fallthrough_to_parent = fall; } + unsigned int char_pixel_width() { if (_char_pixel_width < 1) recalc_char_pixel_geometry() ; return _char_pixel_width; } + unsigned int char_pixel_height() { if (_char_pixel_height < 1) recalc_char_pixel_geometry() ; return _char_pixel_height; } + protected: void render (cairo_t *, cairo_rectangle_t *); void on_size_request (Gtk::Requisition* req); @@ -124,6 +127,10 @@ class ArdourButton : public CairoWidget , public Gtkmm2ext::Activatable Tweaks _tweaks; BindingProxy binding_proxy; + void recalc_char_pixel_geometry (); + unsigned int _char_pixel_width; + unsigned int _char_pixel_height; + int _text_width; int _text_height; float _diameter; |