X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fplugin_display.cc;h=e00e8e9559a0fde4806e7674027a389fd13aa1ca;hb=098b0f8a8b904313bc2e9e3147cc3c05fd83f3e6;hp=ed95e9aa5ae7b1f0dfdf738a75b3871aab237582;hpb=a61ae46c82616eff3ec1f8dd1e1385cad227d25e;p=ardour.git diff --git a/gtk2_ardour/plugin_display.cc b/gtk2_ardour/plugin_display.cc index ed95e9aa5a..e00e8e9559 100644 --- a/gtk2_ardour/plugin_display.cc +++ b/gtk2_ardour/plugin_display.cc @@ -75,17 +75,9 @@ PluginDisplay::update_height_alloc (uint32_t height) { uint32_t shm = std::min (_max_height, height); - Gtk::Container* pr = get_parent(); - for (uint32_t i = 0; i < 4 && pr; ++i) { - // VBox, EventBox, ViewPort, ScrolledWindow - pr = pr->get_parent(); - } - if (shm != _cur_height) { - if (_cur_height < shm) { - queue_resize (); - } _cur_height = shm; + queue_resize (); } } @@ -153,7 +145,7 @@ PluginDisplay::on_expose_event (GdkEventExpose* ev) cairo_save (cr); cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE); - Gtkmm2ext::rounded_rectangle (cr, .5, -1.5, width - 1, height + 1, 7); + display_sample(cr, width, height); cairo_clip (cr); cairo_set_operator (cr, CAIRO_OPERATOR_OVER); @@ -176,12 +168,22 @@ PluginDisplay::on_expose_event (GdkEventExpose* ev) std::string name = get_name(); Gtkmm2ext::Color fill_color = UIConfiguration::instance().color (string_compose ("%1: fill active", name), &failed); - Gtkmm2ext::rounded_rectangle (cr, .5, -1.5, width - 1, height + 1, 7); + display_sample(cr, width, height); cairo_set_operator (cr, CAIRO_OPERATOR_OVER); cairo_set_line_width(cr, 1.0); - Gtkmm2ext::set_source_rgb_a (cr, fill_color, 1.0); + if (failed) { + cairo_set_source_rgba (cr, .75, .75, .75, 1.0); + } else { + Gtkmm2ext::set_source_rgb_a (cr, fill_color, 1.0); + } cairo_stroke (cr); cairo_destroy(cr); return true; } + +void +PluginDisplay::display_sample (cairo_t* cr, double w, double h) +{ + cairo_rectangle (cr, 0.0, 0.0, w, h); +}