From 737d712383d2f3dfea5dceb833795b373df76079 Mon Sep 17 00:00:00 2001 From: S4NKALP Date: Tue, 4 Feb 2025 19:39:50 +0545 Subject: [PATCH] corner added --- config/modus/main.py | 2 ++ config/modus/modules/corners.py | 64 +++++++++++++++++++++++++++++++++ config/modus/styles/main.css | 12 ++++++- 3 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 config/modus/modules/corners.py diff --git a/config/modus/main.py b/config/modus/main.py index a4cfef51..56baf289 100644 --- a/config/modus/main.py +++ b/config/modus/main.py @@ -9,6 +9,7 @@ from modules.bar.bar import Bar from modules.launcher.launcher import Launcher from modules.notification_popup import NotificationPopup from modules.osd import OSDContainer +from modules.corners import Corners from services import sc for log in [ @@ -43,6 +44,7 @@ if __name__ == "__main__": update_main_css() sc = sc bar = Bar() + corners = Corners() osd = OSDContainer() notif = NotificationPopup() launcher = Launcher() diff --git a/config/modus/modules/corners.py b/config/modus/modules/corners.py new file mode 100644 index 00000000..10ce26d3 --- /dev/null +++ b/config/modus/modules/corners.py @@ -0,0 +1,64 @@ +from fabric.widgets.box import Box +from fabric.widgets.wayland import WaylandWindow as Window +from fabric.widgets.shapes import Corner + + +class MyCorner(Box): + def __init__(self, corner): + super().__init__( + name="corner-container", + children=Corner( + name="corner", + orientation=corner, + size=20, + ), + ) + + +class Corners(Window): + def __init__(self): + super().__init__( + name="corners", + layer="top", + anchor="top bottom left right", + exclusivity="normal", + pass_through=True, + visible=False, + all_visible=False, + ) + + self.all_corners = Box( + name="all-corners", + orientation="v", + h_expand=True, + v_expand=True, + h_align="fill", + v_align="fill", + children=[ + Box( + name="top-corners", + orientation="h", + h_align="fill", + children=[ + MyCorner("top-left"), + Box(h_expand=True), + MyCorner("top-right"), + ], + ), + Box(v_expand=True), + Box( + name="bottom-corners", + orientation="h", + h_align="fill", + children=[ + MyCorner("bottom-left"), + Box(h_expand=True), + MyCorner("bottom-right"), + ], + ), + ], + ) + + self.add(self.all_corners) + + self.show_all() diff --git a/config/modus/styles/main.css b/config/modus/styles/main.css index 77fa29cd..8ce90039 100644 --- a/config/modus/styles/main.css +++ b/config/modus/styles/main.css @@ -1,4 +1,4 @@ -@import url(../../../.cache/material/colors.css); +@import url(../../.cache/material/colors.css); @import "./bar.css"; @import "./notification.css"; @import "./osd.css"; @@ -12,6 +12,16 @@ sans-serif; } +#corner { + background-color: @surface; + border-radius: 0; +} + +#corner-container { + min-width: 20px; + min-height: 20px; +} + /* * ── tooltip ─────────────────────────────────────────────────────────── */