From 8fab7d4b65cd16769d3ef48e44da3f8ed75582ed Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Mon, 31 Mar 2025 23:02:52 +1100 Subject: feat: fake screen rounding --- app.tsx | 2 + scss/common.scss | 6 +++ src/modules/bar.tsx | 121 ++++++++++++++++++++++++------------------ src/modules/screencorners.tsx | 24 +++++++++ src/widgets/screencorner.tsx | 49 +++++++++++++++++ 5 files changed, 150 insertions(+), 52 deletions(-) create mode 100644 src/modules/screencorners.tsx create mode 100644 src/widgets/screencorner.tsx diff --git a/app.tsx b/app.tsx index 23f4be9..35a522c 100644 --- a/app.tsx +++ b/app.tsx @@ -2,6 +2,7 @@ import Bar from "@/modules/bar"; import Launcher from "@/modules/launcher"; import NotifPopups from "@/modules/notifpopups"; import Osds from "@/modules/osds"; +import ScreenCorners from "@/modules/screencorners"; import Session from "@/modules/session"; import SideBar from "@/modules/sidebar"; import Calendar from "@/services/calendar"; @@ -75,6 +76,7 @@ App.start({ ; Monitors.get_default().forEach(m => ); Monitors.get_default().forEach(m => ); + Monitors.get_default().forEach(m => ); // Init services timeout(1000, () => { diff --git a/scss/common.scss b/scss/common.scss index 1cf7249..de9f424 100644 --- a/scss/common.scss +++ b/scss/common.scss @@ -6,6 +6,12 @@ label.icon { @include font.icon; } +.screen-corner { + @include lib.rounded(15); + + background-color: scheme.$mantle; +} + .notification { .inner { @include lib.rounded(8); diff --git a/src/modules/bar.tsx b/src/modules/bar.tsx index 995d3a3..29f4f88 100644 --- a/src/modules/bar.tsx +++ b/src/modules/bar.tsx @@ -8,6 +8,7 @@ import { bindCurrentTime, osIcon } from "@/utils/system"; import type { AstalWidget } from "@/utils/types"; import { setupCustomTooltip } from "@/utils/widgets"; import type PopupWindow from "@/widgets/popupwindow"; +import ScreenCorner from "@/widgets/screencorner"; import { execAsync, Variable } from "astal"; import Binding, { bind, kebabify } from "astal/binding"; import { App, Astal, Gtk } from "astal/gtk3"; @@ -560,63 +561,79 @@ const bindWidget = (module: keyof typeof config.modules, Widget: () => JSX.Eleme const bindCompositeWidget = (module: keyof typeof config.modules, binding: Binding) => bind(Variable.derive([config.modules[module].enabled, binding], (e, w) => (e ? w : ))); -export default ({ monitor }: { monitor: Monitor }) => { +const Bar = ({ monitor }: { monitor: Monitor }) => { const className = Variable.derive( [bind(config.vertical), bind(config.style)], (v, s) => `bar ${v ? "vertical" : " horizontal"} ${s}` ); return ( - - Astal.WindowAnchor.TOP | - Astal.WindowAnchor.LEFT | - (v ? Astal.WindowAnchor.BOTTOM : Astal.WindowAnchor.RIGHT) - )} - exclusivity={Astal.Exclusivity.EXCLUSIVE} - > - className.drop()}> - - {bindWidget("osIcon", OSIcon)} - {bindWidget("activeWindow", ActiveWindow)} - {bindWidget("mediaPlaying", MediaPlaying)} -