💥 ags(notifications): fix some history size when there's a single notification
This commit is contained in:
@@ -8,6 +8,7 @@ const i18nKeys = {
|
||||
"en_US": en_US,
|
||||
"pt_BR": pt_BR
|
||||
};
|
||||
|
||||
const languages: Array<string> = Object.keys(i18nKeys);
|
||||
let language: string = getSystemLanguage();
|
||||
|
||||
|
||||
+1
-1
@@ -193,7 +193,7 @@ scrollbar trough {
|
||||
& slider {
|
||||
@include mixins.reset-props;
|
||||
|
||||
min-width: .85em;
|
||||
min-width: .45em;
|
||||
background: colors.$bg-tertiary;
|
||||
border-radius: 12px;
|
||||
}
|
||||
|
||||
@@ -72,25 +72,8 @@ box.history {
|
||||
border-radius: 24px;
|
||||
padding: 20px 14px;
|
||||
|
||||
& scrollable viewport .notifications > eventbox {
|
||||
& > box {
|
||||
margin: 4px 0;
|
||||
}
|
||||
|
||||
&:first-child {
|
||||
& > box {
|
||||
margin-top: 0;
|
||||
}
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
& > box {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
& > .button-row {
|
||||
margin-top: 12px;
|
||||
& button {
|
||||
& label.nf {
|
||||
font-size: 16px;
|
||||
|
||||
+20
-20
@@ -1,26 +1,26 @@
|
||||
// SCSS Variables
|
||||
// Generated by 'wal'
|
||||
$wallpaper: "/home/joaov/wallpapers/Gumi VOCALOID.png";
|
||||
$wallpaper: "/home/joaov/wallpapers/Balcony Girl.png";
|
||||
|
||||
// Special
|
||||
$background: #201002;
|
||||
$foreground: #c7c3bf;
|
||||
$cursor: #c7c3bf;
|
||||
$background: #191c24;
|
||||
$foreground: #c5c6c8;
|
||||
$cursor: #c5c6c8;
|
||||
|
||||
// Colors
|
||||
$color0: #201002;
|
||||
$color1: #DDA65D;
|
||||
$color2: #F0BE55;
|
||||
$color3: #789B8A;
|
||||
$color4: #A5B397;
|
||||
$color5: #CEAD95;
|
||||
$color6: #E7D3A7;
|
||||
$color7: #98938e;
|
||||
$color8: #6e635a;
|
||||
$color9: #d2b997;
|
||||
$color10: #d4c39d;
|
||||
$color11: #83c9a7;
|
||||
$color12: #bad6a0;
|
||||
$color13: #dbc0ad;
|
||||
$color14: #e5dbc4;
|
||||
$color15: #c7c3bf;
|
||||
$color0: #191c24;
|
||||
$color1: #6F7587;
|
||||
$color2: #798C8F;
|
||||
$color3: #9E9A99;
|
||||
$color4: #C9B196;
|
||||
$color5: #D1BAAA;
|
||||
$color6: #DBC7A5;
|
||||
$color7: #94969e;
|
||||
$color8: #616777;
|
||||
$color9: #7486c3;
|
||||
$color10: #7dbac7;
|
||||
$color11: #d2a495;
|
||||
$color12: #dac4ab;
|
||||
$color13: #e1cab9;
|
||||
$color14: #e2d4bc;
|
||||
$color15: #c5c6c8;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { Astal, Gtk, Widget } from "astal/gtk3";
|
||||
import AstalNotifd from "gi://AstalNotifd";
|
||||
import { Separator } from "./Separator";
|
||||
import Pango from "gi://Pango";
|
||||
import { HistoryNotification } from "../scripts/notifications";
|
||||
import { GLib } from "astal";
|
||||
|
||||
@@ -119,7 +118,6 @@ export function NotificationWidget(notification: AstalNotifd.Notification|number
|
||||
xalign: 0,
|
||||
truncate: false,
|
||||
wrap: true,
|
||||
wrapMode: Pango.WrapMode.WORD,
|
||||
label: notification.body.replace(/\&/g, "&")
|
||||
} as Widget.LabelProps)
|
||||
]
|
||||
|
||||
@@ -7,20 +7,26 @@ import { NotificationWidget } from "../Notification";
|
||||
export const NotifHistory: Gtk.Widget = new Widget.Box({
|
||||
orientation: Gtk.Orientation.VERTICAL,
|
||||
className: "history",
|
||||
expand: true,
|
||||
visible: bind(Notifications.getDefault(), "history").as(history => history.length > 0),
|
||||
children: [
|
||||
new Widget.Scrollable({
|
||||
className: "history",
|
||||
hscroll: Gtk.PolicyType.NEVER,
|
||||
vscroll: Gtk.PolicyType.AUTOMATIC,
|
||||
expand: true,
|
||||
visible: bind(Notifications.getDefault(), "history").as(history => history.length > 0),
|
||||
propagateNaturalHeight: true,
|
||||
propagateNaturalWidth: false,
|
||||
onDraw: (scrollable) => {
|
||||
scrollable.minContentHeight =
|
||||
((scrollable.get_child()! as Gtk.Viewport).get_child() as Widget.Box).get_children()?.[0].get_allocation().height || 0;
|
||||
},
|
||||
child: new Widget.Box({
|
||||
className: "notifications",
|
||||
hexpand: true,
|
||||
orientation: Gtk.Orientation.VERTICAL,
|
||||
homogeneous: false,
|
||||
spacing: 4,
|
||||
valign: Gtk.Align.START,
|
||||
children: bind(Notifications.getDefault(), "history").as((history: Array<HistoryNotification>) =>
|
||||
history.map((notification: HistoryNotification) => NotificationWidget(notification,
|
||||
() => Notifications.getDefault().removeHistory(notification.id))
|
||||
|
||||
Reference in New Issue
Block a user