diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2014-04-16 06:35:24 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2014-04-16 06:35:24 -0400 |
commit | 981754781a55b154bb8e4022c9029504e430a44a (patch) | |
tree | 50c2328be89c802cac2da625f8d9ec219d75407f | |
parent | cd8aa4e3044bfa2f6956e02ccc5458b3c9fbadc4 (diff) |
use new config option to control name highlight and name placement
-rw-r--r-- | gtk2_ardour/time_axis_view_item.cc | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/gtk2_ardour/time_axis_view_item.cc b/gtk2_ardour/time_axis_view_item.cc index a02b45dcb6..da097d1b44 100644 --- a/gtk2_ardour/time_axis_view_item.cc +++ b/gtk2_ardour/time_axis_view_item.cc @@ -35,6 +35,8 @@ #include "canvas/text.h" #include "canvas/utils.h" +#include "ardour/profile.h" + #include "ardour_ui.h" /* * ardour_ui.h was moved up in the include list @@ -87,8 +89,16 @@ TimeAxisViewItem::set_constant_heights () layout = foo.create_pango_layout (X_("H")); /* just the ascender */ NAME_HEIGHT = height; - NAME_Y_OFFSET = height + 1; - NAME_HIGHLIGHT_SIZE = height + 2; + /* Ardour: Y_OFFSET is measured from bottom of the time axis view item. + TRX: Y_OFFSET is measured from the top of the time axis view item. + */ + if (Config->get_show_name_highlight()) { + NAME_Y_OFFSET = 3; + NAME_HIGHLIGHT_SIZE = 0; + } else { + NAME_Y_OFFSET = height + 1; + NAME_HIGHLIGHT_SIZE = height + 2; + } NAME_HIGHLIGHT_THRESH = NAME_HIGHLIGHT_SIZE * 3; } @@ -210,7 +220,7 @@ TimeAxisViewItem::init (ArdourCanvas::Group* parent, double fpp, Gdk::Color cons frame = 0; } - if (visibility & ShowNameHighlight) { + if (Config->get_show_name_highlight() && (visibility & ShowNameHighlight)) { double width; double start; @@ -240,7 +250,11 @@ TimeAxisViewItem::init (ArdourCanvas::Group* parent, double fpp, Gdk::Color cons if (visibility & ShowNameText) { name_text = new ArdourCanvas::Text (group); CANVAS_DEBUG_NAME (name_text, string_compose ("name text for %1", get_item_name())); - name_text->set_position (ArdourCanvas::Duple (NAME_X_OFFSET, trackview.current_height() - NAME_Y_OFFSET)); + if (Config->get_show_name_highlight()) { + name_text->set_position (ArdourCanvas::Duple (NAME_X_OFFSET, NAME_Y_OFFSET)); + } else { + name_text->set_position (ArdourCanvas::Duple (NAME_X_OFFSET, trackview.current_height() - NAME_Y_OFFSET)); + } name_text->set_font_description (NAME_FONT); } else { name_text = 0; @@ -570,7 +584,11 @@ TimeAxisViewItem::set_height (double height) manage_name_highlight (); if (visibility & ShowNameText) { - name_text->set_y_position (height - NAME_Y_OFFSET); + if (Config->get_show_name_highlight()) { + name_text->set_y_position (NAME_Y_OFFSET); + } else { + name_text->set_y_position (height - NAME_Y_OFFSET); + } } if (frame) { |