feat(ags popupwin): add blur option

This commit is contained in:
matt1432 2023-12-08 00:01:43 -05:00
parent 2d1c0d71f6
commit 90b0f0e49d
5 changed files with 11 additions and 4 deletions

View file

@ -1,4 +1,5 @@
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 { timeout } from 'resource:///com/github/Aylur/ags/utils.js';
@ -17,6 +18,7 @@ export default ({
// Window props
name,
child,
blur = false,
closeOnUnfocus = 'released',
visible = false,
layer = 'overlay',
@ -28,14 +30,20 @@ export default ({
visible: false,
...props,
// Add way to make window open on startup
setup: () => {
// Add way to make window open on startup
const id = App.connect('config-parsed', () => {
if (visible) {
App.openWindow(name);
}
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

View file

@ -91,6 +91,7 @@ export const Overview = () => {
export default () => {
const window = PopupWindow({
name: 'overview',
blur: true,
closeOnUnfocus: 'none',
onOpen: () => {
window.setChild(Overview());

View file

@ -239,7 +239,7 @@ const FirstRow = () => Row({
onOpen: (menu) => {
execAsync(`bluetoothctl scan ${menu.revealChild ?
'on' :
'off'}`);
'off'}`).catch(print);
},
}),

View file

@ -18,7 +18,6 @@ $background-color-10: rgba(238, 238, 238, 0.5);
.notification {
>box {
all: unset;
box-shadow: 0 0 4.5px 0 rgba(0, 0, 0, 0.4);
margin: 9px 9px 0;
border: 2px solid $contrast-bg;
border-radius: 15px;

View file

@ -107,7 +107,6 @@
margin: -8px;
min-height: 20px;
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;
}