diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2013-10-12 14:56:57 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2013-10-12 14:56:57 -0400 |
commit | 4091ff175c52049805862dc90e9d195c7ce81742 (patch) | |
tree | b4fc450b0d29239f126b2025664e74f5d7b4b16d /gtk2_ardour/ardour_button.cc | |
parent | be8d06f848914a6383e3c3053a2608dfe8aa7142 (diff) |
1 bug fix plus padding control for ArdourButton
Diffstat (limited to 'gtk2_ardour/ardour_button.cc')
-rw-r--r-- | gtk2_ardour/ardour_button.cc | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/gtk2_ardour/ardour_button.cc b/gtk2_ardour/ardour_button.cc index 89e6a20385..b9d523e325 100644 --- a/gtk2_ardour/ardour_button.cc +++ b/gtk2_ardour/ardour_button.cc @@ -78,6 +78,8 @@ ArdourButton::ArdourButton (Element e) , _fixed_diameter (true) , _distinct_led_click (false) , _hovering (false) + , _xpad_request (0) + , _ypad_request (0) { ColorsChanged.connect (sigc::mem_fun (*this, &ArdourButton::color_handler)); } @@ -162,7 +164,7 @@ ArdourButton::set_markup (const std::string& str) _layout = Pango::Layout::create (get_pango_context()); } - _layout->set_text (str); + _layout->set_markup (str); queue_resize (); } @@ -432,10 +434,19 @@ ArdourButton::set_corner_radius (float r) } void +ArdourButton::set_padding (int x, int y) +{ + _xpad_request = x; + _ypad_request = y; + + queue_resize (); +} + +void ArdourButton::on_size_request (Gtk::Requisition* req) { - int xpad = 0; - int ypad = 6; + int xpad = 0 + _xpad_request; + int ypad = 6 + _ypad_request; CairoWidget::on_size_request (req); |