#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)
}
}
+ for (list<GhostRegion*>::iterator i = ghosts.begin(); i != ghosts.end(); ++i) {
+ (*i)->set_height ();
+ }
+
/* put separator at the bottom of this time axis view */
_canvas_separator->set (ArdourCanvas::Duple(0, height), ArdourCanvas::Duple(ArdourCanvas::COORD_MAX, height));
TOP_LEVEL_WIDGET.property_height_request () = h;
height = h;
- char buf[32];
- snprintf (buf, sizeof (buf), "%u", height);
- set_gui_property ("height", buf);
+ set_gui_property ("height", height);
for (list<GhostRegion*>::iterator i = ghosts.begin(); i != ghosts.end(); ++i) {
(*i)->set_height ();
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);
time_axis_vbox.set_name (controls_base_unselected_name);
hide_selection ();
-
- /* children will be set for the yn=true case. but when deselecting
- the editor only has a list of top-level trackviews, so we
- have to do this here.
- */
-
- for (Children::iterator i = children.begin(); i != children.end(); ++i) {
- (*i)->set_selected (false);
- }
}
time_axis_frame.show();
-
}
void
}
}
+// 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;
}
}
{
/* this method is not required to trigger a global redraw */
- string str = gui_property ("height");
-
- if (!str.empty()) {
- set_height (atoi (str));
+ uint32_t height;
+ if (get_gui_property ("height", height)) {
+ set_height (height);
} else {
set_height (preset_height (HeightNormal));
}