Skip to content

Commit fd73816

Browse files
dterraheTurboGit
authored andcommitted
mark slider range beyond soft bounds
1 parent 1ef12bc commit fd73816

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/bauhaus/bauhaus.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1099,6 +1099,7 @@ void dt_bauhaus_widget_set_quad_paint(GtkWidget *widget,
10991099
w->quad_paint = f;
11001100
w->quad_paint_flags = paint_flags;
11011101
w->quad_paint_data = paint_data;
1102+
gtk_widget_queue_draw(widget);
11021103
}
11031104

11041105
void dt_bauhaus_widget_set_quad_tooltip(GtkWidget *widget,
@@ -2243,6 +2244,17 @@ static void _draw_baseline(dt_bauhaus_widget_t *w,
22432244

22442245
cairo_fill(cr);
22452246

2247+
if(d->min != d->soft_min || d->max != d->soft_max)
2248+
{
2249+
set_color(cr, bh->color_fg_insensitive);
2250+
const double scale = slider_width / (d->max - d->min);
2251+
cairo_rectangle(cr, 0, htm, scale * MAX(0, d->soft_min - d->min), htM);
2252+
cairo_fill(cr);
2253+
const double upper = scale * (MIN(d->soft_max, d->max) - d->min);
2254+
cairo_rectangle(cr, upper, htm, slider_width - upper,htM);
2255+
cairo_fill(cr);
2256+
}
2257+
22462258
// get the reference of the slider aka the position of the 0 value
22472259
const float origin =
22482260
fmaxf(fminf((d->factor > 0 ? -d->min - d->offset/d->factor

0 commit comments

Comments
 (0)