Julian Sparber 8fed0b83d0 notification: Show symbolic icons in a circle and smaller
Huge symbolic icons look bad therefore we special case them, this
obviously can only work for icons that use the system icons.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3066>
2024-02-01 10:31:24 +01:00

222 lines
5.4 KiB
SCSS

/* Message List */
// a.k.a. notifications in the menu
// main list
.message-list {
width: 29em;
border: solid $borders_color;
// padding and margins to account for scrollbar
&:ltr {margin-left: 0; margin-right: $base_margin; padding-right: $base_padding; border-right-width: 1px; }
&:rtl {margin-right: 0; margin-left: $base_margin; padding-left: $base_padding; border-left-width: 1px; }
.message-list-placeholder {
@extend %title_2;
color: $insensitive_fg_color;
// icon size and color
> StIcon {
icon-size: $scalable_icon_size * 3; // 48px
margin-bottom: $base_margin * 3;
-st-icon-style: symbolic;
}
}
}
.message-list-sections {
spacing: $base_padding;
margin: 0;
padding-bottom: $base_padding;
// to account for scrollbar
&:ltr {margin-right: $base_margin * 3; }
&:rtl {margin-left: $base_margin * 3;}
}
.message-list-section,
.message-list-section-list {
spacing: $base_padding;
}
// do-not-disturb + clear button
.message-list-controls {
// NOTE: remove the padding if notification_bubble could remove margin for drop shadow
padding: $base_padding;
spacing: $base_padding;
@extend %heading;
.dnd-button {
// We need this because the focus outline isn't inset like for the buttons
// so the dnd button would grow when it gets focus if we didn't change only
// its color when focusing.
border-width: 2px;
border-color: transparent;
border-radius: 32px;
border-style: solid;
&:focus {
border-color: transparentize($selected_bg_color, 0.4);
}
}
}
// message bubbles
.message {
@extend %card;
padding: 0 !important;
// subtract side padding to accommodate the close button
&:ltr { padding-right: $base_padding - 2px; };
&:rtl { padding-left: $base_padding - 2px; };
// message header
.message-header {
padding: 0 $scaled_padding;
margin: 0 $base_padding;
margin-top: $base_padding;
color: $insensitive_fg_color;
spacing: $base_padding;
// header source icon
.message-source-icon {
padding: 2px 0;
icon-size: $scalable_icon_size; // 16px
-st-icon-style: symbolic;
}
// box that contains the source icon, source name and timestamp of the message
.message-header-content {
spacing: $base_padding;
min-height: to_em(24px);
padding-bottom: $base_padding;
// header source title
.message-source-title {
font-weight: bold;
}
// Time label
.event-time {
@extend %caption;
color: $insensitive_fg_color;
// Add bottom padding to align the app name with the time horizontally
padding-bottom: to_em(1px);
&:ltr { text-align: right };
&:rtl { text-align: left };
}
}
// close button
.message-close-button {
@extend .icon-button;
color: $fg_color !important;
background-color: transparentize($fg_color, 0.8);
padding: 0 !important;
border: 4px transparent solid;
&:hover {background-color: transparentize($fg_color, 0.7);}
&:insensitive {background-color: transparentize($fg_color, 0.9);}
&:active {background-color: transparentize($fg_color, 0.8);}
}
}
// container for message contents
.message-box {
padding: 0 $base_padding;
padding-bottom: $base_padding;
margin: $base_padding;
margin-top: $base_padding;
spacing: $base_padding;
// icon container
.message-icon-bin {
&:ltr {padding-right:$base_padding;}
&:rtl {padding-left:$base_padding;}
// icon size and color
> StIcon {
icon-size: $base_icon_size * 3; // 48px
-st-icon-style: symbolic;
.message-themed-icon {
border-radius: $forced_circular_radius; // is circular
background-color: transparentize($fg_color, 0.8);
icon-size: $base_icon_size;
min-width: $base_icon_size * 3;
min-height: $base_icon_size * 3;
}
}
}
// If the header isn't displayed we need more top margin
&:first-child {
margin-top: $base_padding * 2;
}
// text of the message
.message-content {
spacing: $base_margin;
// message title
.message-title {
font-weight: bold;
}
}
}
}
// URLs in messages
.url-highlighter {
link-color: $link_color;
}
/* Media Controls */
.message-media-control {
padding: 0 $base_padding * 3;
border-radius: $base_border_radius;
color: $fg_color;
border: 1px solid transparent;
@if $contrast == 'high' {
border-color: $hc_inset_color;
margin: $base_padding * 2 2px;
}
// colors are lightened since the media controls are in a card
&:hover {
background-color: lighten($hover_bg_color, 5%);
color: $fg_color;
}
&:active {
background-color: lighten($active_bg_color, 5%);
color: $fg_color;
}
&:insensitive {
color: lighten($insensitive_fg_color, 5%);
@if $contrast == 'high' {
border-color: transparent;
}
}
& StIcon { icon-size: $base_icon_size; }
}
// album-art
.media-message-cover-icon {
icon-size: $base_icon_size * 3 !important; // 48px
border-radius: $base_border_radius;
// when there is no artwork
&.fallback {
color: darken($fg_color, 17%);
background-color: $bg_color;
border: 1px solid transparent;
border-radius: $base_border_radius;
icon-size: $large_icon_size !important; // 32px
padding: ($base_padding * 2 + 2); // 16px
}
}