1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 04:27:45 +00:00

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.
This commit is contained in:
thankyouverycool 2023-04-29 16:47:52 -04:00 committed by Andreas Kling
parent 4c9933bfb7
commit f7e034d4b2
58 changed files with 148 additions and 208 deletions

View file

@ -48,7 +48,7 @@ public:
private:
Segment();
void set_frame_shape(Gfx::FrameShape shape) { m_shape = shape; }
void set_frame_style(Gfx::FrameStyle style) { m_style = style; }
void set_restored_width(int width) { m_restored_width = width; }
int restored_width() const { return m_restored_width; }
DeprecatedString const& override_text() const { return m_override_text; }
@ -58,9 +58,8 @@ public:
DeprecatedString m_restored_text;
bool m_clickable { false };
int m_restored_width { 0 };
int m_thickness { 1 };
Mode m_mode { Mode::Proportional };
Gfx::FrameShape m_shape { Gfx::FrameShape::Panel };
Gfx::FrameStyle m_style { Gfx::FrameStyle::SunkenPanel };
};
Segment& segment(size_t index) { return m_segments.at(index); }