feat(ags popupwin): add blur option
This commit is contained in:
parent
2d1c0d71f6
commit
90b0f0e49d
5 changed files with 11 additions and 4 deletions
|
@ -1,4 +1,5 @@
|
||||||
import App from 'resource:///com/github/Aylur/ags/app.js';
|
import App from 'resource:///com/github/Aylur/ags/app.js';
|
||||||
|
import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js';
|
||||||
|
|
||||||
import { Revealer, Box, Window } from 'resource:///com/github/Aylur/ags/widget.js';
|
import { Revealer, Box, Window } from 'resource:///com/github/Aylur/ags/widget.js';
|
||||||
import { timeout } from 'resource:///com/github/Aylur/ags/utils.js';
|
import { timeout } from 'resource:///com/github/Aylur/ags/utils.js';
|
||||||
|
@ -17,6 +18,7 @@ export default ({
|
||||||
// Window props
|
// Window props
|
||||||
name,
|
name,
|
||||||
child,
|
child,
|
||||||
|
blur = false,
|
||||||
closeOnUnfocus = 'released',
|
closeOnUnfocus = 'released',
|
||||||
visible = false,
|
visible = false,
|
||||||
layer = 'overlay',
|
layer = 'overlay',
|
||||||
|
@ -28,14 +30,20 @@ export default ({
|
||||||
visible: false,
|
visible: false,
|
||||||
...props,
|
...props,
|
||||||
|
|
||||||
// Add way to make window open on startup
|
|
||||||
setup: () => {
|
setup: () => {
|
||||||
|
// Add way to make window open on startup
|
||||||
const id = App.connect('config-parsed', () => {
|
const id = App.connect('config-parsed', () => {
|
||||||
if (visible) {
|
if (visible) {
|
||||||
App.openWindow(name);
|
App.openWindow(name);
|
||||||
}
|
}
|
||||||
App.disconnect(id);
|
App.disconnect(id);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (blur) {
|
||||||
|
Hyprland.sendMessage('[[BATCH]] ' +
|
||||||
|
`keyword layerrule ignorealpha[0.97],${name}; ` +
|
||||||
|
`keyword layerrule blur,${name}`);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// Wrapping the revealer inside a box is needed
|
// Wrapping the revealer inside a box is needed
|
||||||
|
|
|
@ -91,6 +91,7 @@ export const Overview = () => {
|
||||||
export default () => {
|
export default () => {
|
||||||
const window = PopupWindow({
|
const window = PopupWindow({
|
||||||
name: 'overview',
|
name: 'overview',
|
||||||
|
blur: true,
|
||||||
closeOnUnfocus: 'none',
|
closeOnUnfocus: 'none',
|
||||||
onOpen: () => {
|
onOpen: () => {
|
||||||
window.setChild(Overview());
|
window.setChild(Overview());
|
||||||
|
|
|
@ -239,7 +239,7 @@ const FirstRow = () => Row({
|
||||||
onOpen: (menu) => {
|
onOpen: (menu) => {
|
||||||
execAsync(`bluetoothctl scan ${menu.revealChild ?
|
execAsync(`bluetoothctl scan ${menu.revealChild ?
|
||||||
'on' :
|
'on' :
|
||||||
'off'}`);
|
'off'}`).catch(print);
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,6 @@ $background-color-10: rgba(238, 238, 238, 0.5);
|
||||||
.notification {
|
.notification {
|
||||||
>box {
|
>box {
|
||||||
all: unset;
|
all: unset;
|
||||||
box-shadow: 0 0 4.5px 0 rgba(0, 0, 0, 0.4);
|
|
||||||
margin: 9px 9px 0;
|
margin: 9px 9px 0;
|
||||||
border: 2px solid $contrast-bg;
|
border: 2px solid $contrast-bg;
|
||||||
border-radius: 15px;
|
border-radius: 15px;
|
||||||
|
|
|
@ -107,7 +107,6 @@
|
||||||
margin: -8px;
|
margin: -8px;
|
||||||
min-height: 20px;
|
min-height: 20px;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
box-shadow: rgba(0, 0, 0, 0.25) 0 54px 55px, rgba(0, 0, 0, 0.12) 0 -12px 30px, rgba(0, 0, 0, 0.12) 0 4px 6px, rgba(0, 0, 0, 0.17) 0 12px 13px, rgba(0, 0, 0, 0.09) 0 -3px 5px;
|
|
||||||
transition: background-color 0.5s ease-in-out;
|
transition: background-color 0.5s ease-in-out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue