🔧 chore(bar/apps, bar/focused-client): use onClicked prop instead of connecting to signal, fix str being null sometimes
This commit is contained in:
@@ -6,11 +6,7 @@ import { tr } from "../../i18n/intl";
|
|||||||
export const Apps = () =>
|
export const Apps = () =>
|
||||||
<Gtk.Button class={createBinding(Windows.getDefault(), "openWindows").as((openWindows) =>
|
<Gtk.Button class={createBinding(Windows.getDefault(), "openWindows").as((openWindows) =>
|
||||||
`apps ${Object.hasOwn(openWindows, "apps-window") ? "open" : ""}`
|
`apps ${Object.hasOwn(openWindows, "apps-window") ? "open" : ""}`
|
||||||
)} $={(self) => {
|
)} iconName={"applications-other-symbolic"} halign={Gtk.Align.CENTER}
|
||||||
const conns: Array<number> = [
|
hexpand tooltipText={tr("apps")} onClicked={() =>
|
||||||
self.connect("clicked", (_) => Windows.getDefault().open("apps-window")),
|
Windows.getDefault().open("apps-window")}
|
||||||
self.connect("destroy", (_) => conns.forEach(id => self.disconnect(id)))
|
|
||||||
];
|
|
||||||
}} iconName={"applications-other-symbolic"} halign={Gtk.Align.CENTER}
|
|
||||||
hexpand={true} tooltipText={tr("apps")}
|
|
||||||
/>;
|
/>;
|
||||||
|
|||||||
Reference in New Issue
Block a user