From 0fb23413722bb510c6a21d1d84fa1f5169e20bbd Mon Sep 17 00:00:00 2001 From: matt1432 Date: Fri, 29 Sep 2023 18:21:29 -0400 Subject: [PATCH] feat(ags applauncher): improve focusable --- config/ags/js/applauncher/main.js | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/config/ags/js/applauncher/main.js b/config/ags/js/applauncher/main.js index 6c80160..80e24f2 100644 --- a/config/ags/js/applauncher/main.js +++ b/config/ags/js/applauncher/main.js @@ -1,6 +1,6 @@ const { App } = ags; const { Applications } = ags.Service; -const { Label, Box, Icon, Button, Scrollable, Entry, Window } = ags.Widget; +const { Label, Box, Icon, Button, Scrollable, Entry, Window, EventBox } = ags.Widget; import { Separator } from '../misc/separator.js'; import { PopUp } from '../misc/popup.js'; @@ -113,14 +113,22 @@ const Applauncher = ({ windowName = 'applauncher' } = {}) => { }); }; -// TODO: make focusable a bit less focusable +// FIXME: make it so I don't have to click to trigger onHoverLost export default Window({ name: 'applauncher', popup: true, focusable: true, layer: 'overlay', - child: PopUp({ - name: 'applauncher', - child: Applauncher(), + child: EventBox({ + onHover: box => { + box.get_parent().focusable = true + }, + onHoverLost: box => { + box.get_parent().focusable = false + }, + child: PopUp({ + name: 'applauncher', + child: Applauncher(), + }), }), });