use bindings
This commit is contained in:
parent
98a3b5381e
commit
ecc664bcaf
1 changed files with 5 additions and 7 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
import { bind } from "astal";
|
import { bind } from "astal";
|
||||||
import { Gdk, Gtk } from "astal/gtk4";
|
import { Gdk } from "astal/gtk4";
|
||||||
import AstalTray from "gi://AstalTray";
|
import AstalTray from "gi://AstalTray";
|
||||||
|
|
||||||
const Tray = function () {
|
const Tray = function () {
|
||||||
|
|
@ -7,10 +7,6 @@ const Tray = function () {
|
||||||
|
|
||||||
const trayItems = bind(tray, "items");
|
const trayItems = bind(tray, "items");
|
||||||
|
|
||||||
function OpenTrayItem(button: Gtk.MenuButton, item: AstalTray.TrayItem) {
|
|
||||||
item.about_to_show();
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<box cssClasses={["Tray"]}>
|
<box cssClasses={["Tray"]}>
|
||||||
{trayItems.as((items) =>
|
{trayItems.as((items) =>
|
||||||
|
|
@ -18,8 +14,10 @@ const Tray = function () {
|
||||||
return (
|
return (
|
||||||
<menubutton cursor={Gdk.Cursor.new_from_name("pointer", null)}>
|
<menubutton cursor={Gdk.Cursor.new_from_name("pointer", null)}>
|
||||||
<image
|
<image
|
||||||
tooltip_text={item.title || item.tooltip.title}
|
tooltip_text={bind(item, "tooltip_markup")}
|
||||||
file={item.iconName || "NONE"}
|
file={bind(item, "icon_name").as(
|
||||||
|
(iconName) => iconName || "NONE",
|
||||||
|
)}
|
||||||
/>
|
/>
|
||||||
</menubutton>
|
</menubutton>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue