Remove "smaller" track height (basically just a broken version of small anyway).
authorDavid Robillard <d@drobilla.net>
Thu, 2 Jun 2011 00:06:35 +0000 (00:06 +0000)
committerDavid Robillard <d@drobilla.net>
Thu, 2 Jun 2011 00:06:35 +0000 (00:06 +0000)
Remove no-longer-necessary cruft related to non-editable track names (which do not exist).
Fix smallest height to be correctly padded (just large enough to hold the button row without ugly clipping).
Fix resizing of tracks when renaming (issue #4075).

git-svn-id: svn://localhost/ardour2/branches/3.0@9665 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/ardour-sae.menus
gtk2_ardour/ardour.menus.in
gtk2_ardour/editor_actions.cc
gtk2_ardour/enums.h
gtk2_ardour/route_time_axis.cc
gtk2_ardour/time_axis_view.cc
gtk2_ardour/time_axis_view.h

index 5bce7f1dc410413c67bc966add7881d7c56a37ae..16fcd8f5df8f43a9363b3c55116b486447046b95 100644 (file)
                     <menuitem action='track-height-large'/>
                     <menuitem action='track-height-larger'/>
                     <menuitem action='track-height-normal'/>
-                    <menuitem action='track-height-smaller'/>
                     <menuitem action='track-height-small'/>
                </menu>
                <menu action='WaveformMenu'>
index 8d21a4afa963be5e860b9e5041b811e7d45ca626..ddc3a50bf7734ef310239090ccec44e1bb0e1a28 100644 (file)
         <menuitem action='track-height-larger'/>
         <menuitem action='track-height-large'/>
         <menuitem action='track-height-normal'/>
-        <menuitem action='track-height-smaller'/>
         <menuitem action='track-height-small'/>
       </menu>
       <menuitem action='track-record-enable-toggle'/>
index f2709e38ec9066d17276b4aabb6851f0802011b2..cec7b03721c5b0f5c11d99a704f478da9be5bd81 100644 (file)
@@ -375,10 +375,6 @@ Editor::register_actions ()
        act = reg_sens (editor_actions, "track-height-small", _("Small"), sigc::bind (
                                sigc::mem_fun(*this, &Editor::set_track_height), HeightSmall));
        ActionManager::track_selection_sensitive_actions.push_back (act);
-       ActionManager::track_selection_sensitive_actions.push_back (act);
-       act = reg_sens (editor_actions, "track-height-smaller", _("Smaller"), sigc::bind (
-                               sigc::mem_fun(*this, &Editor::set_track_height), HeightSmaller));
-       ActionManager::track_selection_sensitive_actions.push_back (act);
 
        Glib::RefPtr<ActionGroup> zoom_actions = ActionGroup::create (X_("Zoom"));
        RadioAction::Group zoom_group;
index 0b0e95f82874979419fe1aaefbdf0b541ce2e7d0..92b2923894ef8c125eca45fd58aee97cbdb9841b 100644 (file)
@@ -50,8 +50,7 @@ enum Height {
        HeightLarger,
        HeightLarge,
        HeightNormal,
-       HeightSmall,
-       HeightSmaller
+       HeightSmall
 };
 
 extern void setup_gtk_ardour_enums ();
index e86074bac7f9a76bc2c482510bccedd43ec32d69..9e0d06dda67321cb803fc73f6865c6339b20e105 100644 (file)
@@ -867,8 +867,6 @@ RouteTimeAxisView::set_height (uint32_t h)
 
        if (height >= preset_height (HeightNormal)) {
 
-               _controls_padding_table.set_row_spacings (2);
-
                reset_meter();
 
                gm.get_gain_slider().show();
@@ -888,9 +886,7 @@ RouteTimeAxisView::set_height (uint32_t h)
                        playlist_button.show();
                }
 
-       } else if (height >= preset_height (HeightSmaller)) {
-
-               _controls_padding_table.set_row_spacings (2);
+       } else {
 
                reset_meter();
 
@@ -911,10 +907,6 @@ RouteTimeAxisView::set_height (uint32_t h)
                        playlist_button.hide ();
                }
 
