summaryrefslogtreecommitdiff
path: root/Servers/WindowServer/WSWindowFrame.cpp
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-04-08 18:58:44 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-04-08 18:58:44 +0200
commit7f2eeb0b35d07469815f8221c8f5e0d300899f58 (patch)
tree7dde32ea37170e8e0dbaa494676d442c889d89c4 /Servers/WindowServer/WSWindowFrame.cpp
parent3e175c9a96977f14a8adcf1b5a021ccb48f3b194 (diff)
downloadserenity-7f2eeb0b35d07469815f8221c8f5e0d300899f58.zip
LibGUI+WindowServer: Add support for GWidget tooltips.
Any GWidget can have a tooltip and it will automatically pop up below the center of the widget when hovered. GActions added to GToolBars will use the action text() as their tooltip automagically. :^)
Diffstat (limited to 'Servers/WindowServer/WSWindowFrame.cpp')
-rw-r--r--Servers/WindowServer/WSWindowFrame.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/Servers/WindowServer/WSWindowFrame.cpp b/Servers/WindowServer/WSWindowFrame.cpp
index 5d33c6a09b..b782082937 100644
--- a/Servers/WindowServer/WSWindowFrame.cpp
+++ b/Servers/WindowServer/WSWindowFrame.cpp
@@ -119,6 +119,9 @@ void WSWindowFrame::paint(Painter& painter)
if (m_window.type() == WSWindowType::Taskbar)
return;
+ if (m_window.type() == WSWindowType::Tooltip)
+ return;
+
auto& window = m_window;
auto titlebar_rect = title_bar_rect();
@@ -195,6 +198,8 @@ static Rect frame_rect_for_window_type(WSWindowType type, const Rect& rect)
return rect;
case WSWindowType::Taskbar:
return rect;
+ case WSWindowType::Tooltip:
+ return rect;
default:
ASSERT_NOT_REACHED();
}