don't close the logo menu on mouseout

now that we no longer open on hover, it doesn't make as much sense, and
the behavior can be frustrating when the mouse is moved unintentionally
develop
Myk Taylor 2023-09-14 11:46:30 -07:00
parent 04999cae8d
commit fc88bfcbbc
No known key found for this signature in database
2 changed files with 11 additions and 15 deletions

@ -19,14 +19,17 @@ Usage
Menu overlay widget Menu overlay widget
------------------- -------------------
The in-game hotkeys menu is registered with the `overlay` framework and can be The in-game hotkeys menu is registered with the `overlay` framework and appears
enabled as a hotspot in the upper-left corner of the screen. You can bring up as a DFHack logo in the upper-left corner of the screen. You can bring up the
the menu by hovering the mouse cursor over the hotspot and can select a command menu by clicking on the logo or by hitting the global :kbd:`Ctrl`:kbd:`Shift`:kbd:`c` hotkey. You can select a command to run from
to run from the list by clicking on it with the mouse or by using the keyboard the list by clicking on it with the mouse or by using the keyboard to select a
to select a command with the arrow keys and hitting :kbd:`Enter`. command with the arrow keys and hitting :kbd:`Enter`.
The menu closes automatically when an action is taken or when you click or
right click anywhere else on the screen.
A short description of the command will appear in a nearby textbox. If you'd A short description of the command will appear in a nearby textbox. If you'd
like to see the full help text for the command or edit the command before like to see the full help text for the command or edit the command before
running, you can open it for editing in `gui/launcher` by right clicking on the running, you can open it for editing in `gui/launcher` by shift clicking on the
command, left clicking on the arrow to the left of the command, or by pressing command, left clicking on the arrow to the left of the command, or by pressing
the right arrow key while the command is selected. the right arrow key while the command is selected.

@ -297,7 +297,7 @@ function Menu:onRenderFrame(dc, rect)
self.initialize() self.initialize()
self.initialize = nil self.initialize = nil
end end
Menu.super.onRenderFrame(dc, rect) Menu.super.onRenderFrame(self, dc, rect)
end end
function Menu:getMouseFramePos() function Menu:getMouseFramePos()
@ -306,7 +306,7 @@ function Menu:getMouseFramePos()
end end
function Menu:onRenderBody(dc) function Menu:onRenderBody(dc)
local panel = self.subviews.list_panel Menu.super.onRenderBody(self, dc)
local list = self.subviews.list local list = self.subviews.list
local idx = list:getIdxUnderMouse() local idx = list:getIdxUnderMouse()
if idx and idx ~= self.last_mouse_idx then if idx and idx ~= self.last_mouse_idx then
@ -316,13 +316,6 @@ function Menu:onRenderBody(dc)
list:setSelected(idx) list:setSelected(idx)
self.last_mouse_idx = idx self.last_mouse_idx = idx
end end
if self:getMouseFramePos() then
self.mouseover = true
elseif self.mouseover then
-- once the mouse has entered the list area, leaving the frame should
-- close the menu screen
self.parent_view:dismiss()
end
end end
-- ---------- -- -- ---------- --