13
0

limit width and resize meterbride window

This commit is contained in:
Robin Gareus 2013-07-24 01:39:16 +02:00
parent 6706f45b95
commit 8deccea615
3 changed files with 7 additions and 2 deletions

View File

@ -56,6 +56,7 @@ using namespace ArdourMeter;
PBD::Signal1<void,MeterStrip*> MeterStrip::CatchDeletion; PBD::Signal1<void,MeterStrip*> MeterStrip::CatchDeletion;
PBD::Signal0<void> MeterStrip::MetricChanged; PBD::Signal0<void> MeterStrip::MetricChanged;
PBD::Signal0<void> MeterStrip::ConfigurationChanged;
MeterStrip::MeterStrip (int metricmode, MeterType mt) MeterStrip::MeterStrip (int metricmode, MeterType mt)
: AxisView(0) : AxisView(0)
@ -366,8 +367,9 @@ MeterStrip::meter_configuration_changed (ChanCount c)
_has_midi = true; _has_midi = true;
} }
if (old_has_midi != _has_midi) MetricChanged();
on_theme_changed(); on_theme_changed();
if (old_has_midi != _has_midi) MetricChanged();
else ConfigurationChanged();
} }
void void

View File

@ -56,6 +56,7 @@ class MeterStrip : public Gtk::VBox, public RouteUI
static PBD::Signal1<void,MeterStrip*> CatchDeletion; static PBD::Signal1<void,MeterStrip*> CatchDeletion;
static PBD::Signal0<void> MetricChanged; static PBD::Signal0<void> MetricChanged;
static PBD::Signal0<void> ConfigurationChanged;
void reset_peak_display (); void reset_peak_display ();
void reset_route_peak_display (ARDOUR::Route*); void reset_route_peak_display (ARDOUR::Route*);

View File

@ -141,6 +141,7 @@ Meterbridge::Meterbridge ()
Route::SyncOrderKeys.connect (*this, invalidator (*this), boost::bind (&Meterbridge::sync_order_keys, this, _1), gui_context()); Route::SyncOrderKeys.connect (*this, invalidator (*this), boost::bind (&Meterbridge::sync_order_keys, this, _1), gui_context());
MeterStrip::CatchDeletion.connect (*this, invalidator (*this), boost::bind (&Meterbridge::remove_strip, this, _1), gui_context()); MeterStrip::CatchDeletion.connect (*this, invalidator (*this), boost::bind (&Meterbridge::remove_strip, this, _1), gui_context());
MeterStrip::MetricChanged.connect (*this, invalidator (*this), boost::bind(&Meterbridge::resync_order, this), gui_context()); MeterStrip::MetricChanged.connect (*this, invalidator (*this), boost::bind(&Meterbridge::resync_order, this), gui_context());
MeterStrip::ConfigurationChanged.connect (*this, invalidator (*this), boost::bind(&Meterbridge::queue_resize, this), gui_context());
/* work around ScrolledWindowViewport alignment mess Part one */ /* work around ScrolledWindowViewport alignment mess Part one */
Gtk::HBox * yspc = manage (new Gtk::HBox()); Gtk::HBox * yspc = manage (new Gtk::HBox());
@ -336,7 +337,8 @@ Meterbridge::on_size_request (Gtk::Requisition* r)
Gtk::Window::on_size_request(r); Gtk::Window::on_size_request(r);
Gdk::Geometry geom; Gdk::Geometry geom;
geom.max_width = meterarea.get_width() + metrics_left.get_width() + metrics_right.get_width(); Gtk::Requisition mr = meterarea.size_request();
geom.max_width = mr.width + metrics_left.get_width() + metrics_right.get_width();
geom.max_height = max_height; geom.max_height = max_height;
if (cur_max_width != geom.max_width) { if (cur_max_width != geom.max_width) {