X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Ftime_axis_view.cc;h=c1ec7767e55c8cf4de6607f472666ced5f6a8015;hb=0310f8997147cc50600a98f05ef1a6c486e688c7;hp=540dddcb3df715b7d1bc9008b323bf08206d9dce;hpb=822810b88fd13d1764b5f686baa8edb3e27e95fc;p=ardour.git diff --git a/gtk2_ardour/time_axis_view.cc b/gtk2_ardour/time_axis_view.cc index 540dddcb3d..c1ec7767e5 100644 --- a/gtk2_ardour/time_axis_view.cc +++ b/gtk2_ardour/time_axis_view.cc @@ -332,6 +332,10 @@ TimeAxisView::show_at (double y, int& nth, VBox *parent) } } + for (list::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)); @@ -586,9 +590,7 @@ TimeAxisView::set_height (uint32_t h, TrackHeightMode m) 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::iterator i = ghosts.begin(); i != ghosts.end(); ++i) { (*i)->set_height (); @@ -627,12 +629,12 @@ TimeAxisView::begin_name_edit () */ int x, y; - int wx, wy; + int wx, wy; - name_label.translate_coordinates (*toplevel, 0, 0, x, y); - toplevel->get_window()->get_origin (wx, wy); + name_label.translate_coordinates (*toplevel, 0, 0, x, y); + toplevel->get_window()->get_origin (wx, wy); - fte->move (wx + x, wy + y); + fte->move (wx + x, wy + y); fte->present (); } @@ -738,7 +740,10 @@ TimeAxisView::popup_display_menu (guint32 when) conditionally_add_to_selection (); build_display_menu (); - display_menu->popup (1, when); + + if (!display_menu->items().empty()) { + display_menu->popup (1, when); + } } void @@ -748,7 +753,7 @@ TimeAxisView::set_selected (bool yn) return; } - Selectable::set_selected (yn); + AxisView::set_selected (yn); if (_selected) { time_axis_frame.set_shadow_type (Gtk::SHADOW_IN); @@ -764,19 +769,9 @@ TimeAxisView::set_selected (bool yn) 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 @@ -1300,10 +1295,9 @@ TimeAxisView::reset_visual_state () { /* 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)); }