feat(ags pointers): add stay as choice for popup windows

This commit is contained in:
matt1432 2023-11-06 21:36:12 -05:00
parent 107fb94fe8
commit a16d7d4748
8 changed files with 11 additions and 18 deletions

View file

@ -14,8 +14,6 @@ export default () => EventBox({
child: Box({
className: 'osk-toggle',
vertical: false,
children: [Label({
label: ' 󰌌 ',
})],
children: [Label(' 󰌌 ')],
}),
});

View file

@ -14,8 +14,6 @@ export default () => EventBox({
child: Box({
className: 'quick-settings-toggle',
vertical: false,
child: Label({
label: '  ',
}),
child: Label('  '),
}),
});

View file

@ -14,8 +14,6 @@ export default () => EventBox({
child: Box({
className: 'tablet-toggle',
vertical: false,
children: [Label({
label: ' 󰦧 ',
})],
children: [Label(' 󰦧 ')],
}),
});

View file

@ -13,7 +13,7 @@ export default ({
connections,
props,
} = {}) => {
const widget = EventBox({});
const widget = EventBox();
const gesture = Gtk.GestureDrag.new(widget);
widget.add(Overlay({

View file

@ -162,10 +162,8 @@ export const PositionSlider = (player, props) => EventBox({
.new_from_name(display, 'grabbing'));
}
else {
if (slider.get_parent() && slider.get_parent().window) {
slider.get_parent().window.set_cursor(Gdk.Cursor
slider.get_parent()?.window?.set_cursor(Gdk.Cursor
.new_from_name(display, 'pointer'));
}
slider.visible = player.length > 0;
if (player.length > 0)

View file

@ -3,7 +3,7 @@ import App from 'resource:///com/github/Aylur/ags/app.js';
export default () => {
Array.from(App.windows)
.filter(w => w[1].closeOnUnfocus)
.filter(w => w[1].closeOnUnfocus && w[1].closeOnUnfocus !== 'stay')
.forEach(w => {
App.closeWindow(w[0]);
});

View file

@ -56,7 +56,7 @@ export default () => PopupWindow({
anchor: ['top', 'left'],
visible: true,
transition: 'none',
closeOnUnfocus: 'none',
closeOnUnfocus: 'stay',
child: Box({
vertical: true,
connections: [

View file

@ -123,8 +123,9 @@ class Pointers extends Service {
initAppConnection() {
App.connect('window-toggled', () => {
const anyVisibleAndClosable = Array.from(App.windows).some(w => {
const closable = (w[1].closeOnUnfocus &&
w[1].closeOnUnfocus !== 'none');
const closable = w[1].closeOnUnfocus &&
!(w[1].closeOnUnfocus === 'none' ||
w[1].closeOnUnfocus === 'stay');
return w[1].visible && closable;
});