aboutsummaryrefslogtreecommitdiff
path: root/ags/widget
diff options
context:
space:
mode:
authoreric.marin <maarin.eric@gmail.com>2024-12-26 14:33:06 +0100
committereric.marin <maarin.eric@gmail.com>2024-12-30 21:07:42 +0100
commit4de5a217c25fe83bb54063f8d842b78c9e6d7fb3 (patch)
tree0460bc0600492324f111524dfdff1ef85c9fbf8e /ags/widget
parentee2b01a3fff043a8b977385227c2659bbcf2e59a (diff)
downloaddotfiles-4de5a217c25fe83bb54063f8d842b78c9e6d7fb3.tar.gz
dotfiles-4de5a217c25fe83bb54063f8d842b78c9e6d7fb3.zip
wallust
Diffstat (limited to 'ags/widget')
-rw-r--r--ags/widget/Bar.tsx53
1 files changed, 53 insertions, 0 deletions
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>
+}