summaryrefslogtreecommitdiff
path: root/Servers/WindowServer/WSMenu.h
diff options
context:
space:
mode:
authorShannon Booth <shannon.ml.booth@gmail.com>2020-01-19 12:13:26 +1300
committerAndreas Kling <kling@serenityos.org>2020-01-19 08:45:23 +0100
commitead1273632f36c52c6496b992d9aa74dbc18bc75 (patch)
treed3f64790d6d8b8bc3a731ff57577f3dec0f8b188 /Servers/WindowServer/WSMenu.h
parent6ea70f57247389311b1730821dffb3a55223417b (diff)
downloadserenity-ead1273632f36c52c6496b992d9aa74dbc18bc75.zip
WindowServer: More natural mouse menu navigation
Use an imaginary triangle between the top and bottom of the submenu of a hovered item to determine whether the mouse is moving towards the submenu. If it is, we do not update the hovered item. This allows the submenu to stay open, making for much easier menu navigation. Closes #1094
Diffstat (limited to 'Servers/WindowServer/WSMenu.h')
-rw-r--r--Servers/WindowServer/WSMenu.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/Servers/WindowServer/WSMenu.h b/Servers/WindowServer/WSMenu.h
index 2ecb4bccb6..8aea486501 100644
--- a/Servers/WindowServer/WSMenu.h
+++ b/Servers/WindowServer/WSMenu.h
@@ -133,7 +133,7 @@ private:
WeakPtr<WSWindow> m_window_menu_of;
bool m_is_window_menu_open = { false };
-
+ Point m_last_position_in_hover;
int m_theme_index_at_last_paint { -1 };
int m_hovered_item_index { -1 };
bool m_in_submenu { false };