Commit 3bc69933 authored by Erik Reider's avatar Erik Reider

Fixed notification app icon pixel size sometimes being zero instead of -1

parent 15e86473
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
--bg-selected: rgb(0, 128, 255); --bg-selected: rgb(0, 128, 255);
--notification-icon-size: 64px; --notification-icon-size: 64px;
--notification-app-icon-size: var(--notification-icon-size) / 3; --notification-app-icon-size: calc(var(--notification-icon-size) / 3);
--notification-group-icon-size: 32px; --notification-group-icon-size: 32px;
} }
......
...@@ -53,7 +53,6 @@ template $SwayNotificationCenterNotification: Box { ...@@ -53,7 +53,6 @@ template $SwayNotificationCenterNotification: Box {
valign: center; valign: center;
child: Image img { child: Image img {
// pixel-size: 48;
valign: center; valign: center;
overflow: hidden; overflow: hidden;
...@@ -64,7 +63,6 @@ template $SwayNotificationCenterNotification: Box { ...@@ -64,7 +63,6 @@ template $SwayNotificationCenterNotification: Box {
[overlay] [overlay]
Image img_app_icon { Image img_app_icon {
// pixel-size: 48;
halign: end; halign: end;
valign: end; valign: end;
overflow: hidden; overflow: hidden;
......
...@@ -695,10 +695,16 @@ namespace SwayNotificationCenter { ...@@ -695,10 +695,16 @@ namespace SwayNotificationCenter {
} }
int notification_icon_size = ConfigModel.instance.notification_icon_size.clamp (-1, int.MAX); int notification_icon_size = ConfigModel.instance.notification_icon_size.clamp (-1, int.MAX);
if (notification_icon_size < 1) {
notification_icon_size = -1;
}
img.set_pixel_size (notification_icon_size); img.set_pixel_size (notification_icon_size);
img.height_request = notification_icon_size; img.height_request = notification_icon_size;
img.width_request = notification_icon_size; img.width_request = notification_icon_size;
int app_icon_size = (notification_icon_size / 3).clamp (-1, int.MAX); int app_icon_size = (notification_icon_size / 3).clamp (-1, int.MAX);
if (app_icon_size < 1) {
app_icon_size = -1;
}
img_app_icon.set_pixel_size (app_icon_size); img_app_icon.set_pixel_size (app_icon_size);
bool img_path_is_theme_icon = false; bool img_path_is_theme_icon = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment