|
|
@ -42,27 +42,11 @@ fn ElemEvents! Ctx.slider_hor(&ctx, String label, Rect size) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Draw the button |
|
|
|
// Draw the slider background and handle |
|
|
|
Color bg_color = uint_to_rgba(0x0000ffff); |
|
|
|
Color bg_color = uint_to_rgba(0x0000ffff); |
|
|
|
Color handle_color = uint_to_rgba(0x0ff000ff); |
|
|
|
Color handle_color = uint_to_rgba(0x0ff000ff); |
|
|
|
|
|
|
|
ctx.push_rect(c_elem.bounds, bg_color)!; |
|
|
|
Cmd cmd = { |
|
|
|
ctx.push_rect(c_elem.slider.handle, handle_color)!; |
|
|
|
.type = CMD_RECT, |
|
|
|
|
|
|
|
.rect = { |
|
|
|
|
|
|
|
.rect = c_elem.bounds, |
|
|
|
|
|
|
|
.color = bg_color, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
ctx.cmd_queue.enqueue(&cmd)!; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cmd = Cmd{ |
|
|
|
|
|
|
|
.type = CMD_RECT, |
|
|
|
|
|
|
|
.rect = { |
|
|
|
|
|
|
|
.rect = c_elem.slider.handle, |
|
|
|
|
|
|
|
.color = handle_color, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
ctx.cmd_queue.enqueue(&cmd)!; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return c_elem.events; |
|
|
|
return c_elem.events; |
|
|
|
} |
|
|
|
} |
|
|
@ -117,24 +101,8 @@ fn ElemEvents! Ctx.slider_ver(&ctx, String label, Rect size) |
|
|
|
// Draw the button |
|
|
|
// Draw the button |
|
|
|
Color bg_color = uint_to_rgba(0x0000ffff); |
|
|
|
Color bg_color = uint_to_rgba(0x0000ffff); |
|
|
|
Color handle_color = uint_to_rgba(0x0ff000ff); |
|
|
|
Color handle_color = uint_to_rgba(0x0ff000ff); |
|
|
|
|
|
|
|
ctx.push_rect(c_elem.bounds, bg_color)!; |
|
|
|
Cmd cmd = { |
|
|
|
ctx.push_rect(c_elem.slider.handle, handle_color)!; |
|
|
|
.type = CMD_RECT, |
|
|
|
|
|
|
|
.rect = { |
|
|
|
|
|
|
|
.rect = c_elem.bounds, |
|
|
|
|
|
|
|
.color = bg_color, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
ctx.cmd_queue.enqueue(&cmd)!; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cmd = Cmd{ |
|
|
|
|
|
|
|
.type = CMD_RECT, |
|
|
|
|
|
|
|
.rect = { |
|
|
|
|
|
|
|
.rect = c_elem.slider.handle, |
|
|
|
|
|
|
|
.color = handle_color, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
ctx.cmd_queue.enqueue(&cmd)!; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return c_elem.events; |
|
|
|
return c_elem.events; |
|
|
|
} |
|
|
|
} |
|
|
|