diff options
author | Ben Loftis <ben@harrisonconsoles.com> | 2014-08-28 14:55:39 -0500 |
---|---|---|
committer | Ben Loftis <ben@harrisonconsoles.com> | 2014-08-28 15:29:18 -0500 |
commit | b0477f7f1ecdfb2065a6e9e12097176540ef3a53 (patch) | |
tree | 41b03d0a6b3412dd3bd70cf6b3aa24ddebe1c164 /libs/gtkmm2ext | |
parent | e6ab754e4f39c675442c0e6d6e32c6b6fcdbd45e (diff) |
fix plugin bypass button action
Diffstat (limited to 'libs/gtkmm2ext')
-rw-r--r-- | libs/gtkmm2ext/barcontroller.cc | 28 |
1 files changed, 8 insertions, 20 deletions
diff --git a/libs/gtkmm2ext/barcontroller.cc b/libs/gtkmm2ext/barcontroller.cc index 7c420a680f..83a2901734 100644 --- a/libs/gtkmm2ext/barcontroller.cc +++ b/libs/gtkmm2ext/barcontroller.cc @@ -450,29 +450,17 @@ BarController::expose (GdkEventExpose* /*event*/) double xpos = -1; std::string const label = get_label (xpos); - -/* if (!label.empty()) { + if (!label.empty()) { + int twidth, theight; layout->set_text (label); - - int width, height, x; - layout->get_pixel_size (width, height); + layout->get_pixel_size (twidth, theight); - if (xpos == -1) { - x = max (3, 1 + (x2 - (width/2))); - x = min (darea.get_width() - width - 3, (int) lrint (xpos)); - } else { - x = lrint (darea.get_width() * xpos); - } - - c = get_style()->get_text (get_state()); - r = c.get_red_p (); - g = c.get_green_p (); - b = c.get_blue_p (); - context->set_source_rgb (r, g, b); - context->move_to (x, (darea.get_height()/2) - (height/2)); - layout->show_in_cairo_context (context); - }*/ + c = get_style()->get_text (get_state()); + CairoWidget::set_source_rgb_a (cr, c, 1.0); + context->move_to ( (fract > 0.5) ? w - twidth/0.7 : twidth/0.7, (darea.get_height()/2) - (theight/2)); + layout->show_in_cairo_context (context); + } return true; } |