#include "tooltips.h"
#include "ui_config.h"
-#include "i18n.h"
+#include "pbd/i18n.h"
using namespace std;
using namespace Gtk;
}
TimeAxisView::TimeAxisView (ARDOUR::Session* sess, PublicEditor& ed, TimeAxisView* rent, Canvas& /*canvas*/)
- : AxisView (sess)
- , controls_table (5, 4)
+ : controls_table (5, 4)
, controls_button_size_group (Gtk::SizeGroup::create (Gtk::SIZE_GROUP_BOTH))
, _name_editing (false)
, height (0)
_ghost_group->lower_to_bottom();
_ghost_group->show();
- name_label.set_name ("TrackLabel");
+ name_label.set_name (X_("TrackNameEditor"));
name_label.set_alignment (0.0, 0.5);
name_label.set_width_chars (12);
set_tooltip (name_label, _("Track/Bus name (double click to edit)"));
- Gtk::Entry* an_entry = new Gtkmm2ext::FocusEntry;
- an_entry->set_name ("EditorTrackNameDisplay");
- Gtk::Requisition req;
- an_entry->size_request (req);
- name_label.set_size_request (-1, req.height);
- name_label.set_ellipsize (Pango::ELLIPSIZE_MIDDLE);
- delete an_entry;
+ {
+ std::auto_ptr<Gtk::Entry> an_entry (new Gtkmm2ext::FocusEntry);
+ an_entry->set_name (X_("TrackNameEditor"));
+ Gtk::Requisition req;
+ an_entry->size_request (req);
- name_hbox.pack_end (name_label, true, true);
+ name_label.set_size_request (-1, req.height);
+ name_label.set_ellipsize (Pango::ELLIPSIZE_MIDDLE);
+ }
// set min. track-header width if fader is not visible
- name_hbox.set_size_request(name_width_px, -1);
+ name_label.set_size_request(name_width_px, -1);
- name_hbox.show ();
name_label.show ();
controls_table.set_row_spacings (2);
controls_table.set_border_width (2);
if (ARDOUR::Profile->get_mixbus() ) {
- controls_table.attach (name_hbox, 4, 5, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::SHRINK, 0, 0);
+ controls_table.attach (name_label, 4, 5, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::SHRINK, 0, 0);
} else {
- controls_table.attach (name_hbox, 1, 2, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::SHRINK, 0, 0);
+ controls_table.attach (name_label, 1, 2, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::SHRINK, 0, 0);
}
+
controls_table.show_all ();
controls_table.set_no_show_all ();
* @param y y position.
* @param nth index for this TimeAxisView, increased if this view has children.
* @param parent parent component.
+*
* @return height of this TimeAxisView.
*/
guint32
conditionally_add_to_selection ();
build_display_menu ();
- display_menu->popup (1, when);
+
+ if (!display_menu->items().empty()) {
+ display_menu->popup (1, when);
+ }
}
void
TimeAxisView::set_selected (bool yn)
{
-#if 0
- /* end any name edit in progress */
- if (can_edit_name()) {
- end_name_edit (string(), 0);
- }
-#endif
-
- if (yn == _selected) {
+ if (yn == selected()) {
return;
}
- Selectable::set_selected (yn);
+ AxisView::set_selected (yn);
if (_selected) {
time_axis_frame.set_shadow_type (Gtk::SHADOW_IN);
}
}
+// retuned rect is pushed back into the used_selection_rects list
+// in TimeAxisView::show_selection() which is the only caller.
SelectionRect *
TimeAxisView::get_selection_rect (uint32_t id)
{
for (list<SelectionRect*>::iterator i = used_selection_rects.begin(); i != used_selection_rects.end(); ++i) {
if ((*i)->id == id) {
- return (*i);
+ SelectionRect* ret = (*i);
+ used_selection_rects.erase (i);
+ return ret;
}
}