mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:27:45 +00:00
LibGUI: Adjust OpacitySlider min size for consistency
22 is the size usually used for default widget height, like Buttons and Labels.
This commit is contained in:
parent
f1271c7860
commit
cb872f5c9a
1 changed files with 4 additions and 5 deletions
|
@ -22,6 +22,7 @@ OpacitySlider::OpacitySlider(Gfx::Orientation orientation)
|
||||||
set_min(0);
|
set_min(0);
|
||||||
set_max(100);
|
set_max(100);
|
||||||
set_value(100);
|
set_value(100);
|
||||||
|
set_preferred_size(SpecialDimension::Fit);
|
||||||
}
|
}
|
||||||
|
|
||||||
Gfx::IntRect OpacitySlider::frame_inner_rect() const
|
Gfx::IntRect OpacitySlider::frame_inner_rect() const
|
||||||
|
@ -192,17 +193,15 @@ void OpacitySlider::mousewheel_event(MouseEvent& event)
|
||||||
Optional<UISize> OpacitySlider::calculated_min_size() const
|
Optional<UISize> OpacitySlider::calculated_min_size() const
|
||||||
{
|
{
|
||||||
if (orientation() == Gfx::Orientation::Vertical)
|
if (orientation() == Gfx::Orientation::Vertical)
|
||||||
return { { 20, 40 } };
|
return { { 22, 40 } };
|
||||||
else
|
return { { 40, 22 } };
|
||||||
return { { 40, 20 } };
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Optional<UISize> OpacitySlider::calculated_preferred_size() const
|
Optional<UISize> OpacitySlider::calculated_preferred_size() const
|
||||||
{
|
{
|
||||||
if (orientation() == Gfx::Orientation::Vertical)
|
if (orientation() == Gfx::Orientation::Vertical)
|
||||||
return { { SpecialDimension::Shrink, SpecialDimension::OpportunisticGrow } };
|
return { { SpecialDimension::Shrink, SpecialDimension::OpportunisticGrow } };
|
||||||
else
|
return { { SpecialDimension::OpportunisticGrow, SpecialDimension::Shrink } };
|
||||||
return { { SpecialDimension::OpportunisticGrow, SpecialDimension::Shrink } };
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue