feat(ags pointers): add stay as choice for popup windows
This commit is contained in:
parent
107fb94fe8
commit
a16d7d4748
8 changed files with 11 additions and 18 deletions
|
@ -14,8 +14,6 @@ export default () => EventBox({
|
||||||
child: Box({
|
child: Box({
|
||||||
className: 'osk-toggle',
|
className: 'osk-toggle',
|
||||||
vertical: false,
|
vertical: false,
|
||||||
children: [Label({
|
children: [Label(' ')],
|
||||||
label: ' ',
|
|
||||||
})],
|
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|
|
@ -14,8 +14,6 @@ export default () => EventBox({
|
||||||
child: Box({
|
child: Box({
|
||||||
className: 'quick-settings-toggle',
|
className: 'quick-settings-toggle',
|
||||||
vertical: false,
|
vertical: false,
|
||||||
child: Label({
|
child: Label(' '),
|
||||||
label: ' ',
|
|
||||||
}),
|
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|
|
@ -14,8 +14,6 @@ export default () => EventBox({
|
||||||
child: Box({
|
child: Box({
|
||||||
className: 'tablet-toggle',
|
className: 'tablet-toggle',
|
||||||
vertical: false,
|
vertical: false,
|
||||||
children: [Label({
|
children: [Label(' ')],
|
||||||
label: ' ',
|
|
||||||
})],
|
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|
|
@ -13,7 +13,7 @@ export default ({
|
||||||
connections,
|
connections,
|
||||||
props,
|
props,
|
||||||
} = {}) => {
|
} = {}) => {
|
||||||
const widget = EventBox({});
|
const widget = EventBox();
|
||||||
const gesture = Gtk.GestureDrag.new(widget);
|
const gesture = Gtk.GestureDrag.new(widget);
|
||||||
|
|
||||||
widget.add(Overlay({
|
widget.add(Overlay({
|
||||||
|
|
|
@ -162,10 +162,8 @@ export const PositionSlider = (player, props) => EventBox({
|
||||||
.new_from_name(display, 'grabbing'));
|
.new_from_name(display, 'grabbing'));
|
||||||
}
|
}
|
||||||
else {
|
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'));
|
.new_from_name(display, 'pointer'));
|
||||||
}
|
|
||||||
|
|
||||||
slider.visible = player.length > 0;
|
slider.visible = player.length > 0;
|
||||||
if (player.length > 0)
|
if (player.length > 0)
|
||||||
|
|
|
@ -3,7 +3,7 @@ import App from 'resource:///com/github/Aylur/ags/app.js';
|
||||||
|
|
||||||
export default () => {
|
export default () => {
|
||||||
Array.from(App.windows)
|
Array.from(App.windows)
|
||||||
.filter(w => w[1].closeOnUnfocus)
|
.filter(w => w[1].closeOnUnfocus && w[1].closeOnUnfocus !== 'stay')
|
||||||
.forEach(w => {
|
.forEach(w => {
|
||||||
App.closeWindow(w[0]);
|
App.closeWindow(w[0]);
|
||||||
});
|
});
|
||||||
|
|
|
@ -56,7 +56,7 @@ export default () => PopupWindow({
|
||||||
anchor: ['top', 'left'],
|
anchor: ['top', 'left'],
|
||||||
visible: true,
|
visible: true,
|
||||||
transition: 'none',
|
transition: 'none',
|
||||||
closeOnUnfocus: 'none',
|
closeOnUnfocus: 'stay',
|
||||||
child: Box({
|
child: Box({
|
||||||
vertical: true,
|
vertical: true,
|
||||||
connections: [
|
connections: [
|
||||||
|
|
|
@ -123,8 +123,9 @@ class Pointers extends Service {
|
||||||
initAppConnection() {
|
initAppConnection() {
|
||||||
App.connect('window-toggled', () => {
|
App.connect('window-toggled', () => {
|
||||||
const anyVisibleAndClosable = Array.from(App.windows).some(w => {
|
const anyVisibleAndClosable = Array.from(App.windows).some(w => {
|
||||||
const closable = (w[1].closeOnUnfocus &&
|
const closable = w[1].closeOnUnfocus &&
|
||||||
w[1].closeOnUnfocus !== 'none');
|
!(w[1].closeOnUnfocus === 'none' ||
|
||||||
|
w[1].closeOnUnfocus === 'stay');
|
||||||
|
|
||||||
return w[1].visible && closable;
|
return w[1].visible && closable;
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue