mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:07:34 +00:00
LibGfx+LibGUI: Add FrameShape::Window
This shape is for use by the main widget of a frameless window that still wishes to have proper borders but no title. Raised Containers were used previously for this pattern but did not always represent perspective and shadow correctly depending on thread highlighting and the immediate background color. Containers are really meant to be used inside other widgets where the background color can be controlled.
This commit is contained in:
parent
7a7e57ced0
commit
bb4963a697
3 changed files with 8 additions and 1 deletions
|
@ -28,7 +28,8 @@ Frame::Frame()
|
||||||
{ Gfx::FrameShape::NoFrame, "NoFrame" },
|
{ Gfx::FrameShape::NoFrame, "NoFrame" },
|
||||||
{ Gfx::FrameShape::Box, "Box" },
|
{ Gfx::FrameShape::Box, "Box" },
|
||||||
{ Gfx::FrameShape::Container, "Container" },
|
{ Gfx::FrameShape::Container, "Container" },
|
||||||
{ Gfx::FrameShape::Panel, "Panel" });
|
{ Gfx::FrameShape::Panel, "Panel" },
|
||||||
|
{ Gfx::FrameShape::Window, "Window" });
|
||||||
}
|
}
|
||||||
|
|
||||||
Frame::~Frame()
|
Frame::~Frame()
|
||||||
|
|
|
@ -219,6 +219,11 @@ void ClassicStylePainter::paint_frame(Painter& painter, IntRect const& rect, Pal
|
||||||
if (shape == Gfx::FrameShape::NoFrame)
|
if (shape == Gfx::FrameShape::NoFrame)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (shape == FrameShape::Window) {
|
||||||
|
StylePainter::paint_window_frame(painter, rect, palette);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Color top_left_color;
|
Color top_left_color;
|
||||||
Color bottom_right_color;
|
Color bottom_right_color;
|
||||||
Color dark_shade = palette.threed_shadow1();
|
Color dark_shade = palette.threed_shadow1();
|
||||||
|
|
|
@ -28,6 +28,7 @@ enum class FrameShape {
|
||||||
Box,
|
Box,
|
||||||
Container,
|
Container,
|
||||||
Panel,
|
Panel,
|
||||||
|
Window,
|
||||||
};
|
};
|
||||||
|
|
||||||
// FIXME: should this be in its own header?
|
// FIXME: should this be in its own header?
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue