gnome-shell/data/theme/gnome-shell-sass/widgets/_popovers.scss
Sam Hewitt 4de96ac737 theme: Papercut fixes from 42 refresh
- simplified drawing functions
- refactored button drawing
- dropped arrow from all popovers
- cleaned out some legacy css
- fixed many of the issues in #4969

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2150>
2022-02-05 00:46:22 -03:00

205 lines
4.6 KiB
SCSS

/* Popovers/Menus */
// the popover itself
.popup-menu-boxpointer {
// override popover styles for panel menus so
// we can draw a box shadow and no arrow
-arrow-border-radius: $modal_radius;
-arrow-background-color: transparent;
-arrow-border-color: transparent;
-arrow-border-width: 0;
-arrow-base: 0;
-arrow-rise: $base_margin; // use this as top margin
-arrow-box-shadow: none; // dreaming bugzilla #689995
margin: $base_margin; // used as distance from the screen edge
}
// container of the popover menu
.popup-menu {
min-width: 15em;
color: $fg_color;
//.popup-status-menu-item { font-weight: normal; color: pink; } //dunno what that is
&.panel-menu {
-boxpointer-gap: $base_margin+2px; // distance from the panel
margin-bottom: 1.75em; // so it doesn't touch the bottom of the screen
// style the menu content instead
.popup-menu-content {
padding: $base_padding*1.5;
}
.popup-menu-item {}
}
}
// popover content;
.popup-menu-content {
padding: $base_padding;
border-radius: $modal_radius;
border: 1px solid $borders_edge;
box-shadow: 0 2px 4px 0 rgba(0,0,0,0.1);
background-color: $bg_color;
}
// menu items
.popup-menu-item {
spacing: $base_spacing;
padding: $base_padding*1.5;
margin: 2px 0;
border-radius: $base_border_radius;
transition: 0.2s all ease;
&:ltr { padding-right:$base_padding; padding-left: 0; }
&:rtl { padding-right: 0; padding-left:$base_padding; }
&:hover {
background-color: $hover_bg_color;
}
&:checked {
background-color: $hover_bg_color;
margin-bottom: 0;
box-shadow: inset 0 -1px 0 0 darken($hover_bg_color, 5%);
border-radius: $base_border_radius $base_border_radius 0 0;
&:hover {
background-color: lighten($hover_bg_color, 5%);
}
}
&.selected {
background-color: transparentize($fg_color, if($variant=='light', 0.7, 0.9));
color: $fg_color;
}
&:active {
background-color: lighten($active_bg_color,3%);
color: lighten($active_fg_color,3%);
}
&:insensitive { color: transparentize($fg_color,0.5);}
}
// all icons and other graphical elements
.popup-inactive-menu-item {
color: $fg_color;
// "Open Windows" label
font-weight: bold;
font-size: smaller;
&:insensitive { color: $insensitive_fg_color; }
}
// symbolic icons in popover
.popup-menu-arrow,
.popup-menu-icon {
icon-size: 16px !important;
}
.popup-menu-arrow {
margin-right: $base_margin;
}
// popover submenus
.popup-sub-menu {
border:none;
background-color: $hover_bg_color;
border-radius: 0 0 $base_border_radius $base_border_radius;
.popup-menu-ornament {
min-width: 14px !important;
}
.popup-menu-item {
border-radius: 0;
margin: 0;
padding: $base_padding*1.5 $base_padding*2;
&:last-child {
border-radius: 0 0 $base_border_radius $base_border_radius;
}
}
.popup-menu-section {
.popup-menu-item:last-child:hover { border-radius: 0 }
&:last-child .popup-menu-item:last-child {
border-radius: 0 0 $base_border_radius $base_border_radius;
}
}
}
// container for radio and check boxes
.popup-menu-ornament {
width: 1.2em;
font-weight: bold;
font-size: 1em;
&:ltr { text-align: right; };
&:rtl { text-align: left; };
}
// separator
.popup-separator-menu-item {
padding:0;
margin: 4px 0;
.popup-separator-menu-item-separator {
height: 1px; //not really the whole box
background-color: $borders_color;
}
.popup-menu-ornament {
width: 0 !important;
}
.popup-sub-menu & {
padding: 0;
margin-right: 2.5em !important; // account for ornament
background-color: transparent;
.popup-separator-menu-item-separator {
background-color: lighten($borders_color, 7%);
}
}
}
// desktop background menu
.background-menu {
-boxpointer-gap: $base_margin;
-arrow-rise: 0px; // hide the beak on the menu
}
// system status menu
.aggregate-menu {
min-width: 22em;
// this is unneeded in at the top-level this menu, hide it
.popup-menu-ornament {width:0;padding:0;margin:0;}
.popup-menu-item {
&:ltr { padding-left:$base_padding;padding-right:$base_padding*2; }
&:rtl { padding-right:$base_padding;padding-left:$base_padding*2; }
}
// lock screen, shutdown, etc. buttons
.popup-menu-icon {
padding:0;
margin: 0 $base_margin;
-st-icon-style: symbolic;
}
// account for icons in submenus with padding
.popup-sub-menu .popup-menu-item > :first-child {
&:ltr {
padding-left: 0;
margin-left: $base_icon_size;
}
&:rtl {
padding-right: 0;
margin-right: $base_icon_size;
}
}
}