mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-21 04:45:58 +01:00
Dropdown/Metabutton: fix some scaling issues
This commit is contained in:
parent
f3dbaae6e8
commit
3cd1c0e4b1
2 changed files with 8 additions and 7 deletions
|
|
@ -565,7 +565,7 @@ ArdourButton::render (Cairo::RefPtr<Cairo::Context> const& ctx, cairo_rectangle_
|
|||
const float triw2 = ceil(.577 * _diameter * .5); // 1/sqrt(3) Equilateral triangle
|
||||
//menu arrow
|
||||
cairo_set_source_rgba (cr, 1, 1, 1, 0.4);
|
||||
cairo_move_to(cr, get_width() - triw2 - 5, rint((get_height() + trih) * .5));
|
||||
cairo_move_to(cr, get_width() - triw2 - 5 * scale, rint((get_height() + trih) * .5));
|
||||
cairo_rel_line_to(cr, -triw2, -trih);
|
||||
cairo_rel_line_to(cr, 2. * triw2, 0);
|
||||
cairo_close_path(cr);
|
||||
|
|
@ -573,7 +573,7 @@ ArdourButton::render (Cairo::RefPtr<Cairo::Context> const& ctx, cairo_rectangle_
|
|||
cairo_set_source_rgba (cr, 1, 1, 1, 0.4);
|
||||
cairo_fill(cr);
|
||||
|
||||
cairo_move_to(cr, get_width() - triw2 - 5, rint((get_height() + trih) * .5));
|
||||
cairo_move_to(cr, get_width() - triw2 - 5 * scale, rint((get_height() + trih) * .5));
|
||||
cairo_rel_line_to(cr, .5 - triw2, .5 - trih);
|
||||
cairo_rel_line_to(cr, 2. * triw2 - 1, 0);
|
||||
cairo_close_path(cr);
|
||||
|
|
@ -583,8 +583,8 @@ ArdourButton::render (Cairo::RefPtr<Cairo::Context> const& ctx, cairo_rectangle_
|
|||
}
|
||||
|
||||
if (_elements & MetaMenu) {
|
||||
cairo_move_to(cr, get_width() - floor (_diameter) - 6.5, 1);
|
||||
cairo_line_to(cr, get_width() - floor (_diameter) - 6.5, get_height () -1);
|
||||
cairo_move_to(cr, get_width() - floor (_diameter) - 6.5 * scale, 1);
|
||||
cairo_line_to(cr, get_width() - floor (_diameter) - 6.5 * scale, get_height () -1);
|
||||
Gtkmm2ext::set_source_rgba (cr, outline_color);
|
||||
cairo_set_line_width(cr, 1);
|
||||
cairo_stroke(cr);
|
||||
|
|
|
|||
|
|
@ -251,13 +251,14 @@ MetaButton::render (Cairo::RefPtr<Cairo::Context> const& ctx, cairo_rectangle_t*
|
|||
ArdourButton::render (ctx, rect);
|
||||
}
|
||||
if (_hovering && UIConfigurationBase::instance ().get_widget_prelight ()) {
|
||||
const float scale = UIConfigurationBase::instance().get_ui_scale();
|
||||
const bool boxy = (_tweaks & ForceBoxy) | boxy_buttons ();
|
||||
const float corner_radius = boxy ? 0 : std::max (2.f, _corner_radius * UIConfigurationBase::instance ().get_ui_scale ());
|
||||
const float corner_radius = boxy ? 0 : std::max (2.f, _corner_radius * scale);
|
||||
cairo_t* cr = ctx->cobj ();
|
||||
if (_hover_dropdown) {
|
||||
Gtkmm2ext::rounded_right_half_rectangle (cr, get_width () - _diameter - 6, 1, _diameter + 5, get_height () - 2, corner_radius);
|
||||
Gtkmm2ext::rounded_right_half_rectangle (cr, get_width () - _diameter - 6 * scale, 1, _diameter + 5 * scale, get_height () - 2, corner_radius);
|
||||
} else {
|
||||
Gtkmm2ext::rounded_left_half_rectangle (cr, 1, 1, get_width () - _diameter - 8, get_height () - 2, corner_radius);
|
||||
Gtkmm2ext::rounded_left_half_rectangle (cr, 1, 1, get_width () - _diameter - 8 * scale, get_height () - 2 * scale, corner_radius);
|
||||
}
|
||||
cairo_set_source_rgba (cr, 0.905, 0.917, 0.925, 0.2);
|
||||
cairo_fill (cr);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue