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
Notes: sideshowbarker 2024-07-19 14:54:38 +09:00
7 changed files with 31 additions and 9 deletions

View file

@ -353,3 +353,18 @@ void GWidget::set_visible(bool visible)
if (m_visible)
update();
}
bool GWidget::spans_entire_window_horizontally() const
{
auto* w = window();
if (!w)
return false;
auto* main_widget = w->main_widget();
if (!main_widget)
return false;
if (main_widget == this)
return true;
auto wrr = window_relative_rect();
dbgprintf("Checking %s{%p} wrr=%s, mwr=%s\n", class_name(), this, wrr.to_string().characters(), main_widget->rect().to_string().characters());
return wrr.left() == main_widget->rect().left() && wrr.right() == main_widget->rect().right();
}