less border

Less border for notification popups and menu
This commit is contained in:
2 * r + 2 * t 2025-01-13 17:38:04 +11:00
parent 9a22de4954
commit 6a66214b8f
6 changed files with 21 additions and 11 deletions

View file

@ -2,6 +2,7 @@ import { GLib, register, timeout } from "astal";
import { Astal, Gtk, Widget } from "astal/gtk3"; import { Astal, Gtk, Widget } from "astal/gtk3";
import AstalNotifd from "gi://AstalNotifd"; import AstalNotifd from "gi://AstalNotifd";
import { desktopEntrySubs } from "../utils/icons"; import { desktopEntrySubs } from "../utils/icons";
import { setupChildClickthrough } from "../utils/widgets";
const urgencyToString = (urgency: AstalNotifd.Urgency) => { const urgencyToString = (urgency: AstalNotifd.Urgency) => {
switch (urgency) { switch (urgency) {
@ -166,7 +167,7 @@ export default () => (
}); });
// Change input region to child region so can click through empty space // Change input region to child region so can click through empty space
self.connect("size-allocate", () => self.get_window()?.set_child_input_shapes()); setupChildClickthrough(self);
}} }}
/> />
</window> </window>

View file

@ -11,11 +11,7 @@ $scale: 0.068rem;
-gtk-outline-radius: s($tl) s($tr) s($br) s($bl); -gtk-outline-radius: s($tl) s($tr) s($br) s($bl);
} }
@mixin border($colour, $width: 1, $style: solid) { @mixin border($colour, $alpha: 1, $width: 1, $style: solid) {
border: s($width) $style $colour;
}
@mixin outer-border($colour, $alpha: 0.7, $width: 2, $style: solid) {
border: s($width) $style color.change($colour, $alpha: $alpha); border: s($width) $style color.change($colour, $alpha: $alpha);
} }

View file

@ -5,7 +5,7 @@
.bar { .bar {
@include lib.rounded(10, $tl: 0, $tr: 0); @include lib.rounded(10, $tl: 0, $tr: 0);
@include lib.outer-border(scheme.$rosewater); @include lib.border(scheme.$rosewater, 0.7, 2);
@include lib.spacing(10); @include lib.spacing(10);
@include font.mono; @include font.mono;

View file

@ -4,7 +4,7 @@
@use "font"; @use "font";
@mixin popup($colour) { @mixin popup($colour) {
@include lib.outer-border($colour); @include lib.border($colour, 0.5);
border-right: none; border-right: none;
@ -13,7 +13,7 @@
} }
.image { .image {
@include lib.border(color.change($colour, $alpha: 0.05)); @include lib.border($colour, 0.05);
} }
} }

View file

@ -3,6 +3,16 @@
@use "lib"; @use "lib";
@use "font"; @use "font";
* {
selection {
background-color: color.change(scheme.$overlay2, $alpha: 0.3);
}
& {
caret-color: scheme.$rosewater;
}
}
label.icon { label.icon {
@include font.icon; @include font.icon;
} }
@ -35,7 +45,7 @@ separator,
menu { menu {
@include -appear; @include -appear;
@include lib.rounded(5); @include lib.rounded(5);
@include lib.border(color.change(scheme.$blue, $alpha: 0.7), 2); @include lib.border(scheme.$blue, 0.7);
@include font.main; @include font.main;
padding: lib.s(10); padding: lib.s(10);
@ -88,7 +98,7 @@ menu {
tooltip, tooltip,
.tooltip { .tooltip {
@include lib.rounded(5); @include lib.rounded(5);
@include lib.border(color.change(scheme.$teal, $alpha: 0.7)); @include lib.border(scheme.$teal, 0.7);
@include font.reading; @include font.reading;
background-color: scheme.$surface0; background-color: scheme.$surface0;

View file

@ -43,3 +43,6 @@ export const setupCustomTooltip = (self: any, text: string | Binding<string>) =>
return window; return window;
}; };
export const setupChildClickthrough = (self: any) =>
self.connect("size-allocate", () => self.get_window()?.set_child_input_shapes());