ags(center-window/bigmedia): add revealer for animations(i got the previous commit's description wrong, sorry)

This commit is contained in:
retrozinndev
2025-04-10 16:38:04 -03:00
parent fbbcdf7369
commit e0cc539541
+25 -14
View File
@@ -1,10 +1,11 @@
import { Gtk, Widget } from "astal/gtk3";
import { GLib } from "astal";
import { bind, GLib } from "astal";
import { getDateTime } from "../scripts/time";
import { Separator, SeparatorProps } from "../widget/Separator";
import { PopupWindow, PopupWindowProps } from "../widget/PopupWindow";
import { BigMedia } from "../widget/center-window/BigMedia";
import AstalMpris from "gi://AstalMpris?version=0.1";
export const CenterWindow = (mon: number) => PopupWindow({
className: "center-window-container",
@@ -49,18 +50,28 @@ export const CenterWindow = (mon: number) => PopupWindow({
} as Widget.BoxProps)
]
} as Widget.BoxProps),
Separator({
orientation: Gtk.Orientation.HORIZONTAL,
alpha: .5,
cssColor: "gray",
size: 1
} as SeparatorProps),
new Widget.Box({
className: "vertical right",
orientation: Gtk.Orientation.VERTICAL,
children: [
BigMedia()
]
} as Widget.BoxProps)
new Widget.Revealer({
revealChild: bind(AstalMpris.get_default(), "players").as(players =>
players.filter(player => player.available).length > 0),
transitionDuration: 220,
transitionType: Gtk.RevealerTransitionType.SLIDE_RIGHT,
child: new Widget.Box({
children: [
Separator({
orientation: Gtk.Orientation.HORIZONTAL,
alpha: .5,
cssColor: "gray",
size: 1
} as SeparatorProps),
new Widget.Box({
className: "vertical right",
orientation: Gtk.Orientation.VERTICAL,
children: [
BigMedia()
]
} as Widget.BoxProps)
]
} as Widget.BoxProps)
} as Widget.RevealerProps)
]
} as PopupWindowProps);