mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 20:08:13 +00:00
WidgetGallery: Add GUI::ValueSlider widget
This was a cool slider and was missing from the gallery completely. Vertical mode for this isn't enabled, and it looked awfully crammed in the bottom along with the other horizontal sliders, so for now I've just added this to the top, and it controls the opacity of the image along with the opacity slider.
This commit is contained in:
parent
a4efaa7b47
commit
c545d4ffcb
3 changed files with 33 additions and 2 deletions
|
@ -25,6 +25,7 @@
|
|||
#include <LibGUI/SpinBox.h>
|
||||
#include <LibGUI/TabWidget.h>
|
||||
#include <LibGUI/TableView.h>
|
||||
#include <LibGUI/ValueSlider.h>
|
||||
#include <LibGfx/FontDatabase.h>
|
||||
#include <LibGfx/Palette.h>
|
||||
|
||||
|
@ -217,6 +218,15 @@ GalleryWidget::GalleryWidget()
|
|||
|
||||
m_opacity_slider->on_change = [&](auto percent) {
|
||||
m_opacity_imagewidget->set_opacity_percent(percent);
|
||||
m_opacity_value_slider->set_value(percent);
|
||||
};
|
||||
|
||||
m_opacity_value_slider = sliders_tab.find_descendant_of_type_named<GUI::ValueSlider>("opacity_value_slider");
|
||||
m_opacity_value_slider->set_range(0, 100);
|
||||
|
||||
m_opacity_value_slider->on_change = [&](auto percent) {
|
||||
m_opacity_imagewidget->set_opacity_percent(percent);
|
||||
m_opacity_slider->set_value(percent);
|
||||
};
|
||||
|
||||
auto& wizards_tab = tab_widget.add_tab<GUI::Widget>("Wizards");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue