13
0

use 2 digit width as minium for track number labels

This commit is contained in:
Robin Gareus 2014-08-28 22:36:53 +02:00
parent 99051c3af4
commit 392f4847b0
2 changed files with 7 additions and 3 deletions

View File

@ -532,7 +532,8 @@ MeterStrip::on_size_allocate (Gtk::Allocation& a)
} }
int tnh = 0; int tnh = 0;
if (_session && _session->config.get_track_name_number()) { if (_session && _session->config.get_track_name_number()) {
tnh = 4 + _session->track_number_decimals() * 8; // NB numbers are rotated 90deg. on the meterbridge
tnh = 4 + std::max(2u, _session->track_number_decimals()) * 8; // TODO 8 = max_with_of_digit_0_to_9()
} }
namebx.set_size_request(18, nh + tnh); namebx.set_size_request(18, nh + tnh);
namenumberbx.set_size_request(18, nh + tnh); namenumberbx.set_size_request(18, nh + tnh);
@ -768,7 +769,9 @@ MeterStrip::name_changed () {
number_label.set_text (PBD::to_string (abs(_route->track_number ()), std::dec)); number_label.set_text (PBD::to_string (abs(_route->track_number ()), std::dec));
number_label.show(); number_label.show();
} }
number_label.set_size_request(18, 4 + _session->track_number_decimals() * 8); const int tnh = 4 + std::max(2u, _session->track_number_decimals()) * 8; // TODO 8 = max_width_of_digit_0_to_9()
// NB numbers are rotated 90deg. on the meterbridge -> use height
number_label.set_size_request(18, tnh);
} else { } else {
number_label.hide(); number_label.hide();
} }

View File

@ -372,7 +372,8 @@ RouteTimeAxisView::update_track_number_visibility ()
// controls_table.resize ( 2, 4 ); // controls_table.resize ( 2, 4 );
name_hbox.pack_start(number_label, false, false, 2); name_hbox.pack_start(number_label, false, false, 2);
// controls_table.attach (number_label, 3, 4, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0); // controls_table.attach (number_label, 3, 4, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0);
number_label.set_size_request(3 + _session->track_number_decimals() * 8, -1); const int tnw = std::max(2u, _session->track_number_decimals()) * 8; // TODO 8 = max_width_of_digit_0_to_9()
number_label.set_size_request(3 + tnw, -1);
number_label.show (); number_label.show ();
} else { } else {
// controls_table.resize ( 2, 3 ); // controls_table.resize ( 2, 3 );