mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:08:11 +00:00
PixelPaint: Add tooltips for sliders in ToolPropertiesWidget
This adds a tooltip to all the slider properties showing their current value. Previously there was no indication of what value they had. Also rename the SprayTool property 'thickness' to 'size' like BrushTool calls it.
This commit is contained in:
parent
4df1657898
commit
b6200a3ed8
10 changed files with 54 additions and 21 deletions
|
@ -153,13 +153,16 @@ GUI::Widget* RectangleSelectTool::get_properties_widget()
|
|||
feather_label.set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
feather_label.set_fixed_size(80, 20);
|
||||
|
||||
int feather_slider_max = 10000;
|
||||
const int feather_slider_max = 10000;
|
||||
auto& feather_slider = feather_container.add<GUI::HorizontalSlider>();
|
||||
feather_slider.set_fixed_height(20);
|
||||
feather_slider.set_range(0, feather_slider_max);
|
||||
feather_slider.set_value((int)floorf(m_edge_feathering * (float)feather_slider_max));
|
||||
feather_slider.on_change = [this, feather_slider_max](int value) {
|
||||
feather_slider.set_tooltip(String::formatted("{:.2}", (float)m_edge_feathering / (float)feather_slider_max));
|
||||
|
||||
feather_slider.on_change = [&](int value) {
|
||||
m_edge_feathering = (float)value / (float)feather_slider_max;
|
||||
feather_slider.set_tooltip(String::formatted("{:.2}", (float)value / (float)feather_slider_max));
|
||||
};
|
||||
|
||||
auto& mode_container = m_properties_widget->add<GUI::Widget>();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue