💥 ags(center-window): fix big-media widget being cut because of the revealer

This commit is contained in:
retrozinndev
2025-04-23 18:28:50 -03:00
parent 9c0aca3983
commit cd96236878
2 changed files with 13 additions and 24 deletions
+3 -14
View File
@@ -5,7 +5,7 @@ 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"; import AstalMpris from "gi://AstalMpris";
export const CenterWindow = (mon: number) => PopupWindow({ export const CenterWindow = (mon: number) => PopupWindow({
namespace: "center-window", namespace: "center-window",
@@ -50,29 +50,18 @@ export const CenterWindow = (mon: number) => PopupWindow({
} as Widget.BoxProps) } as Widget.BoxProps)
] ]
} as Widget.BoxProps), } 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({ Separator({
orientation: Gtk.Orientation.HORIZONTAL, orientation: Gtk.Orientation.HORIZONTAL,
alpha: .5, alpha: .5,
cssColor: "gray", cssColor: "gray",
visible: bind(AstalMpris.get_default(), "players").as(players => players.length > 0),
size: 1 size: 1
} as SeparatorProps), } as SeparatorProps),
new Widget.Box({ new Widget.Box({
className: "vertical right", className: "vertical right",
orientation: Gtk.Orientation.VERTICAL, orientation: Gtk.Orientation.VERTICAL,
children: [ child: BigMedia()
BigMedia()
]
} as Widget.BoxProps) } as Widget.BoxProps)
] ]
} as Widget.BoxProps) } as Widget.BoxProps)
} as Widget.RevealerProps)
]
} as Widget.BoxProps)
} as PopupWindowProps); } as PopupWindowProps);
View File