diff options
author | thankyouverycool <66646555+thankyouverycool@users.noreply.github.com> | 2023-04-29 16:47:52 -0400 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-04-30 05:49:46 +0200 |
commit | f7e034d4b257a22b898252d62652587601fa7f99 (patch) | |
tree | a69511f055f54e0215a63d6082637d38293e97f6 /Userland/Libraries/LibWeb/Painting | |
parent | 4c9933bfb701c43a2f9aeadf8d06398fd6327749 (diff) | |
download | serenity-f7e034d4b257a22b898252d62652587601fa7f99.zip |
LibGfx+Userland: Merge FrameShape and FrameShadow into FrameStyle
Previously, Frames could set both these properties along with a
thickness to confusing effect: Most shapes of the same shadowing only
differentiated at a thickness >= 2, and some not at all. This led
to a lot of creative but ultimately superfluous choices in the code.
Instead let's streamline our options, automate thickness, and get
the right look without so much guesswork.
Plain shadowing has been consolidated into a single Plain style,
and 0 thickness can be had by setting style to NoFrame.
Diffstat (limited to 'Userland/Libraries/LibWeb/Painting')
-rw-r--r-- | Userland/Libraries/LibWeb/Painting/ImagePaintable.cpp | 2 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/Painting/ProgressPaintable.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibWeb/Painting/ImagePaintable.cpp b/Userland/Libraries/LibWeb/Painting/ImagePaintable.cpp index 01c084a8f2..f9e9841ad5 100644 --- a/Userland/Libraries/LibWeb/Painting/ImagePaintable.cpp +++ b/Userland/Libraries/LibWeb/Painting/ImagePaintable.cpp @@ -44,7 +44,7 @@ void ImagePaintable::paint(PaintContext& context, PaintPhase phase) const auto& image_element = verify_cast<HTML::HTMLImageElement>(*dom_node()); auto enclosing_rect = context.enclosing_device_rect(absolute_rect()).to_type<int>(); context.painter().set_font(Platform::FontPlugin::the().default_font()); - Gfx::StylePainter::paint_frame(context.painter(), enclosing_rect, context.palette(), Gfx::FrameShape::Container, Gfx::FrameShadow::Sunken, 2); + Gfx::StylePainter::paint_frame(context.painter(), enclosing_rect, context.palette(), Gfx::FrameStyle::SunkenContainer); auto alt = image_element.alt(); if (alt.is_empty()) alt = image_element.src(); diff --git a/Userland/Libraries/LibWeb/Painting/ProgressPaintable.cpp b/Userland/Libraries/LibWeb/Painting/ProgressPaintable.cpp index dc97977c45..63b2e5719b 100644 --- a/Userland/Libraries/LibWeb/Painting/ProgressPaintable.cpp +++ b/Userland/Libraries/LibWeb/Painting/ProgressPaintable.cpp @@ -36,7 +36,7 @@ void ProgressPaintable::paint(PaintContext& context, PaintPhase phase) const Gfx::StylePainter::paint_progressbar(context.painter(), progress_rect.shrunken(frame_thickness, frame_thickness).to_type<int>(), context.palette(), 0, round_to<int>(layout_box().dom_node().max()), round_to<int>(layout_box().dom_node().value()), ""sv); - Gfx::StylePainter::paint_frame(context.painter(), progress_rect.to_type<int>(), context.palette(), Gfx::FrameShape::Box, Gfx::FrameShadow::Raised, frame_thickness.value()); + Gfx::StylePainter::paint_frame(context.painter(), progress_rect.to_type<int>(), context.palette(), Gfx::FrameStyle::RaisedBox); } } |