mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-24 07:27:44 +01:00
make resize button more visible; make standard heights the right size to hold it; first part of zoom-to-region scales track size
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@3299 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
53199152fd
commit
77ebc1fb42
3 changed files with 19 additions and 4 deletions
|
|
@ -23,6 +23,7 @@
|
|||
#include <cmath>
|
||||
#include <string>
|
||||
#include <map>
|
||||
#include <set>
|
||||
|
||||
#include <pbd/error.h>
|
||||
#include <pbd/basename.h>
|
||||
|
|
@ -1692,6 +1693,7 @@ Editor::temporal_zoom_region ()
|
|||
nframes64_t start = max_frames;
|
||||
nframes64_t end = 0;
|
||||
RegionSelection rs;
|
||||
set<TimeAxisView*> tracks;
|
||||
|
||||
get_regions_for_action (rs);
|
||||
|
||||
|
|
@ -1706,6 +1708,8 @@ Editor::temporal_zoom_region ()
|
|||
if ((*i)->region()->last_frame() + 1 > end) {
|
||||
end = (*i)->region()->last_frame() + 1;
|
||||
}
|
||||
|
||||
tracks.insert (&((*i)->get_time_axis_view()));
|
||||
}
|
||||
|
||||
/* now comes an "interesting" hack ... make sure we leave a little space
|
||||
|
|
@ -1733,6 +1737,15 @@ Editor::temporal_zoom_region ()
|
|||
}
|
||||
|
||||
temporal_zoom_by_frame (start, end, "zoom to region");
|
||||
|
||||
uint32_t per_track_height = (uint32_t) floor ((canvas_height - 10.0) / tracks.size());
|
||||
|
||||
for (set<TimeAxisView*>::iterator t = tracks.begin(); t != tracks.end(); ++t) {
|
||||
(*t)->set_height (per_track_height);
|
||||
}
|
||||
|
||||
vertical_adjustment.set_value (std::max ((*tracks.begin())->y_position - 5.0, 0.0));
|
||||
|
||||
zoomed_to_region = true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -92,7 +92,8 @@
|
|||
|
||||
;; HOME ROW
|
||||
|
||||
(gtk_accel_path "<Actions>/Editor/zoom-to-region" "<%SECONDARY%>z")
|
||||
(gtk_accel_path "<Actions>/Editor/zoom-to-region" "z")
|
||||
;;(gtk_accel_path "<Actions>/Editor/zoom-to-region-both-axes" "<%SECONDARY%>z")
|
||||
(gtk_accel_path "<Actions>/Editor/undo" "<%PRIMARY%>z")
|
||||
(gtk_accel_path "<Actions>/Editor/toggle-zoom" "<%TERTIARY%>z")
|
||||
(gtk_accel_path "<Actions>/MouseMode/set-mouse-mode-zoom" "z")
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ TimeAxisView::TimeAxisView (ARDOUR::Session& sess, PublicEditor& ed, TimeAxisVie
|
|||
controls_table.show_all ();
|
||||
controls_table.set_no_show_all ();
|
||||
|
||||
resizer.set_size_request (5, 5);
|
||||
resizer.set_size_request (10, 10);
|
||||
resizer.signal_expose_event().connect (mem_fun (*this, &TimeAxisView::resizer_expose));
|
||||
resizer.signal_button_press_event().connect (mem_fun (*this, &TimeAxisView::resizer_button_press));
|
||||
resizer.signal_button_release_event().connect (mem_fun (*this, &TimeAxisView::resizer_button_release));
|
||||
|
|
@ -981,7 +981,8 @@ TimeAxisView::compute_controls_size_info ()
|
|||
Gtk::Table one_row_table (1, 8);
|
||||
Button* buttons[5];
|
||||
const int border_width = 2;
|
||||
const int extra_height = (2 * border_width) + 2; // 2 pixels for the controls frame
|
||||
const int extra_height = (2 * border_width) + 2 // 2 pixels for the controls frame
|
||||
+ 10; // resizer button
|
||||
|
||||
window.add (one_row_table);
|
||||
|
||||
|
|
@ -1225,7 +1226,7 @@ TimeAxisView::resizer_motion (GdkEventMotion* ev)
|
|||
bool
|
||||
TimeAxisView::resizer_expose (GdkEventExpose* event)
|
||||
{
|
||||
resizer.get_window()->draw_rectangle (resizer.get_style()->get_bg_gc(resizer.get_state()),
|
||||
resizer.get_window()->draw_rectangle (resizer.get_style()->get_fg_gc(STATE_ACTIVE),
|
||||
true,
|
||||
event->area.x,
|
||||
event->area.y,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue