From 70268f0a58537699fd44f1863b6a5174c4a6e8c3 Mon Sep 17 00:00:00 2001 From: Joshua Yuen Date: Sat, 12 Sep 2026 15:01:46 -0400 Subject: [PATCH] Restyle AGS bar as filled full-width bar with inverse corners --- modules/home/ags/app/style.scss | 13 ++- modules/home/ags/app/widget/Bar.tsx | 83 ++++++++++++++----- modules/home/ags/app/widget/Notifications.tsx | 2 +- 3 files changed, 73 insertions(+), 25 deletions(-) diff --git a/modules/home/ags/app/style.scss b/modules/home/ags/app/style.scss index f8ced17..51c195f 100644 --- a/modules/home/ags/app/style.scss +++ b/modules/home/ags/app/style.scss @@ -1,5 +1,7 @@ @use "palette" as *; +$radius: 12px; + * { all: unset; font-family: $font-family; @@ -13,12 +15,19 @@ .bar { background: $base01; - border-radius: 10px; - margin: 8px; padding: 4px 12px; color: $base05; } +.bar-corners { + background: transparent; +} + +.corner { + background: transparent; + color: $base01; +} + .ws { min-width: 20px; border-radius: 6px; diff --git a/modules/home/ags/app/widget/Bar.tsx b/modules/home/ags/app/widget/Bar.tsx index 0cb1396..8e37273 100644 --- a/modules/home/ags/app/widget/Bar.tsx +++ b/modules/home/ags/app/widget/Bar.tsx @@ -6,6 +6,38 @@ import { WifiWidget } from "./Wifi" import { BatteryWidget } from "./Battery" import { PowerWidget } from "./Power" +const RADIUS = 12 + +// paints the concave sliver below the bar at the screen edge: the r x r +// square minus the quarter disk where the wallpaper shows through +function Corner({ side }: { side: "left" | "right" }) { + return ( + { + const w = self.get_allocated_width() + const h = self.get_allocated_height() + const c = self.get_style_context().get_color(Gtk.StateFlags.NORMAL) + cr.setSourceRGBA(c.red, c.green, c.blue, c.alpha) + if (side === "left") { + cr.moveTo(0, 0) + cr.lineTo(w, 0) + cr.arcNegative(w, h, w, -Math.PI / 2, -Math.PI) + } else { + cr.moveTo(w, 0) + cr.lineTo(0, 0) + cr.arc(0, h, w, -Math.PI / 2, 0) + } + cr.closePath() + cr.fill() + }} + /> + ) +} + export default function Bar(gdkmonitor: Gdk.Monitor) { const { TOP, LEFT, RIGHT } = Astal.WindowAnchor const volume = VolumeWidget(gdkmonitor) @@ -35,29 +67,36 @@ export default function Bar(gdkmonitor: Gdk.Monitor) { anchor={TOP | LEFT | RIGHT} application={App} > - - - + + + + + + + + + + {right} + + + + + + - - - - - {right} - - + ), ...popups, diff --git a/modules/home/ags/app/widget/Notifications.tsx b/modules/home/ags/app/widget/Notifications.tsx index a60281c..07242fe 100644 --- a/modules/home/ags/app/widget/Notifications.tsx +++ b/modules/home/ags/app/widget/Notifications.tsx @@ -112,7 +112,7 @@ export default function Notifications(gdkmonitor: Gdk.Monitor) { anchor={TOP | RIGHT} exclusivity={Astal.Exclusivity.IGNORE} keymode={Astal.Keymode.NONE} - marginTop={48} + marginTop={54} marginRight={8} visible={bind(notifd, "notifications").as((ns) => ns.length > 0)} >