feat(ags applauncher): improve focusable
This commit is contained in:
parent
fbc6d1c469
commit
0fb2341372
1 changed files with 13 additions and 5 deletions
|
@ -1,6 +1,6 @@
|
||||||
const { App } = ags;
|
const { App } = ags;
|
||||||
const { Applications } = ags.Service;
|
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 { Separator } from '../misc/separator.js';
|
||||||
import { PopUp } from '../misc/popup.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({
|
export default Window({
|
||||||
name: 'applauncher',
|
name: 'applauncher',
|
||||||
popup: true,
|
popup: true,
|
||||||
focusable: true,
|
focusable: true,
|
||||||
layer: 'overlay',
|
layer: 'overlay',
|
||||||
|
child: EventBox({
|
||||||
|
onHover: box => {
|
||||||
|
box.get_parent().focusable = true
|
||||||
|
},
|
||||||
|
onHoverLost: box => {
|
||||||
|
box.get_parent().focusable = false
|
||||||
|
},
|
||||||
child: PopUp({
|
child: PopUp({
|
||||||
name: 'applauncher',
|
name: 'applauncher',
|
||||||
child: Applauncher(),
|
child: Applauncher(),
|
||||||
}),
|
}),
|
||||||
|
}),
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue