mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 14:54:56 +01:00
make audio clock fill vertical space
git-svn-id: svn://localhost/ardour2/branches/3.0@13474 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
b8ff65ea1b
commit
cf55921aea
2 changed files with 11 additions and 12 deletions
|
|
@ -391,12 +391,11 @@ ARDOUR_UI::setup_transport ()
|
||||||
|
|
||||||
HBox* clock_box = manage (new HBox);
|
HBox* clock_box = manage (new HBox);
|
||||||
|
|
||||||
primary_clock->set_border_width (2);
|
|
||||||
clock_box->pack_start (*primary_clock, false, false);
|
clock_box->pack_start (*primary_clock, false, false);
|
||||||
if (!ARDOUR::Profile->get_small_screen()) {
|
if (!ARDOUR::Profile->get_small_screen()) {
|
||||||
secondary_clock->set_border_width (2);
|
|
||||||
clock_box->pack_start (*secondary_clock, false, false);
|
clock_box->pack_start (*secondary_clock, false, false);
|
||||||
}
|
}
|
||||||
|
clock_box->set_spacing (3);
|
||||||
|
|
||||||
shuttle_box = new ShuttleControl;
|
shuttle_box = new ShuttleControl;
|
||||||
shuttle_box->show ();
|
shuttle_box->show ();
|
||||||
|
|
|
||||||
|
|
@ -283,7 +283,7 @@ AudioClock::render (cairo_t* cr)
|
||||||
cairo_set_source_rgba (cr, bg_r, bg_g, bg_b, bg_a);
|
cairo_set_source_rgba (cr, bg_r, bg_g, bg_b, bg_a);
|
||||||
if (corner_radius) {
|
if (corner_radius) {
|
||||||
if (_left_layout) {
|
if (_left_layout) {
|
||||||
Gtkmm2ext::rounded_top_half_rectangle (cr, 0, 0, get_width() - corner_radius/2.0, upper_height, corner_radius);
|
Gtkmm2ext::rounded_top_half_rectangle (cr, 0, 0, get_width(), upper_height, corner_radius);
|
||||||
} else {
|
} else {
|
||||||
Gtkmm2ext::rounded_rectangle (cr, 0, 0, get_width(), upper_height, corner_radius);
|
Gtkmm2ext::rounded_rectangle (cr, 0, 0, get_width(), upper_height, corner_radius);
|
||||||
}
|
}
|
||||||
|
|
@ -296,7 +296,7 @@ AudioClock::render (cairo_t* cr)
|
||||||
if (!_fixed_width) {
|
if (!_fixed_width) {
|
||||||
cairo_move_to (cr, layout_x_offset, 0);
|
cairo_move_to (cr, layout_x_offset, 0);
|
||||||
} else {
|
} else {
|
||||||
int xcenter = layout_x_offset > corner_radius/4.0 ? 0 : (get_width() - _mode_width[_mode]) /2;
|
int xcenter = layout_x_offset > 0 ? 0 : (get_width() - _mode_width[_mode]) /2;
|
||||||
cairo_move_to (cr, layout_x_offset + xcenter, (upper_height - layout_height) / 2.0);
|
cairo_move_to (cr, layout_x_offset + xcenter, (upper_height - layout_height) / 2.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -318,7 +318,7 @@ AudioClock::render (cairo_t* cr)
|
||||||
if (corner_radius) {
|
if (corner_radius) {
|
||||||
Gtkmm2ext::rounded_bottom_half_rectangle (cr, 0, upper_height + separator_height,
|
Gtkmm2ext::rounded_bottom_half_rectangle (cr, 0, upper_height + separator_height,
|
||||||
left_rect_width + (separator_height == 0 ? corner_radius : 0),
|
left_rect_width + (separator_height == 0 ? corner_radius : 0),
|
||||||
h - corner_radius/2.0, corner_radius);
|
h, corner_radius);
|
||||||
} else {
|
} else {
|
||||||
cairo_rectangle (cr, 0, upper_height + separator_height, left_rect_width, h);
|
cairo_rectangle (cr, 0, upper_height + separator_height, left_rect_width, h);
|
||||||
}
|
}
|
||||||
|
|
@ -332,8 +332,8 @@ AudioClock::render (cairo_t* cr)
|
||||||
if (corner_radius) {
|
if (corner_radius) {
|
||||||
Gtkmm2ext::rounded_bottom_half_rectangle (cr, left_rect_width + separator_height,
|
Gtkmm2ext::rounded_bottom_half_rectangle (cr, left_rect_width + separator_height,
|
||||||
upper_height + separator_height,
|
upper_height + separator_height,
|
||||||
get_width() - separator_height - left_rect_width - corner_radius/2.0,
|
get_width() - separator_height - left_rect_width,
|
||||||
h - corner_radius/2.0, corner_radius);
|
h, corner_radius);
|
||||||
} else {
|
} else {
|
||||||
cairo_rectangle (cr, left_rect_width + separator_height, upper_height + separator_height,
|
cairo_rectangle (cr, left_rect_width + separator_height, upper_height + separator_height,
|
||||||
get_width() - separator_height - left_rect_width, h);
|
get_width() - separator_height - left_rect_width, h);
|
||||||
|
|
@ -352,7 +352,7 @@ AudioClock::render (cairo_t* cr)
|
||||||
*/
|
*/
|
||||||
int x, rw, rh;
|
int x, rw, rh;
|
||||||
_right_layout->get_pixel_size(rw, rh);
|
_right_layout->get_pixel_size(rw, rh);
|
||||||
x = get_width() - rw - separator_height - x_leading_padding - corner_radius/2.0;
|
x = get_width() - rw - separator_height - x_leading_padding;
|
||||||
if (x < x_leading_padding + left_rect_width + separator_height) {
|
if (x < x_leading_padding + left_rect_width + separator_height) {
|
||||||
/* rather cut off the right end than overlap with the text on the left */
|
/* rather cut off the right end than overlap with the text on the left */
|
||||||
x = x_leading_padding + left_rect_width + separator_height;
|
x = x_leading_padding + left_rect_width + separator_height;
|
||||||
|
|
@ -380,7 +380,7 @@ AudioClock::render (cairo_t* cr)
|
||||||
if (editing) {
|
if (editing) {
|
||||||
if (!insert_map.empty()) {
|
if (!insert_map.empty()) {
|
||||||
|
|
||||||
int xcenter = layout_x_offset > corner_radius/4.0 ? 0 : (get_width() - _mode_width[_mode]) /2;
|
int xcenter = layout_x_offset > 0 ? 0 : (get_width() - _mode_width[_mode]) /2;
|
||||||
|
|
||||||
if (input_string.length() < insert_map.size()) {
|
if (input_string.length() < insert_map.size()) {
|
||||||
Pango::Rectangle cursor;
|
Pango::Rectangle cursor;
|
||||||
|
|
@ -1561,7 +1561,7 @@ AudioClock::on_button_press_event (GdkEventButton *ev)
|
||||||
/* the text has been centered vertically, so adjust
|
/* the text has been centered vertically, so adjust
|
||||||
* x and y.
|
* x and y.
|
||||||
*/
|
*/
|
||||||
int xcenter = !_fixed_width || layout_x_offset > corner_radius/4.0 ? 0 : (get_width() - _mode_width[_mode]) /2;
|
int xcenter = !_fixed_width || layout_x_offset > 0 ? 0 : (get_width() - _mode_width[_mode]) /2;
|
||||||
|
|
||||||
y = ev->y - ((upper_height - layout_height)/2);
|
y = ev->y - ((upper_height - layout_height)/2);
|
||||||
x = ev->x - layout_x_offset - xcenter;
|
x = ev->x - layout_x_offset - xcenter;
|
||||||
|
|
@ -1606,7 +1606,7 @@ AudioClock::on_button_release_event (GdkEventButton *ev)
|
||||||
|
|
||||||
if (_edit_by_click_field) {
|
if (_edit_by_click_field) {
|
||||||
|
|
||||||
int xcenter = !_fixed_width || layout_x_offset > corner_radius/4.0 ? 0 : (get_width() - _mode_width[_mode]) /2;
|
int xcenter = !_fixed_width || layout_x_offset > 0 ? 0 : (get_width() - _mode_width[_mode]) /2;
|
||||||
int index = 0;
|
int index = 0;
|
||||||
int trailing;
|
int trailing;
|
||||||
int y = ev->y - ((upper_height - layout_height)/2);
|
int y = ev->y - ((upper_height - layout_height)/2);
|
||||||
|
|
@ -1677,7 +1677,7 @@ AudioClock::on_scroll_event (GdkEventScroll *ev)
|
||||||
* x and y.
|
* x and y.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int xcenter = !_fixed_width || layout_x_offset > corner_radius/4.0 ? 0 : (get_width() - _mode_width[_mode]) /2;
|
int xcenter = !_fixed_width || layout_x_offset > 0 ? 0 : (get_width() - _mode_width[_mode]) /2;
|
||||||
y = ev->y - ((upper_height - layout_height)/2);
|
y = ev->y - ((upper_height - layout_height)/2);
|
||||||
x = ev->x - layout_x_offset - xcenter;
|
x = ev->x - layout_x_offset - xcenter;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue