enlarge scrollbars when focused
This commit is contained in:
parent
f7985f8c7f
commit
ca691d1294
2 changed files with 7 additions and 6 deletions
|
|
@ -54,7 +54,7 @@ fn ElemEvents! Ctx.slider_hor(&ctx,
|
|||
Point m = ctx.input.mouse.pos;
|
||||
elem.events = ctx.get_elem_events(elem);
|
||||
|
||||
if (ctx.elem_focus(elem) && elem.events.mouse_hold) {
|
||||
if (ctx.elem_focus(elem) && ctx.is_mouse_down(BTN_LEFT)) {
|
||||
*value = calc_value(elem.bounds.x, m.x, elem.bounds.w, hw);
|
||||
elem.slider.handle.x = calc_slider(elem.bounds.x, elem.bounds.w-hw, *value);
|
||||
elem.events.update = true;
|
||||
|
|
@ -117,7 +117,7 @@ fn ElemEvents! Ctx.slider_ver(&ctx,
|
|||
Point m = ctx.input.mouse.pos;
|
||||
elem.events = ctx.get_elem_events(elem);
|
||||
|
||||
if (ctx.elem_focus(elem) && elem.events.mouse_hold) {
|
||||
if (ctx.elem_focus(elem) && ctx.is_mouse_down(BTN_LEFT)) {
|
||||
*value = calc_value(elem.bounds.y, m.y, elem.bounds.h, hh);
|
||||
elem.slider.handle.y = calc_slider(elem.bounds.y, elem.bounds.h-hh, *value);
|
||||
elem.events.update = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue