1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 20:28:11 +00:00

GSlider: Make the knob width proportional to the range, if in that mode (#288)

Regardless of mode, made the knob container clickable so the knob position
can be moved without dragging the knob itself.

Added a 3rd GSlider to the WidgetGallery showing the proportional mode in
action.
This commit is contained in:
Lawrence Manning 2019-07-11 15:31:43 +01:00 committed by Andreas Kling
parent eb64a4ca60
commit 01998a10e3
3 changed files with 39 additions and 10 deletions

3
Demos/WidgetGallery/main.cpp Normal file → Executable file
View file

@ -70,6 +70,9 @@ int main(int argc, char** argv)
(void)slider1;
auto* slider2 = new GSlider(main_widget);
slider2->set_enabled(false);
auto* slider3 = new GSlider(main_widget);
slider3->set_max(5);
slider3->set_knob_size_mode(GSlider::KnobSizeMode::Proportional);
auto* scrollbar1 = new GScrollBar(Orientation::Horizontal, main_widget);
scrollbar1->set_size_policy(SizePolicy::Fill, SizePolicy::Fixed);