Remove "smaller" track height (basically just a broken version of small anyway).

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
This commit is contained in:
David Robillard 2011-06-02 00:06:35 +00:00
parent ba5b31dfdf
commit b27a3d99ac
7 changed files with 20 additions and 64 deletions

View file

@ -191,7 +191,6 @@
<menuitem action='track-height-large'/> <menuitem action='track-height-large'/>
<menuitem action='track-height-larger'/> <menuitem action='track-height-larger'/>
<menuitem action='track-height-normal'/> <menuitem action='track-height-normal'/>
<menuitem action='track-height-smaller'/>
<menuitem action='track-height-small'/> <menuitem action='track-height-small'/>
</menu> </menu>
<menu action='WaveformMenu'> <menu action='WaveformMenu'>

View file

@ -313,7 +313,6 @@
<menuitem action='track-height-larger'/> <menuitem action='track-height-larger'/>
<menuitem action='track-height-large'/> <menuitem action='track-height-large'/>
<menuitem action='track-height-normal'/> <menuitem action='track-height-normal'/>
<menuitem action='track-height-smaller'/>
<menuitem action='track-height-small'/> <menuitem action='track-height-small'/>
</menu> </menu>
<menuitem action='track-record-enable-toggle'/> <menuitem action='track-record-enable-toggle'/>

View file

@ -375,10 +375,6 @@ Editor::register_actions ()
act = reg_sens (editor_actions, "track-height-small", _("Small"), sigc::bind ( act = reg_sens (editor_actions, "track-height-small", _("Small"), sigc::bind (
sigc::mem_fun(*this, &Editor::set_track_height), HeightSmall)); 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);
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")); Glib::RefPtr<ActionGroup> zoom_actions = ActionGroup::create (X_("Zoom"));
RadioAction::Group zoom_group; RadioAction::Group zoom_group;

View file

@ -50,8 +50,7 @@ enum Height {
HeightLarger, HeightLarger,
HeightLarge, HeightLarge,
HeightNormal, HeightNormal,
HeightSmall, HeightSmall
HeightSmaller
}; };
extern void setup_gtk_ardour_enums (); extern void setup_gtk_ardour_enums ();

View file

