summaryrefslogtreecommitdiff
path: root/gtk2_ardour/port_matrix_column_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_column_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_column_labels.cc')
-rw-r--r--gtk2_ardour/port_matrix_column_labels.cc63
1 files changed, 28 insertions, 35 deletions
diff --git a/gtk2_ardour/port_matrix_column_labels.cc b/gtk2_ardour/port_matrix_column_labels.cc
index 3183d96a9d..1679b321df 100644
--- a/gtk2_ardour/port_matrix_column_labels.cc
+++ b/gtk2_ardour/port_matrix_column_labels.cc
@@ -49,26 +49,30 @@ PortMatrixColumnLabels::compute_dimensions ()
_highest_text = 0;
/* width of the whole thing */
_width = 0;
-
- PortGroup::BundleList const c = _matrix->columns()->bundles();
- for (PortGroup::BundleList::const_iterator i = c.begin (); i != c.end(); ++i) {
-
- 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 (ext.height > _highest_text) {
- _highest_text = ext.height;
- }
-
- for (uint32_t j = 0; j < i->bundle->nchannels (); ++j) {
+ _highest_group_name = 0;
+
+ for (PortGroupList::List::const_iterator i = _matrix->columns()->begin(); i != _matrix->columns()->end(); ++i) {
+ PortGroup::BundleList const c = _matrix->columns()->bundles();
+ for (PortGroup::BundleList::const_iterator j = c.begin (); j != c.end(); ++j) {
- cairo_text_extents (
- cr,
- i->bundle->channel_name (j).c_str(),
- &ext
- );
+ cairo_text_extents_t ext;
+ cairo_text_extents (cr, j->bundle->name().c_str(), &ext);
+ if (ext.width > _longest_bundle_name) {
+ _longest_bundle_name = ext.width;
+ }
+
+ if (ext.height > _highest_text) {
+ _highest_text = ext.height;
+ }
+
+ for (uint32_t k = 0; k < j->bundle->nchannels (); ++k) {
+
+ cairo_text_extents (
+ cr,
+ j->bundle->channel_name (k).c_str(),
+ &ext
+ );
+ }
if (ext.width > _longest_channel_name) {
_longest_channel_name = ext.width;
@@ -78,23 +82,12 @@ PortMatrixColumnLabels::compute_dimensions ()
}
}
- if (_matrix->show_only_bundles()) {
- _width += grid_spacing();
- } else {
- _width += i->bundle->nchannels() * grid_spacing();
- }
- }
+ _width += group_size (*i) * grid_spacing ();
- _highest_group_name = 0;
- for (PortGroupList::List::const_iterator i = _matrix->columns()->begin(); i != _matrix->columns()->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 {
- _width += grid_spacing ();
+ 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;
}
}