From ddf4f659b541bfa2b15c3028b2d51cf9f0e3a489 Mon Sep 17 00:00:00 2001 From: retrozinndev Date: Wed, 23 Apr 2025 14:21:20 -0300 Subject: [PATCH] :boom: ags(control-center/mixer): get application icon by stream name --- ags/style/_control-center.scss | 4 ++++ ags/widget/control-center/Pages.ts | 2 +- ags/widget/control-center/pages/Mixer.ts | 14 +++----------- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/ags/style/_control-center.scss b/ags/style/_control-center.scss index 02886c2..913fe4a 100644 --- a/ags/style/_control-center.scss +++ b/ags/style/_control-center.scss @@ -72,6 +72,10 @@ } & .page .content { + & > eventbox > box { + margin: 6px 0; + } + & label.name { font-size: 14px; font-weight: 500; diff --git a/ags/widget/control-center/Pages.ts b/ags/widget/control-center/Pages.ts index 18bab9f..1d20009 100644 --- a/ags/widget/control-center/Pages.ts +++ b/ags/widget/control-center/Pages.ts @@ -69,7 +69,7 @@ class Pages extends Widget.Revealer { close(onClosed?: () => void): void { if(!this.isOpen) return; - this.set_reveal_child(false); + this.revealChild = false; timeout(this.transitionDuration, () => { this.remove(this.#page!); this.page = undefined; diff --git a/ags/widget/control-center/pages/Mixer.ts b/ags/widget/control-center/pages/Mixer.ts index 22a0ec5..8662d36 100644 --- a/ags/widget/control-center/pages/Mixer.ts +++ b/ags/widget/control-center/pages/Mixer.ts @@ -21,7 +21,7 @@ export function PageMixer(): Page { orientation: Gtk.Orientation.HORIZONTAL, children: [ new Widget.Icon({ - icon: getStreamIcon(ep) ?? "application-x-executable-symbolic", + icon: getAppIcon(ep.name.split(' ')[0]) || "application-x-executable-symbolic", css: "font-size: 18px; margin-right: 6px;" } as Widget.IconProps), new Widget.Box({ @@ -38,6 +38,8 @@ export function PageMixer(): Page { onDestroy: () => connections.map(id => eventbox.disconnect(id)), child: new Widget.Label({ label: ep.name || "Unknown", + truncate: true, + tooltipText: ep.name, className: "name", xalign: 0 } as Widget.LabelProps) @@ -60,13 +62,3 @@ export function PageMixer(): Page { ]) } as PageProps); } - -function getStreamIcon(endpoint: AstalWp.Endpoint): (string|undefined) { - let icon = getAppIcon(endpoint.icon); - if(icon) return icon; - - icon = getAppIcon(endpoint.name.split(' ')[0]); - if(icon) return icon; - - return undefined; -}