summaryrefslogtreecommitdiff
path: root/gtk2_ardour/ardour_button.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2014-09-06 12:49:57 +0200
committerRobin Gareus <robin@gareus.org>2014-09-06 12:49:57 +0200
commit4912409a8d2a587e267185952bb7a8582d142382 (patch)
treed5fe3224c4f8e2383186b259a3380a89d294d093 /gtk2_ardour/ardour_button.cc
parent089184c016cc7ff34a888b78f6af55765ef0b8b0 (diff)
gtk style related fixes:
* remove some old/unused styles * fix plugin-ui button (hover color when active) * consistent style for route buttons (and related ArdourButton updates)
Diffstat (limited to 'gtk2_ardour/ardour_button.cc')
-rw-r--r--gtk2_ardour/ardour_button.cc13
1 files changed, 7 insertions, 6 deletions
diff --git a/gtk2_ardour/ardour_button.cc b/gtk2_ardour/ardour_button.cc
index 4872102c9e..2f77b6c6db 100644
--- a/gtk2_ardour/ardour_button.cc
+++ b/gtk2_ardour/ardour_button.cc
@@ -362,7 +362,6 @@ ArdourButton::render (cairo_t* cr, cairo_rectangle_t *)
}
const int text_margin = char_pixel_width();
-
// Text, if any
if (!_pixbuf && ((_elements & Text)==Text) && !_text.empty()) {
assert(_layout);
@@ -377,7 +376,7 @@ ArdourButton::render (cairo_t* cr, cairo_rectangle_t *)
printf("%s: f:%dx%d bh:%.0f tw:%d (%dx%d) %s\"%s\"\n",
get_name().c_str(),
char_pixel_width(), char_pixel_height(),
- ceil(_text_height * BASELINESTRETCH),
+ ceil(char_pixel_height() * BASELINESTRETCH),
_text_width,
get_width(), get_height(),
layout_font ? "L:" : "W:",
@@ -577,7 +576,7 @@ ArdourButton::on_size_request (Gtk::Requisition* req)
_text_height = char_pixel_height ();
// if _layout does not exist, char_pixel_height() creates it,
_layout->get_pixel_size (_text_width, ignored);
- req->width += rint(1.6 * char_pixel_width()); // padding
+ req->width += rint(1.75 * char_pixel_width()); // padding
req->width += _text_width;
req->height = std::max(req->height, (int) ceil(_text_height * BASELINESTRETCH + 1.0));
} else {
@@ -601,9 +600,9 @@ ArdourButton::on_size_request (Gtk::Requisition* req)
if (_elements & (RecButton | CloseCross)) {
assert(!(_elements & Text));
- const int wh = std::max(char_pixel_width(), char_pixel_height()) * BASELINESTRETCH;
+ const int wh = std::max(3.5 * char_pixel_width(), ceil(char_pixel_height() * BASELINESTRETCH + 1));
req->width += wh;
- req->height = std::max(req->height, (int) wh);
+ req->height = std::max(req->height, wh);
}
if (_tweaks & Square) {
@@ -1016,7 +1015,9 @@ ArdourButton::set_tweaks (Tweaks t)
{
if (_tweaks != t) {
_tweaks = t;
- CairoWidget::set_dirty ();
+ if (is_realized()) {
+ queue_resize ();
+ }
}
}