diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-04-08 18:58:44 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-04-08 18:58:44 +0200 |
commit | 7f2eeb0b35d07469815f8221c8f5e0d300899f58 (patch) | |
tree | 7dde32ea37170e8e0dbaa494676d442c889d89c4 /Servers/WindowServer/WSWindowFrame.cpp | |
parent | 3e175c9a96977f14a8adcf1b5a021ccb48f3b194 (diff) | |
download | serenity-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.cpp | 5 |
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(); } |