Make sense of parameter to tav_zoom_step match up with coarser as used for temporal zoom.

git-svn-id: svn://localhost/ardour2/branches/3.0@8896 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2011-02-17 22:35:42 +00:00
parent 2ffc0cbe25
commit 6117b74bb9
4 changed files with 25 additions and 25 deletions

View File

@ -2795,12 +2795,12 @@ Editor::setup_toolbar ()
tav_expand_button.set_name ("TrackHeightButton");
tav_expand_button.set_size_request(-1,20);
tav_expand_button.add (*(manage (new Image (::get_icon("tav_exp")))));
tav_expand_button.signal_clicked().connect (sigc::bind (sigc::mem_fun(*this, &Editor::tav_zoom_step), true));
tav_expand_button.signal_clicked().connect (sigc::bind (sigc::mem_fun(*this, &Editor::tav_zoom_step), false));
tav_shrink_button.set_name ("TrackHeightButton");
tav_shrink_button.set_size_request(-1,20);
tav_shrink_button.add (*(manage (new Image (::get_icon("tav_shrink")))));
tav_shrink_button.signal_clicked().connect (sigc::bind (sigc::mem_fun(*this, &Editor::tav_zoom_step), false));
tav_shrink_button.signal_clicked().connect (sigc::bind (sigc::mem_fun(*this, &Editor::tav_zoom_step), true));
_zoom_box.pack_start (tav_shrink_button);
_zoom_box.pack_start (tav_expand_button);

View File

@ -83,7 +83,7 @@ Editor::track_canvas_scroll (GdkEventScroll* ev)
}
}
last_track_height_step_timestamp = get_microseconds();
current_stepping_trackview->step_height (true);
current_stepping_trackview->step_height (false);
return true;
} else {
scroll_tracks_up_line ();
@ -108,7 +108,7 @@ Editor::track_canvas_scroll (GdkEventScroll* ev)
}
}
last_track_height_step_timestamp = get_microseconds();
current_stepping_trackview->step_height (false);
current_stepping_trackview->step_height (true);
return true;
} else {
scroll_tracks_down_line ();

View File

@ -301,7 +301,7 @@ TimeAxisView::controls_ebox_scroll (GdkEventScroll* ev)
switch (ev->direction) {
case GDK_SCROLL_UP:
if (Keyboard::modifier_state_equals (ev->state, Keyboard::TertiaryModifier)) {
step_height (true);
step_height (false);
return true;
} else if (Keyboard::no_modifiers_active (ev->state)) {
_editor.scroll_tracks_up_line();
@ -311,7 +311,7 @@ TimeAxisView::controls_ebox_scroll (GdkEventScroll* ev)
case GDK_SCROLL_DOWN:
if (Keyboard::modifier_state_equals (ev->state, Keyboard::TertiaryModifier)) {
step_height (false);
step_height (true);
return true;
} else if (Keyboard::no_modifiers_active (ev->state)) {
_editor.scroll_tracks_down_line();
@ -382,21 +382,16 @@ TimeAxisView::hide ()
Hiding ();
}
/** Steps through the defined heights for this TrackView.
* @param coarser true if stepping should decrease in size, otherwise false.
*/
void
TimeAxisView::step_height (bool bigger)
TimeAxisView::step_height (bool coarser)
{
static const uint32_t step = 25;
if (bigger) {
if (height == preset_height(HeightSmall)) {
set_height_enum (HeightSmaller);
} else if (height == preset_height(HeightSmaller)) {
set_height_enum (HeightNormal);
} else {
set_height (height + step);
}
} else {
if (coarser) {
if (height == preset_height (HeightSmall)) {
return;
}
@ -407,7 +402,18 @@ TimeAxisView::step_height (bool bigger)
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)) {
set_height_enum (HeightNormal);
} else {
set_height (height + step);
}
}
}

View File

@ -154,13 +154,7 @@ class TimeAxisView : public virtual AxisView, public PBD::Stateful
std::pair<TimeAxisView*, ARDOUR::layer_t> covers_y_position (double);
/**
* Steps through the defined heights for this TrackView.
* Sets bigger to true to step up in size, set to fals eot step smaller.
*
* @param bigger true if stepping should increase in size, false otherwise
*/
virtual void step_height (bool bigger);
virtual void step_height (bool);
virtual ARDOUR::RouteGroup* route_group() const { return 0; }
virtual boost::shared_ptr<ARDOUR::Playlist> playlist() const { return boost::shared_ptr<ARDOUR::Playlist> (); }