From 4de5a217c25fe83bb54063f8d842b78c9e6d7fb3 Mon Sep 17 00:00:00 2001
From: "eric.marin" <maarin.eric@gmail.com>
Date: Thu, 26 Dec 2024 14:33:06 +0100
Subject: wallust

---
 ags/widget/Bar.tsx | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 53 insertions(+)
 create mode 100644 ags/widget/Bar.tsx

(limited to 'ags/widget/Bar.tsx')

diff --git a/ags/widget/Bar.tsx b/ags/widget/Bar.tsx
new file mode 100644
index 0000000..d994797
--- /dev/null
+++ b/ags/widget/Bar.tsx
@@ -0,0 +1,53 @@
+import { App, Astal, Gtk, Gdk, Widget } from "astal/gtk3"
+import { Variable } from "astal"
+import { BoxProps, CenterBoxProps } from "astal/gtk3/widget"
+
+const { TOP, LEFT, RIGHT, BOTTOM } = Astal.WindowAnchor
+const { START, CENTER, END } = Gtk.Align
+
+const time = Variable("").poll(1000, "date")
+
+function VerticalCenterBox(props: CenterBoxProps) {
+  return <centerbox
+    {...props}
+    vertical
+  />
+}
+
+function VerticalBox(props: BoxProps) {
+  return <box
+    {...props}
+    vertical
+  />
+}
+
+export default function Bar(gdkmonitor: Gdk.Monitor) {
+  return <window
+    name="Bar"
+    className="Bar"
+    gdkmonitor={gdkmonitor}
+    exclusivity={Astal.Exclusivity.EXCLUSIVE}
+    anchor={TOP | LEFT | BOTTOM}
+    application={App}>
+    <VerticalCenterBox>
+      <button
+        onClicked="echo hello"
+        halign={CENTER}
+        valign={START}
+      >
+        Welcome to AGS!
+      </button>
+      <VerticalBox>
+        <label>CIAO</label>
+        <label>CIAO</label>
+      </VerticalBox>
+      <button
+        onClicked={() => print("hello")}
+        halign={CENTER}
+        valign={END}
+      >
+        <label label={time()} />
+      </button>
+    </VerticalCenterBox>
+  </window>
+}
-- 
cgit v1.2.3