-       } else {
-
-               _controls_padding_table.set_row_spacings (0);
-
        }
 
        if (height_changed && !no_redraw) {
index 0d51ec1d6b1111f6520197a14c89de99876c5e68..925107d9e833d15a230c5640948ead05b8a1fba2 100644 (file)
@@ -68,14 +68,13 @@ using Gtkmm2ext::Keyboard;
 
 const double trim_handle_size = 6.0; /* pixels */
 uint32_t TimeAxisView::extra_height;
-uint32_t TimeAxisView::smaller_height;
+uint32_t TimeAxisView::small_height;
 int const TimeAxisView::_max_order = 512;
 PBD::Signal1<void,TimeAxisView*> TimeAxisView::CatchDeletion;
 
 TimeAxisView::TimeAxisView (ARDOUR::Session* sess, PublicEditor& ed, TimeAxisView* rent, Canvas& /*canvas*/)
        : AxisView (sess)
        , controls_table (2, 8)
-       , _controls_padding_table (3, 3)
        , _size_menu (0)
        , _y_position (0)
        , _editor (ed)
@@ -161,16 +160,7 @@ TimeAxisView::TimeAxisView (ARDOUR::Session* sess, PublicEditor& ed, TimeAxisVie
 
        HSeparator* separator = manage (new HSeparator());
 
-       /* Use a rather hacky extra table so that we can control the space above/below and
-        * left/right of the controls_table separately.  This in turn is so that we can
-        * shrink the vertical space when the track is at its minimum height.
-        */
-       _controls_padding_table.set_row_spacings (2);
-       _controls_padding_table.set_col_spacings (0);
-       _controls_padding_table.attach (controls_table, 1, 2, 1, 2);
-       _controls_padding_table.show ();
-
-       controls_vbox.pack_start (_controls_padding_table, false, false);
+       controls_vbox.pack_start (controls_table, false, false);
        controls_vbox.pack_end (resizer_box, false, false);
        controls_vbox.show ();
 
@@ -401,23 +391,17 @@ TimeAxisView::step_height (bool coarser)
 
        if (coarser) {
 
-               if (height == preset_height (HeightSmall)) {
+               if (height <= preset_height (HeightSmall)) {
                        return;
-               }
-
-               if (height <= preset_height (HeightSmaller) && height > preset_height (HeightSmall)) {
+               } else if (height <= preset_height (HeightNormal) && height > preset_height (HeightSmall)) {
                        set_height_enum (HeightSmall);
-               } else if (height <= preset_height (HeightNormal) && height > preset_height (HeightSmaller)) {
-                       set_height_enum (HeightSmaller);
                } else {
                        set_height (height - step);
                }
 
        } else {
 
-               if (height == preset_height(HeightSmall)) {
-                       set_height_enum (HeightSmaller);
-               } else if (height == preset_height(HeightSmaller)) {
+               if (height <= preset_height(HeightSmall)) {
                        set_height_enum (HeightNormal);
                } else {
                        set_height (height + step);
@@ -507,13 +491,6 @@ TimeAxisView::name_entry_key_release (GdkEventKey* ev)
                        }
                }
 
-
-               /* resize to show editable name display */
-
-               if ((*i)->current_height() <= preset_height (HeightSmaller)) {
-                       (*i)->set_height_enum (HeightSmaller);
-               }
-
                (*i)->name_entry.grab_focus();
        }
        return true;
@@ -1039,9 +1016,7 @@ TimeAxisView::set_state (const XMLNode& node, int /*version*/)
                        set_height_enum (HeightLarger);
                } else if (prop->value() == "normal") {
                        set_height_enum (HeightNormal);
-               } else if (prop->value() == "smaller") {
-                       set_height_enum (HeightSmaller);
-               } else if (prop->value() == "small") {
+               } else if (prop->value() == "smaller" || prop->value() == "small") {
                        set_height_enum (HeightSmall);
                } else {
                        error << string_compose(_("unknown track height name \"%1\" in XML GUI information"), prop->value()) << endmsg;
@@ -1106,7 +1081,7 @@ TimeAxisView::compute_heights ()
 
        // height required to show 1 row of buttons
 
-       smaller_height = req.height + extra_height;
+       small_height = req.height + (2 * border_width);
 }
 
 void
@@ -1336,9 +1311,7 @@ TimeAxisView::preset_height (Height h)
        case HeightNormal:
                return extra_height + 48;
        case HeightSmall:
-               return 27;
-       case HeightSmaller:
-               return smaller_height;
+               return small_height;
        }
 
        /* NOTREACHED */
@@ -1379,6 +1352,5 @@ TimeAxisView::build_size_menu ()
        items.push_back (MenuElem (_("Larger"),  sigc::bind (sigc::mem_fun (*this, &TimeAxisView::set_height_enum), HeightLarger, true)));
        items.push_back (MenuElem (_("Large"),   sigc::bind (sigc::mem_fun (*this, &TimeAxisView::set_height_enum), HeightLarge, true)));
        items.push_back (MenuElem (_("Normal"),  sigc::bind (sigc::mem_fun (*this, &TimeAxisView::set_height_enum), HeightNormal, true)));
-       items.push_back (MenuElem (_("Smaller"), sigc::bind (sigc::mem_fun (*this, &TimeAxisView::set_height_enum), HeightSmaller, true)));
        items.push_back (MenuElem (_("Small"),   sigc::bind (sigc::mem_fun (*this, &TimeAxisView::set_height_enum), HeightSmall, true)));
 }
index f9745e84562b2a08ea85e65400763012caa168de..fde5bf0b3478c5b49f8ce4fde4a380288fcc5970 100644 (file)
@@ -217,16 +217,15 @@ class TimeAxisView : public virtual AxisView, public PBD::Stateful
 
   protected:
        /* The Standard LHS Controls */
-       Gtk::HBox     controls_hbox;
-       Gtk::Table    controls_table;
-       Gtk::Table   _controls_padding_table;
-       Gtk::EventBox controls_ebox;
-       Gtk::VBox     controls_vbox;
-       Gtk::VBox     time_axis_vbox;
-       Gtk::DrawingArea resizer;
-       Gtk::HBox     resizer_box;
-       Gtk::HBox     name_hbox;
-       Gtk::Frame    name_frame;
+       Gtk::HBox             controls_hbox;
+       Gtk::Table            controls_table;
+       Gtk::EventBox         controls_ebox;
+       Gtk::VBox             controls_vbox;
+       Gtk::VBox             time_axis_vbox;
+       Gtk::DrawingArea      resizer;
+       Gtk::HBox             resizer_box;
+       Gtk::HBox             name_hbox;
+       Gtk::Frame            name_frame;
        Gtkmm2ext::FocusEntry name_entry;
 
        uint32_t height;  /* in canvas units */
@@ -326,7 +325,7 @@ private:
 
        void compute_heights ();
        static uint32_t extra_height;
-       static uint32_t smaller_height;
+       static uint32_t small_height;
 
        static int const _max_order;