meterbridge - change label size with height

This commit is contained in:
Robin Gareus 2013-07-04 22:06:11 +02:00
parent 42ee64e950
commit 8574be424e
2 changed files with 11 additions and 2 deletions

View File

@ -65,7 +65,7 @@ MeterStrip::MeterStrip (int metricmode)
set_spacing(2);
peakbx.set_size_request(-1, 14);
btnbox.set_size_request(-1, 16);
namebx.set_size_request(14, 52);
namebx.set_size_request(18, 52);
_types.clear ();
switch(metricmode) {
@ -325,6 +325,15 @@ MeterStrip::on_size_allocate (Gtk::Allocation& a)
{
metric_patterns.clear();
ticks_patterns.clear();
const int wh = a.get_height();
int nh = ceilf(wh * .11f);
if (nh < 52) nh = 52;
if (nh > 148) nh = 148;
namebx.set_size_request(18, nh);
if (_route) {
name_label.set_size_request(18, nh-2);
name_label.layout()->set_width((nh-4) * PANGO_SCALE);
}
VBox::on_size_allocate(a);
}

View File

@ -127,7 +127,7 @@ Meterbridge::Meterbridge ()
Gdk::Geometry geom;
geom.max_width = 1<<16;
geom.max_height = 1024 + 52 + 16 + 12 ; // XXX see FastMeter::max_pattern_metric_size + meter-strip widgets
geom.max_height = 1024 + 148 + 16 + 12 ; // see FastMeter::max_pattern_metric_size + meter-strip widgets
set_geometry_hints(*((Gtk::Window*) this), geom, Gdk::HINT_MAX_SIZE);
set_keep_above (true);