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 { Gdk, Gtk } from "astal/gtk4";
|
||||
import { Gdk } from "astal/gtk4";
|
||||
import AstalTray from "gi://AstalTray";
|
||||
|
||||
const Tray = function () {
|
||||
|
|
@ -7,10 +7,6 @@ const Tray = function () {
|
|||
|
||||
const trayItems = bind(tray, "items");
|
||||
|
||||
function OpenTrayItem(button: Gtk.MenuButton, item: AstalTray.TrayItem) {
|
||||
item.about_to_show();
|
||||
}
|
||||
|
||||
return (
|
||||
<box cssClasses={["Tray"]}>
|
||||
{trayItems.as((items) =>
|
||||
|
|
@ -18,8 +14,10 @@ const Tray = function () {
|
|||
return (
|
||||
<menubutton cursor={Gdk.Cursor.new_from_name("pointer", null)}>
|
||||
<image
|
||||
tooltip_text={item.title || item.tooltip.title}
|
||||
file={item.iconName || "NONE"}
|
||||
tooltip_text={bind(item, "tooltip_markup")}
|
||||
file={bind(item, "icon_name").as(
|
||||
(iconName) => iconName || "NONE",
|
||||
)}
|
||||
/>
|
||||
</menubutton>
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue