fix(ags): clean up anim on wim
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2024-03-21 21:54:38 -04:00
parent 0ce1b48631
commit a2283e5d6a
3 changed files with 20 additions and 14 deletions

View file

@ -15,6 +15,7 @@ export default () => BarRevealer({
monitor: 1,
exclusivity: 'exclusive',
anchor: ['bottom', 'left', 'right'],
transition: 'slide_up',
bar: Box({
vertical: true,
children: [

View file

@ -35,7 +35,7 @@ Hyprland.connect('event', (hyprObj) => {
}
});
export default ({ bar, monitor = 0, ...rest }) => {
export default ({ bar, transition, monitor = 0, ...rest }) => {
const BarVisible = Variable(true);
FullscreenState.connect('changed', (v) => {
@ -76,6 +76,17 @@ export default ({ bar, monitor = 0, ...rest }) => {
}),
});
const buffer = Box({
css: 'min-height: 10px',
visible: BarVisible.bind().as((v) => !v),
});
const rev = Revealer({
transition,
reveal_child: BarVisible.bind(),
child: bar,
});
return Window({
name: `bar-${monitor}`,
layer: 'overlay',
@ -92,20 +103,13 @@ export default ({ bar, monitor = 0, ...rest }) => {
css: 'min-height: 1px; padding: 1px;',
hexpand: true,
hpack: 'fill',
vertical: true,
vertical: transition === 'slide_up' ||
transition === 'slide_down',
children: [
Box({
css: 'min-height: 10px',
visible: BarVisible.bind().as((v) => !v),
}),
Revealer({
transition: 'slide_up',
reveal_child: BarVisible.bind(),
child: bar,
}),
],
children: transition === 'slide_up' ||
transition === 'slide_left' ?
[buffer, rev] :
[rev, buffer],
}),
}).on('enter-notify-event', () => {
if (!BarVisible.value) {

View file

@ -21,6 +21,7 @@ const SPACING = 12;
export default () => BarRevealer({
anchor: ['top', 'left', 'right'],
exclusivity: 'exclusive',
transition: 'slide_down',
bar: CenterBox({
css: 'margin: 5px 5px 5px 5px',
class_name: 'bar',