@ -867,8 +867,6 @@ RouteTimeAxisView::set_height (uint32_t h)
if (height >= preset_height (HeightNormal)) { if (height >= preset_height (HeightNormal)) {
_controls_padding_table.set_row_spacings (2);
reset_meter(); reset_meter();
gm.get_gain_slider().show(); gm.get_gain_slider().show();
@ -888,9 +886,7 @@ RouteTimeAxisView::set_height (uint32_t h)
playlist_button.show(); playlist_button.show();
} }
} else if (height >= preset_height (HeightSmaller)) { } else {
_controls_padding_table.set_row_spacings (2);
reset_meter(); reset_meter();
@ -911,10 +907,6 @@ RouteTimeAxisView::set_height (uint32_t h)
playlist_button.hide (); playlist_button.hide ();
} }
} else {
_controls_padding_table.set_row_spacings (0);
} }
if (height_changed && !no_redraw) { if (height_changed && !no_redraw) {

View file

@ -68,14 +68,13 @@ using Gtkmm2ext::Keyboard;
const double trim_handle_size = 6.0; /* pixels */ const double trim_handle_size = 6.0; /* pixels */
uint32_t TimeAxisView::extra_height; uint32_t TimeAxisView::extra_height;
uint32_t TimeAxisView::smaller_height; uint32_t TimeAxisView::small_height;
int const TimeAxisView::_max_order = 512; int const TimeAxisView::_max_order = 512;
PBD::Signal1<void,TimeAxisView*> TimeAxisView::CatchDeletion; PBD::Signal1<void,TimeAxisView*> TimeAxisView::CatchDeletion;
TimeAxisView::TimeAxisView (ARDOUR::Session* sess, PublicEditor& ed, TimeAxisView* rent, Canvas& /*canvas*/) TimeAxisView::TimeAxisView (ARDOUR::Session* sess, PublicEditor& ed, TimeAxisView* rent, Canvas& /*canvas*/)
: AxisView (sess) : AxisView (sess)
, controls_table (2, 8) , controls_table (2, 8)
, _controls_padding_table (3, 3)
, _size_menu (0) , _size_menu (0)
, _y_position (0) , _y_position (0)
, _editor (ed) , _editor (ed)
@ -161,16 +160,7 @@ TimeAxisView::TimeAxisView (ARDOUR::Session* sess, PublicEditor& ed, TimeAxisVie
HSeparator* separator = manage (new HSeparator()); HSeparator* separator = manage (new HSeparator());
/* Use a rather hacky extra table so that we can control the space above/below and controls_vbox.pack_start (controls_table, false, false);
* 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_end (resizer_box, false, false); controls_vbox.pack_end (resizer_box, false, false);
controls_vbox.show (); controls_vbox.show ();
@ -401,23 +391,17 @@ TimeAxisView::step_height (bool coarser)
if (coarser) { if (coarser) {
if (height == preset_height (HeightSmall)) { if (height <= preset_height (HeightSmall)) {
return; return;
} } else if (height <= preset_height (HeightNormal) && height > preset_height (HeightSmall)) {
if (height <= preset_height (HeightSmaller) && height > preset_height (HeightSmall)) {
set_height_enum (HeightSmall); set_height_enum (HeightSmall);
} else if (height <= preset_height (HeightNormal) && height > preset_height (HeightSmaller)) {
set_height_enum (HeightSmaller);
} else { } else {
set_height (height - step); set_height (height - step);
} }
} else { } else {
if (height == preset_height(HeightSmall)) { if (height <= preset_height(HeightSmall)) {
set_height_enum (HeightSmaller);
} else if (height == preset_height(HeightSmaller)) {
set_height_enum (HeightNormal); set_height_enum (HeightNormal);
} else { } else {
set_height (height + step); 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(); (*i)->name_entry.grab_focus();
} }
return true; return true;
@ -1039,9 +1016,7 @@ TimeAxisView::set_state (const XMLNode& node, int /*version*/)
set_height_enum (HeightLarger); set_height_enum (HeightLarger);
} else if (prop->value() == "normal") { } else if (prop->value() == "normal") {
set_height_enum (HeightNormal); set_height_enum (HeightNormal);
} else if (prop->value() == "smaller") { } else if (prop->value() == "smaller" || prop->value() == "small") {
set_height_enum (HeightSmaller);
} else if (prop->value() == "small") {
set_height_enum (HeightSmall); set_height_enum (HeightSmall);
} else { } else {
error << string_compose(_("unknown track height name \"%1\" in XML GUI information"), prop->value()) << endmsg; 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 // height required to show 1 row of buttons
smaller_height = req.height + extra_height; small_height = req.height + (2 * border_width);
} }
void void
@ -1336,9 +1311,7 @@ TimeAxisView::preset_height (Height h)
case HeightNormal: case HeightNormal:
return extra_height + 48; return extra_height + 48;
case HeightSmall: case HeightSmall:
return 27; return small_height;
case HeightSmaller:
return smaller_height;
} }
/* NOTREACHED */ /* 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 (_("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 (_("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 (_("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))); items.push_back (MenuElem (_("Small"), sigc::bind (sigc::mem_fun (*this, &TimeAxisView::set_height_enum), HeightSmall, true)));
} }

View file

@ -219,7 +219,6 @@ class TimeAxisView : public virtual AxisView, public PBD::Stateful
/* The Standard LHS Controls */ /* The Standard LHS Controls */
Gtk::HBox controls_hbox; Gtk::HBox controls_hbox;
Gtk::Table controls_table; Gtk::Table controls_table;
Gtk::Table _controls_padding_table;
Gtk::EventBox controls_ebox; Gtk::EventBox controls_ebox;
Gtk::VBox controls_vbox; Gtk::VBox controls_vbox;
Gtk::VBox time_axis_vbox; Gtk::VBox time_axis_vbox;
@ -326,7 +325,7 @@ private:
void compute_heights (); void compute_heights ();
static uint32_t extra_height; static uint32_t extra_height;
static uint32_t smaller_height; static uint32_t small_height;
static int const _max_order; static int const _max_order;