@@ -105,23 +105,23 @@ sigc::signal<void, bool> RouteTimeAxisView::signal_ctrl_touched;
105
105
RouteTimeAxisView::RouteTimeAxisView (PublicEditor& ed, Session* sess, ArdourCanvas::Canvas& canvas)
106
106
: RouteUI(sess)
107
107
, StripableTimeAxisView(ed, sess, canvas)
108
- , _view (0 )
108
+ , _view (nullptr )
109
109
, button_table (3 , 3 )
110
110
, route_group_button (S_(" RTAV|G" ))
111
111
, playlist_button (S_(" RTAV|P" ))
112
112
, automation_button (S_(" RTAV|A" ))
113
- , automation_action_menu (0 )
114
- , plugins_submenu_item (0 )
115
- , route_group_menu (0 )
116
- , overlaid_menu_item (0 )
117
- , stacked_menu_item (0 )
113
+ , automation_action_menu (nullptr )
114
+ , route_group_menu (nullptr )
115
+ , overlaid_menu_item (nullptr )
116
+ , stacked_menu_item (nullptr )
118
117
, gm (sess, true , 75 , 14 )
119
118
, _ignore_set_layer_display (false )
120
- , pan_automation_item(NULL )
119
+ , pan_automation_item(nullptr )
121
120
{
122
121
subplugin_menu.set_name (" ArdourContextMenu" );
123
122
number_label.set_name (" tracknumber label" );
124
- number_label.set_elements ((ArdourButton::Element)(ArdourButton::Edge|ArdourButton::Body|ArdourButton::Text|ArdourButton::Inactive));
123
+ number_label.set_elements ((ArdourButton::Element)(ArdourButton::Body|ArdourButton::Text|ArdourButton::Inactive));
124
+ number_label.set_angle (-90 .);
125
125
number_label.set_alignment (.5 , .5 );
126
126
number_label.set_fallthrough_to_parent (true );
127
127
@@ -258,7 +258,7 @@ RouteTimeAxisView::set_route (boost::shared_ptr<Route> rt)
258
258
controls_table.attach (gm.get_gain_slider (), 3 , 5 , 2 , 3 , Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 1 , 0 );
259
259
} else {
260
260
controls_table.attach (route_group_button, 4 , 5 , 2 , 3 , Gtk::SHRINK, Gtk::SHRINK, 0 , 0 );
261
- controls_table.attach (gm.get_gain_slider (), 0 , 2 , 2 , 3 , Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 1 , 0 );
261
+ controls_table.attach (gm.get_gain_slider (), 2 , 2 , 2 , 3 , Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 1 , 0 );
262
262
}
263
263
264
264
set_tooltip (*solo_button,_ (" Solo" ));
@@ -434,7 +434,8 @@ RouteTimeAxisView::label_view ()
434
434
inactive_label.show ();
435
435
436
436
const int64_t track_number = _route->track_number ();
437
- if (track_number == 0 ) {
437
+ bool show_label = _session->config .get_track_name_number ();
438
+ if (track_number == 0 || !show_label) {
438
439
number_label.set_text (" " );
439
440
} else {
440
441
number_label.set_text (PBD::to_string (abs (_route->track_number ())));
@@ -444,34 +445,30 @@ RouteTimeAxisView::label_view ()
444
445
void
445
446
RouteTimeAxisView::update_track_number_visibility ()
446
447
{
447
- DisplaySuspender ds;
448
- bool show_label = _session->config .get_track_name_number ();
449
-
450
- if (_route && _route->is_master ()) {
451
- show_label = false ;
452
- }
453
-
454
448
if (number_label.get_parent ()) {
455
449
number_label.get_parent ()->remove (number_label);
456
450
}
451
+
452
+ if (!_route->active ()) {
453
+ inactive_table.attach (number_label, 0 , 1 , 0 , 3 , Gtk::SHRINK, Gtk::EXPAND | Gtk::FILL, 1 , 0 );
454
+ } else if (ARDOUR::Profile->get_mixbus ()) {
455
+ controls_table.attach (number_label, 3 , 4 , 0 , 1 , Gtk::SHRINK, Gtk::EXPAND | Gtk::FILL, 1 , 0 );
456
+ } else {
457
+ controls_table.attach (number_label, 0 , 1 , 0 , 3 , Gtk::SHRINK, Gtk::FILL, 1 , 0 );
458
+ }
459
+
460
+ // see ArdourButton::on_size_request(), we should probably use a global size-group here instead.
461
+ // except the width of the number label is subtracted from the name-hbox, so we
462
+ // need to explicitly calculate it anyway until the name-label & entry become ArdourWidgets.
463
+ bool show_label = _session->config .get_track_name_number ();
457
464
if (show_label) {
458
- if (!_route->active ()) {
459
- inactive_table.attach (number_label, 0 , 1 , 0 , 1 , Gtk::SHRINK, Gtk::EXPAND|Gtk::FILL, 1 , 0 );
460
- } else if (ARDOUR::Profile->get_mixbus ()) {
461
- controls_table.attach (number_label, 3 , 4 , 0 , 1 , Gtk::SHRINK, Gtk::EXPAND|Gtk::FILL, 1 , 0 );
462
- } else {
463
- controls_table.attach (number_label, 0 , 1 , 0 , 1 , Gtk::SHRINK, Gtk::EXPAND|Gtk::FILL, 1 , 0 );
464
- }
465
- // see ArdourButton::on_size_request(), we should probably use a global size-group here instead.
466
- // except the width of the number label is subtracted from the name-hbox, so we
467
- // need to explicitly calculate it anyway until the name-label & entry become ArdourWidgets.
468
- int tnw = (2 + std::max (2u , _session->track_number_decimals ())) * number_label.char_pixel_width ();
469
- if (tnw & 1 ) --tnw;
470
- number_label.set_size_request (tnw, -1 );
471
- number_label.show ();
465
+ number_label.set_size_request (static_cast <int >(15 * UIConfiguration::instance ().get_ui_scale ()), -1 );
472
466
} else {
473
- number_label.hide ( );
467
+ number_label.set_size_request ( static_cast < int >( 3 * UIConfiguration::instance (). get_ui_scale ()), - 1 );
474
468
}
469
+ number_label.show ();
470
+
471
+ label_view ();
475
472
}
476
473
477
474
void
0 commit comments