✨ ags(center-window/bigmedia): add revealer for animations(i got the previous commit's description wrong, sorry)
This commit is contained in:
+25
-14
@@ -1,10 +1,11 @@
|
|||||||
import { Gtk, Widget } from "astal/gtk3";
|
import { Gtk, Widget } from "astal/gtk3";
|
||||||
import { GLib } from "astal";
|
import { bind, GLib } from "astal";
|
||||||
|
|
||||||
import { getDateTime } from "../scripts/time";
|
import { getDateTime } from "../scripts/time";
|
||||||
import { Separator, SeparatorProps } from "../widget/Separator";
|
import { Separator, SeparatorProps } from "../widget/Separator";
|
||||||
import { PopupWindow, PopupWindowProps } from "../widget/PopupWindow";
|
import { PopupWindow, PopupWindowProps } from "../widget/PopupWindow";
|
||||||
import { BigMedia } from "../widget/center-window/BigMedia";
|
import { BigMedia } from "../widget/center-window/BigMedia";
|
||||||
|
import AstalMpris from "gi://AstalMpris?version=0.1";
|
||||||
|
|
||||||
export const CenterWindow = (mon: number) => PopupWindow({
|
export const CenterWindow = (mon: number) => PopupWindow({
|
||||||
className: "center-window-container",
|
className: "center-window-container",
|
||||||
@@ -49,18 +50,28 @@ export const CenterWindow = (mon: number) => PopupWindow({
|
|||||||
} as Widget.BoxProps)
|
} as Widget.BoxProps)
|
||||||
]
|
]
|
||||||
} as Widget.BoxProps),
|
} as Widget.BoxProps),
|
||||||
Separator({
|
new Widget.Revealer({
|
||||||
orientation: Gtk.Orientation.HORIZONTAL,
|
revealChild: bind(AstalMpris.get_default(), "players").as(players =>
|
||||||
alpha: .5,
|
players.filter(player => player.available).length > 0),
|
||||||
cssColor: "gray",
|
transitionDuration: 220,
|
||||||
size: 1
|
transitionType: Gtk.RevealerTransitionType.SLIDE_RIGHT,
|
||||||
} as SeparatorProps),
|
child: new Widget.Box({
|
||||||
new Widget.Box({
|
children: [
|
||||||
className: "vertical right",
|
Separator({
|
||||||
orientation: Gtk.Orientation.VERTICAL,
|
orientation: Gtk.Orientation.HORIZONTAL,
|
||||||
children: [
|
alpha: .5,
|
||||||
BigMedia()
|
cssColor: "gray",
|
||||||
]
|
size: 1
|
||||||
} as Widget.BoxProps)
|
} 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);
|
} as PopupWindowProps);
|
||||||
|
|||||||
Reference in New Issue
Block a user