From 15631e381fcac440a2fb17ec82ad49f329b27781 Mon Sep 17 00:00:00 2001 From: nick_m Date: Mon, 6 Jun 2016 05:46:29 +1000 Subject: Use non-magic widths for the now fixed-width mode region list. --- gtk2_ardour/editor_regions.cc | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) (limited to 'gtk2_ardour/editor_regions.cc') diff --git a/gtk2_ardour/editor_regions.cc b/gtk2_ardour/editor_regions.cc index 8321931871..fc946abe5d 100644 --- a/gtk2_ardour/editor_regions.cc +++ b/gtk2_ardour/editor_regions.cc @@ -95,38 +95,49 @@ EditorRegions::EditorRegions (Editor* e) _model->set_sort_func (0, sigc::mem_fun (*this, &EditorRegions::sorter)); _model->set_sort_column (0, SORT_ASCENDING); + /* column widths */ + int bbt_width, sync_width, check_width, height; + + Glib::RefPtr layout = _display.create_pango_layout (X_("000|000|000")); + Gtkmm2ext::get_pixel_size (layout, bbt_width, height); + + layout = _display.create_pango_layout (X_("Start ")); + Gtkmm2ext::get_pixel_size (layout, sync_width, height); + + check_width = 20; + TreeViewColumn* col_name = manage (new TreeViewColumn ("", _columns.name)); col_name->set_fixed_width (120); col_name->set_sizing (TREE_VIEW_COLUMN_FIXED); TreeViewColumn* col_position = manage (new TreeViewColumn ("", _columns.position)); - col_position->set_fixed_width (68); + col_position->set_fixed_width (bbt_width); col_position->set_sizing (TREE_VIEW_COLUMN_FIXED); TreeViewColumn* col_end = manage (new TreeViewColumn ("", _columns.end)); - col_end->set_fixed_width (68); + col_end->set_fixed_width (bbt_width); col_end->set_sizing (TREE_VIEW_COLUMN_FIXED); TreeViewColumn* col_length = manage (new TreeViewColumn ("", _columns.length)); - col_length->set_fixed_width (68); + col_length->set_fixed_width (bbt_width); col_length->set_sizing (TREE_VIEW_COLUMN_FIXED); TreeViewColumn* col_sync = manage (new TreeViewColumn ("", _columns.sync)); - col_sync->set_fixed_width (38); + col_sync->set_fixed_width (sync_width); col_sync->set_sizing (TREE_VIEW_COLUMN_FIXED); TreeViewColumn* col_fadein = manage (new TreeViewColumn ("", _columns.fadein)); - col_fadein->set_fixed_width (68); + col_fadein->set_fixed_width (bbt_width); col_fadein->set_sizing (TREE_VIEW_COLUMN_FIXED); TreeViewColumn* col_fadeout = manage (new TreeViewColumn ("", _columns.fadeout)); - col_fadeout->set_fixed_width (68); + col_fadeout->set_fixed_width (bbt_width); col_fadeout->set_sizing (TREE_VIEW_COLUMN_FIXED); TreeViewColumn* col_locked = manage (new TreeViewColumn ("", _columns.locked)); - col_locked->set_fixed_width (20); + col_locked->set_fixed_width (check_width); col_locked->set_sizing (TREE_VIEW_COLUMN_FIXED); TreeViewColumn* col_glued = manage (new TreeViewColumn ("", _columns.glued)); - col_glued->set_fixed_width (20); + col_glued->set_fixed_width (check_width); col_glued->set_sizing (TREE_VIEW_COLUMN_FIXED); TreeViewColumn* col_muted = manage (new TreeViewColumn ("", _columns.muted)); - col_muted->set_fixed_width (20); + col_muted->set_fixed_width (check_width); col_muted->set_sizing (TREE_VIEW_COLUMN_FIXED); TreeViewColumn* col_opaque = manage (new TreeViewColumn ("", _columns.opaque)); - col_opaque->set_fixed_width (20); + col_opaque->set_fixed_width (check_width); col_opaque->set_sizing (TREE_VIEW_COLUMN_FIXED); _display.append_column (*col_name); -- cgit v1.2.3