Skip to content

Commit

Permalink
Updated default style of notifications and control center
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikReider committed Dec 15, 2023
1 parent f68dfa4 commit a669d1a
Show file tree
Hide file tree
Showing 2 changed files with 114 additions and 62 deletions.
172 changes: 111 additions & 61 deletions data/style/style.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
@define-color cc-bg rgba(0, 0, 0, 0.7);

@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-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-close-bg rgba(255, 255, 255, 0.1);
@define-color noti-close-bg-hover rgba(255, 255, 255, 0.15);
Expand All @@ -13,6 +15,18 @@

@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 {
outline: none;

Expand All @@ -21,15 +35,18 @@
background: #{"@noti-bg-focus"};
}
.notification-background {
padding: 6px 12px;

.close-button {
/* The notification Close Button */
background: #{"@noti-close-bg"};
color: #{"@text-color"};
text-shadow: none;
padding: 0;
border-radius: 100%;
margin-top: 10px;
margin-right: 16px;
$margin: 6px;
margin-top: $margin;
margin-right: $margin;
box-shadow: none;
border: none;
min-width: 24px;
Expand All @@ -38,18 +55,18 @@
&:hover {
box-shadow: none;
background: #{"@noti-close-bg-hover"};
transition: all 0.15s ease-in-out;
transition: $hover-tranistion;
border: none;
}
}

.notification {
/* The actual notification */
border-radius: 12px;
margin: 6px 12px;
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);
border-radius: $border-radius;
border: $border;
padding: 0;
transition: $hover-tranistion;
background: #{"@noti-bg"};

&.low {
/* Low Priority Notification */
Expand All @@ -65,10 +82,10 @@
padding: 4px;
margin: 0;
box-shadow: none;
background: #{"@noti-bg"};
border: 1px solid #{"@noti-border-color"};
background: transparent;
border: none;
color: #{"@text-color"};
transition: all 0.15s ease-in-out;
transition: $hover-tranistion;
}
%action-hover {
-gtk-icon-effect: none;
Expand All @@ -78,7 +95,7 @@
.notification-default-action {
/* The large action that also displays the notification summary and body */
@extend %action;
border-radius: 12px;
border-radius: $border-radius;

&:hover {
@extend %action-hover;
Expand All @@ -92,38 +109,45 @@

.notification-content {
background: transparent;
padding: 6px;
border-radius: 12px;
$padding: 6px;
padding: $padding;
border-radius: $border-radius;

.image {
/* Notification Primary Image */
-gtk-icon-effect: none;
border-radius: 10px; /* Size in px */
}
.summary {
/* Notification summary/title */
font-size: 16px;
font-weight: bold;
background: transparent;
color: #{"@text-color"};
text-shadow: none;
border-radius: 100px; /* Size in px */
margin: 4px;
}
.time {
/* Notification time-ago */
font-size: 16px;
font-weight: bold;
background: transparent;
color: #{"@text-color"};
text-shadow: none;
margin-right: 18px;
}
.body {
/* Notification body */
font-size: 15px;
font-weight: normal;
background: transparent;
color: #{"@text-color"};
text-shadow: none;

.text-box {
margin: 0 8px;
.summary {
/* Notification summary/title */
font-size: $font-size-summary;
font-weight: bold;
background: transparent;
color: #{"@text-color"};
text-shadow: none;
}
.time {
/* Notification time-ago */
font-size: $font-size-summary;
font-weight: bold;
background: transparent;
color: #{"@text-color"};
text-shadow: none;
margin-right: 24px;
}
.body {
/* Notification body */
font-size: $font-size-body;
font-weight: normal;
background: transparent;
color: #{"@text-color"};
text-shadow: none;
}
}

progressbar {
Expand All @@ -134,7 +158,8 @@
/* The "extra" optional bottom notification image */
margin-top: 6px;
background-color: white;
border-radius: 12px;
border-radius: $border-radius;
-gtk-icon-effect: none;
}

.inline-reply {
Expand All @@ -145,20 +170,21 @@
background: #{"@noti-bg-darker"};
color: #{"@text-color"};
caret-color: #{"@text-color"};
border: 1px solid #{"@noti-border-color"};
border-radius: 12px;
border: $border;
border-radius: $border-radius;
}
.inline-reply-button {
margin-left: 4px;
background: #{"@noti-bg"};
border: 1px solid #{"@noti-border-color"};
border-radius: 12px;
border: $border;
border-radius: $border-radius;
color: #{"@text-color"};

&:disabled {
background: initial;
color: #{"@text-color-disabled"};
border: 1px solid transparent;
border: $border;
border-color: transparent;
}
&:hover {
background: #{"@noti-bg-hover"};
Expand All @@ -169,19 +195,19 @@
}

.notification-action {
/* The sub actions below the default action */
/* The alternative actions below the default action */
@extend %action;
border-top: $border;
border-radius: 0px;
border-top: none;
border-right: none;
border-right: $border;

&:first-child {
/* add bottom border radius to eliminate clipping */
border-bottom-left-radius: 10px;
border-bottom-left-radius: $border-radius;
}
&:last-child {
border-bottom-right-radius: 10px;
border-right: 1px solid #{"@noti-border-color"};
border-bottom-right-radius: $border-radius;
border-right: none;
}

&:hover {
Expand Down Expand Up @@ -227,20 +253,26 @@
}

&.collapsed {
/* Set lower stacked notifications opacity to 0 */
.notification-row:not(:last-child) {
/* Top notification in stack */
.notification-action *,
.notification-default-action * {
transition: opacity 400ms ease-in-out;
opacity: 0;
.notification-row {
.notification {
background-color: #{"@noti-bg-opaque"};
}

&:not(:last-child) {
/* Top notification in stack */
/* Set lower stacked notifications opacity to 0 */
.notification-action,
.notification-default-action {
opacity: 0;
}
}
}

&:hover {
.notification-default-action,
.notification-action {
background-color: #{"@noti-bg-hover"};
.notification-row:not(:only-child) {
.notification {
background-color: #{"@noti-bg-hover-opaque"};
}
}
}
}
Expand All @@ -249,6 +281,7 @@
.control-center {
/* The Control Center which contains the old notifications + widgets */
background: #{"@cc-bg"};
border-radius: $border-radius;

.control-center-list-placeholder {
/* The placeholder when there are no notifications */
Expand All @@ -258,16 +291,33 @@
.control-center-list {
/* List of notifications */
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 {
/* Window behind control center and on all other monitors */
background: #{"alpha(black, 0.25)"};
background: transparent;
}

.floating-notifications {
background: transparent;

.notification {
box-shadow: none;
}
}

/*** Widgets ***/
Expand Down
4 changes: 3 additions & 1 deletion src/notification/notification.ui
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="valign">center</property>
<property name="margin-end">14</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="orientation">vertical</property>
Expand Down Expand Up @@ -153,6 +152,9 @@
<property name="position">1</property>
</packing>
</child>
<style>
<class name="text-box"/>
</style>
</object>
<packing>
<property name="expand">True</property>
Expand Down

0 comments on commit a669d1a

Please sign in to comment.