💥 fix(osd): create function is implicitly ran on gnim component
This commit is contained in:
+4
-4
@@ -37,7 +37,7 @@ export class OSDMode extends GObject.Object {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const OSDModes: Record<string, () => OSDMode> = {
|
export const OSDModes = {
|
||||||
SINK: () => new OSDMode({
|
SINK: () => new OSDMode({
|
||||||
icon: createBinding(Wireplumber.getWireplumber().defaultSpeaker, "volumeIcon"),
|
icon: createBinding(Wireplumber.getWireplumber().defaultSpeaker, "volumeIcon"),
|
||||||
value: createBinding(Wireplumber.getWireplumber().defaultSpeaker, "volume"),
|
value: createBinding(Wireplumber.getWireplumber().defaultSpeaker, "volume"),
|
||||||
@@ -66,9 +66,9 @@ export const OSD = (mon: number) =>
|
|||||||
anchor={Astal.WindowAnchor.BOTTOM} focusable={false} marginBottom={80} monitor={mon}>
|
anchor={Astal.WindowAnchor.BOTTOM} focusable={false} marginBottom={80} monitor={mon}>
|
||||||
|
|
||||||
<Gtk.Box class={"osd"}>
|
<Gtk.Box class={"osd"}>
|
||||||
<With value={osdMode}>
|
<With value={osdMode(f => f)}>
|
||||||
{(modeFun: () => OSDMode) => {
|
{(_: () => OSDMode) => {
|
||||||
const mode = modeFun();
|
const mode = _ as unknown as OSDMode; // for some reason, gnim runs this function :broken_heart:
|
||||||
return <Gtk.Box>
|
return <Gtk.Box>
|
||||||
<Gtk.Image class={"icon"} iconName={
|
<Gtk.Image class={"icon"} iconName={
|
||||||
createBinding(mode, "icon")
|
createBinding(mode, "icon")
|
||||||
|
|||||||
Reference in New Issue
Block a user