Updated default style of notifications and control center

This commit is contained in:
Erik Reider
2023-12-15 15:41:23 +01:00
parent f68dfa4254
commit b07a296bf8
2 changed files with 114 additions and 63 deletions

View File

@@ -1,9 +1,11 @@
@define-color cc-bg rgba(0, 0, 0, 0.7); @define-color cc-bg rgba(0, 0, 0, 0.7);
@define-color noti-border-color rgba(255, 255, 255, 0.15); @define-color noti-border-color rgba(255, 255, 255, 0.15);
@define-color noti-bg rgb(48, 48, 48); @define-color noti-bg rgba(48, 48, 48, 0.8);
@define-color noti-bg-opaque rgb(48, 48, 48);
@define-color noti-bg-darker rgb(38, 38, 38); @define-color noti-bg-darker rgb(38, 38, 38);
@define-color noti-bg-hover rgb(56, 56, 56); @define-color noti-bg-hover rgb(56, 56, 56);
@define-color noti-bg-hover-opaque rgb(56, 56, 56);
@define-color noti-bg-focus rgba(68, 68, 68, 0.6); @define-color noti-bg-focus rgba(68, 68, 68, 0.6);
@define-color noti-close-bg rgba(255, 255, 255, 0.1); @define-color noti-close-bg rgba(255, 255, 255, 0.1);
@define-color noti-close-bg-hover rgba(255, 255, 255, 0.15); @define-color noti-close-bg-hover rgba(255, 255, 255, 0.15);
@@ -13,6 +15,18 @@
@define-color bg-selected rgb(0, 128, 255); @define-color bg-selected rgb(0, 128, 255);
$border: 1px solid #{"@noti-border-color"};
$border-radius: 12px;
$font-size-body: 15px;
$font-size-summary: 16px;
$hover-tranistion: background 0.15s ease-in-out;
$group-collapse-tranistion: opacity 400ms ease-in-out;
$notification-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3),
0 1px 3px 1px rgba(0, 0, 0, 0.7), 0 2px 6px 2px rgba(0, 0, 0, 0.3);
.notification-row { .notification-row {
outline: none; outline: none;
@@ -21,6 +35,8 @@
background: #{"@noti-bg-focus"}; background: #{"@noti-bg-focus"};
} }
.notification-background { .notification-background {
padding: 6px 12px;
.close-button { .close-button {
/* The notification Close Button */ /* The notification Close Button */
background: #{"@noti-close-bg"}; background: #{"@noti-close-bg"};
@@ -28,8 +44,9 @@
text-shadow: none; text-shadow: none;
padding: 0; padding: 0;
border-radius: 100%; border-radius: 100%;
margin-top: 10px; $margin: 6px;
margin-right: 16px; margin-top: $margin;
margin-right: $margin;
box-shadow: none; box-shadow: none;
border: none; border: none;
min-width: 24px; min-width: 24px;
@@ -38,18 +55,18 @@
&:hover { &:hover {
box-shadow: none; box-shadow: none;
background: #{"@noti-close-bg-hover"}; background: #{"@noti-close-bg-hover"};
transition: all 0.15s ease-in-out; transition: $hover-tranistion;
border: none; border: none;
} }
} }
.notification { .notification {
/* The actual notification */ /* The actual notification */
border-radius: 12px; border-radius: $border-radius;
margin: 6px 12px; border: $border;
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3), 0 1px 3px 1px rgba(0, 0, 0, 0.7),
0 2px 6px 2px rgba(0, 0, 0, 0.3);
padding: 0; padding: 0;
transition: $hover-tranistion;
background: #{"@noti-bg"};
&.low { &.low {
/* Low Priority Notification */ /* Low Priority Notification */
@@ -65,10 +82,10 @@
padding: 4px; padding: 4px;
margin: 0; margin: 0;
box-shadow: none; box-shadow: none;
background: #{"@noti-bg"}; background: transparent;
border: 1px solid #{"@noti-border-color"}; border: none;
color: #{"@text-color"}; color: #{"@text-color"};
transition: all 0.15s ease-in-out; transition: $hover-tranistion;
} }
%action-hover { %action-hover {
-gtk-icon-effect: none; -gtk-icon-effect: none;
@@ -78,7 +95,7 @@
.notification-default-action { .notification-default-action {
/* The large action that also displays the notification summary and body */ /* The large action that also displays the notification summary and body */
@extend %action; @extend %action;
border-radius: 12px; border-radius: $border-radius;
&:hover { &:hover {
@extend %action-hover; @extend %action-hover;
@@ -92,38 +109,44 @@
.notification-content { .notification-content {
background: transparent; background: transparent;
padding: 6px; $padding: 6px;
border-radius: 12px; padding: $padding;
border-radius: $border-radius;
.image { .image {
/* Notification Primary Image */ /* Notification Primary Image */
-gtk-icon-effect: none; -gtk-icon-effect: none;
border-radius: 10px; /* Size in px */ border-radius: 100px; /* Size in px */
margin: 4px;
} }
.summary {
/* Notification summary/title */ .text-box {
font-size: 16px; margin: 0 8px;
font-weight: bold; .summary {
background: transparent; /* Notification summary/title */
color: #{"@text-color"}; font-size: $font-size-summary;
text-shadow: none; font-weight: bold;
} background: transparent;
.time { color: #{"@text-color"};
/* Notification time-ago */ text-shadow: none;
font-size: 16px; }
font-weight: bold; .time {
background: transparent; /* Notification time-ago */
color: #{"@text-color"}; font-size: $font-size-summary;
text-shadow: none; font-weight: bold;
margin-right: 18px; background: transparent;
} color: #{"@text-color"};
.body { text-shadow: none;
/* Notification body */ margin-right: 24px;
font-size: 15px; }
font-weight: normal; .body {
background: transparent; /* Notification body */
color: #{"@text-color"}; font-size: $font-size-body;
text-shadow: none; font-weight: normal;
background: transparent;
color: #{"@text-color"};
text-shadow: none;
}
} }
progressbar { progressbar {
@@ -134,7 +157,8 @@
/* The "extra" optional bottom notification image */ /* The "extra" optional bottom notification image */
margin-top: 6px; margin-top: 6px;
background-color: white; background-color: white;
border-radius: 12px; border-radius: $border-radius;
-gtk-icon-effect: none;
} }
.inline-reply { .inline-reply {
@@ -145,20 +169,21 @@
background: #{"@noti-bg-darker"}; background: #{"@noti-bg-darker"};
color: #{"@text-color"}; color: #{"@text-color"};
caret-color: #{"@text-color"}; caret-color: #{"@text-color"};
border: 1px solid #{"@noti-border-color"}; border: $border;
border-radius: 12px; border-radius: $border-radius;
} }
.inline-reply-button { .inline-reply-button {
margin-left: 4px; margin-left: 4px;
background: #{"@noti-bg"}; background: #{"@noti-bg"};
border: 1px solid #{"@noti-border-color"}; border: $border;
border-radius: 12px; border-radius: $border-radius;
color: #{"@text-color"}; color: #{"@text-color"};
&:disabled { &:disabled {
background: initial; background: initial;
color: #{"@text-color-disabled"}; color: #{"@text-color-disabled"};
border: 1px solid transparent; border: $border;
border-color: transparent;
} }
&:hover { &:hover {
background: #{"@noti-bg-hover"}; background: #{"@noti-bg-hover"};
@@ -169,19 +194,19 @@
} }
.notification-action { .notification-action {
/* The sub actions below the default action */ /* The alternative actions below the default action */
@extend %action; @extend %action;
border-top: $border;
border-radius: 0px; border-radius: 0px;
border-top: none; border-right: $border;
border-right: none;
&:first-child { &:first-child {
/* add bottom border radius to eliminate clipping */ /* add bottom border radius to eliminate clipping */
border-bottom-left-radius: 10px; border-bottom-left-radius: $border-radius;
} }
&:last-child { &:last-child {
border-bottom-right-radius: 10px; border-bottom-right-radius: $border-radius;
border-right: 1px solid #{"@noti-border-color"}; border-right: none;
} }
&:hover { &:hover {
@@ -227,20 +252,26 @@
} }
&.collapsed { &.collapsed {
/* Set lower stacked notifications opacity to 0 */ .notification-row {
.notification-row:not(:last-child) { .notification {
/* Top notification in stack */ background-color: #{"@noti-bg-opaque"};
.notification-action *, }
.notification-default-action * {
transition: opacity 400ms ease-in-out; &:not(:last-child) {
opacity: 0; /* Top notification in stack */
/* Set lower stacked notifications opacity to 0 */
.notification-action,
.notification-default-action {
opacity: 0;
}
} }
} }
&:hover { &:hover {
.notification-default-action, .notification-row:not(:only-child) {
.notification-action { .notification {
background-color: #{"@noti-bg-hover"}; background-color: #{"@noti-bg-hover-opaque"};
}
} }
} }
} }
@@ -249,6 +280,7 @@
.control-center { .control-center {
/* The Control Center which contains the old notifications + widgets */ /* The Control Center which contains the old notifications + widgets */
background: #{"@cc-bg"}; background: #{"@cc-bg"};
border-radius: $border-radius;
.control-center-list-placeholder { .control-center-list-placeholder {
/* The placeholder when there are no notifications */ /* The placeholder when there are no notifications */
@@ -258,16 +290,33 @@
.control-center-list { .control-center-list {
/* List of notifications */ /* List of notifications */
background: transparent; background: transparent;
.notification {
box-shadow: $notification-shadow;
.notification-default-action,
.notification-action {
transition: $group-collapse-tranistion, $hover-tranistion;
&:hover {
background-color: #{"@noti-bg-hover"};
}
}
}
} }
} }
.blank-window { .blank-window {
/* Window behind control center and on all other monitors */ /* Window behind control center and on all other monitors */
background: #{"alpha(black, 0.25)"}; background: transparent;
} }
.floating-notifications { .floating-notifications {
background: transparent; background: transparent;
.notification {
box-shadow: none;
}
} }
/*** Widgets ***/ /*** Widgets ***/

View File

@@ -81,7 +81,6 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="valign">center</property> <property name="valign">center</property>
<property name="margin-end">14</property>
<property name="hexpand">True</property> <property name="hexpand">True</property>
<property name="vexpand">True</property> <property name="vexpand">True</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
@@ -153,6 +152,9 @@
<property name="position">1</property> <property name="position">1</property>
</packing> </packing>
</child> </child>
<style>
<class name="text-box"/>
</style>
</object> </object>
<packing> <packing>
<property name="expand">True</property> <property name="expand">True</property>