mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-17 08:32:54 +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:
parent
9d7a513681
commit
d48f486634
Notes:
sideshowbarker
2024-07-19 14:54:38 +09:00
Author: https://github.com/awesomekling
Commit: d48f486634
7 changed files with 31 additions and 9 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue