summaryrefslogtreecommitdiff
path: root/gtk2_ardour/port_matrix_row_labels.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2009-07-19 19:07:31 +0000
committerCarl Hetherington <carl@carlh.net>2009-07-19 19:07:31 +0000
commit6da5dd6d41df9e3d05b9b8cceaf1b671b4e21141 (patch)
tree299692da802c9bd7a23c63cb801e69f44733eea1 /gtk2_ardour/port_matrix_row_labels.cc
parentaf5b9f92a52f08d154ad84c60c61823cb45b62db (diff)
Port matrix tweaks: scroll wheel support; use the correct verb for disassociation in the menu; fixes for gaps appearing when groups are hidden.
git-svn-id: svn://localhost/ardour2/branches/3.0@5382 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/port_matrix_row_labels.cc')
-rw-r--r--gtk2_ardour/port_matrix_row_labels.cc51
1 files changed, 22 insertions, 29 deletions
diff --git a/gtk2_ardour/port_matrix_row_labels.cc b/gtk2_ardour/port_matrix_row_labels.cc
index 00806b36a5..7b4383155d 100644
--- a/gtk2_ardour/port_matrix_row_labels.cc
+++ b/gtk2_ardour/port_matrix_row_labels.cc
@@ -45,44 +45,37 @@ PortMatrixRowLabels::compute_dimensions ()
_longest_port_name = 0;
_longest_bundle_name = 0;
_height = 0;
+ _highest_group_name = 0;
+
+ for (PortGroupList::List::const_iterator i = _matrix->rows()->begin(); i != _matrix->rows()->end(); ++i) {
+
+ PortGroup::BundleList const r = (*i)->bundles ();
+ for (PortGroup::BundleList::const_iterator j = r.begin(); j != r.end(); ++j) {
+
+ for (uint32_t k = 0; k < j->bundle->nchannels(); ++k) {
+ cairo_text_extents_t ext;
+ cairo_text_extents (cr, j->bundle->channel_name(k).c_str(), &ext);
+ if (ext.width > _longest_port_name) {
+ _longest_port_name = ext.width;
+ }
+ }
- PortGroup::BundleList const r = _matrix->rows()->bundles();
- for (PortGroup::BundleList::const_iterator i = r.begin(); i != r.end(); ++i) {
- for (uint32_t j = 0; j < i->bundle->nchannels(); ++j) {
cairo_text_extents_t ext;
- cairo_text_extents (cr, i->bundle->channel_name(j).c_str(), &ext);
- if (ext.width > _longest_port_name) {
- _longest_port_name = ext.width;
+ cairo_text_extents (cr, j->bundle->name().c_str(), &ext);
+ if (ext.width > _longest_bundle_name) {
+ _longest_bundle_name = ext.width;
}
}
+ _height += group_size (*i) * grid_spacing ();
+
cairo_text_extents_t ext;
- cairo_text_extents (cr, i->bundle->name().c_str(), &ext);
- if (ext.width > _longest_bundle_name) {
- _longest_bundle_name = ext.width;
- }
-
- if (_matrix->show_only_bundles()) {
- _height += grid_spacing ();
- } else {
- _height += i->bundle->nchannels() * grid_spacing();
+ cairo_text_extents (cr, (*i)->name.c_str(), &ext);
+ if (ext.height > _highest_group_name) {
+ _highest_group_name = ext.height;
}
}
- _highest_group_name = 0;
- for (PortGroupList::List::const_iterator i = _matrix->rows()->begin(); i != _matrix->rows()->end(); ++i) {
- if ((*i)->visible()) {
- cairo_text_extents_t ext;
- cairo_text_extents (cr, (*i)->name.c_str(), &ext);
- if (ext.height > _highest_group_name) {
- _highest_group_name = ext.height;
- }
- } else {
- /* add another grid_spacing for a tab for this hidden group */
- _height += grid_spacing ();
- }
- }
-
cairo_destroy (cr);
gdk_pixmap_unref (pm);