1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-19 16:55:07 +00:00

LibGUI: Don't draw left and right side of surfaces that span entire window.

In other words, if a surface stretches from the left side of the window
all the way to the right side, skip shading and highlighting the sides.
This makes widgets blend together just slightly with the window. :^)
This commit is contained in:
Andreas Kling 2019-03-29 02:20:22 +01:00
parent 9d7a513681
commit d48f486634
7 changed files with 31 additions and 9 deletions

View file

@ -38,8 +38,11 @@ void GFrame::paint_event(GPaintEvent& event)
if (m_thickness >= 1) {
painter.draw_line(rect().top_left(), rect().top_right(), top_left_color);
painter.draw_line(rect().bottom_left(), rect().bottom_right(), bottom_right_color);
painter.draw_line(rect().top_left().translated(0, 1), rect().bottom_left().translated(0, -1), top_left_color);
painter.draw_line(rect().top_right(), rect().bottom_right().translated(0, -1), bottom_right_color);
if (m_shape != Shape::Panel || !spans_entire_window_horizontally()) {
painter.draw_line(rect().top_left().translated(0, 1), rect().bottom_left().translated(0, -1), top_left_color);
painter.draw_line(rect().top_right(), rect().bottom_right().translated(0, -1), bottom_right_color);
}
}
if (m_shape == Shape::Container && m_thickness >= 2) {