Skip to content

Commit 10594d4

Browse files
committed
gnome-shell: Rewrite popup-menus
Rewrite after major upstream rework in GNOME 42.
1 parent ab05644 commit 10594d4

File tree

1 file changed

+139
-85
lines changed

1 file changed

+139
-85
lines changed

common/gnome-shell/42/sass/_common.scss

Lines changed: 139 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -524,97 +524,176 @@ StScrollBar {
524524
//
525525
// Popvers/Menus
526526
//
527-
.popup-menu {
528-
$_popup_submenu_background_color: if($variant!='dark', rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.15));
529-
$_popup_submenu_border_color: if($variant!='dark', rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.15));
530527

531-
min-width: 15em;
528+
$_popup_submenu_background_color: if($variant!='dark', rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.15));
529+
$_popup_submenu_border_color: if($variant!='dark', rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.15));
532530

533-
.popup-menu-content {
534-
margin: if($variant!='dark', 4px, 3px);
531+
// the popover itself
532+
.popup-menu-boxpointer {
533+
-arrow-rise: 0px; // distance from the panel & screen edge
534+
}
535535

536-
@extend %popup_menu;
537-
}
536+
// container of the popover menu
537+
.popup-menu {
538+
min-width: 15em;
539+
color: $fg_color;
538540

539-
.popup-menu-arrow { } //defined globally in the TOP BAR
540-
.popup-sub-menu {
541-
padding-bottom: 1px;
542-
background-color: $_popup_submenu_background_color;
543-
box-shadow: inset 0 -1px $_popup_submenu_border_color;
544-
border: none;
541+
&.panel-menu {
542+
margin-bottom: 1.75em; // so it doesn't touch the bottom of the screen
545543
}
544+
}
546545

547-
.popup-menu-content { padding: .7em 0em .7em 0em; }
548-
.popup-menu-item {
549-
spacing: 12px;
546+
// popover content
547+
.popup-menu-content {
548+
padding: .7em 0em .7em 0em;
549+
margin: if($variant!='dark', 4px, 3px);
550550

551-
&:ltr { padding: .4em 32px .4em 0em; }
552-
&:rtl { padding: .4em 0em .4em 32px; }
551+
@extend %popup_menu;
552+
}
553553

554-
&:checked {
555-
font-weight: normal;
556-
background-color: $_popup_submenu_background_color;
557-
box-shadow: inset 0 1px $_popup_submenu_border_color;
554+
// menu items
555+
.popup-menu-item {
556+
border-radius: 0;
557+
spacing: 12px;
558+
background-color: transparent;
559+
560+
&:ltr { padding: .4em 16px .4em 0em; }
561+
&:rtl { padding: .4em 0em .4em 16px; }
562+
563+
&:focus {
564+
&, &:checked {
565+
background-color: transparent !important;
558566
}
567+
}
559568

560-
&:active, &.selected {
569+
&:hover, &:active {
570+
&, &:checked {
561571
color: $selected_fg_color;
562-
background-color: $selected_bg_color;
572+
background-color: $selected_bg_color !important;
563573
box-shadow: none;
564574
}
575+
}
565576

566-
&:insensitive {
567-
color: transparentize($fg_color, 0.5);
568-
background: none;
569-
}
577+
&:checked {
578+
background-color: $_popup_submenu_background_color !important;
579+
box-shadow: inset 0 1px $_popup_submenu_border_color;
570580
}
571581

572-
.popup-inactive-menu-item { //all icons and other graphical elements
573-
color: $fg_color;
582+
&:insensitive {color: transparentize($fg_color,0.5);}
574583

575-
&:insensitive { color: $insensitive_fg_color; }
584+
// add margin to switches in menu items
585+
.toggle-switch {
586+
&:ltr { margin-left: 16px;}
587+
&:rtl { margin-right: 16px;}
576588
}
577-
//.popup-status-menu-item { font-weight: normal; color: pink; } //dunno what that is
578-
&.panel-menu {
579-
-boxpointer-gap: 0px;
580-
margin-bottom: 1.75em;
589+
}
590+
591+
592+
// all other graphical elements (sliders)
593+
.popup-inactive-menu-item {
594+
color: $fg_color;
595+
&:insensitive { color: $insensitive_fg_color; }
596+
}
597+
598+
// symbolic icons in popover
599+
.popup-menu-arrow,
600+
.popup-menu-icon {
601+
icon-size: 16px !important; // for some reason the variable doesn't work here
602+
}
603+
604+
.popup-menu-arrow {
605+
}
606+
607+
// popover submenus
608+
.popup-sub-menu {
609+
padding-bottom: 1px;
610+
background-color: $_popup_submenu_background_color;
611+
box-shadow: inset 0 -1px $_popup_submenu_border_color;
612+
border-radius: 0;
613+
614+
.popup-menu-ornament {
615+
min-width: 16px !important;
581616
}
582617
}
583618

619+
// container for radio and check boxes
584620
.popup-menu-ornament {
585-
margin-left: 4px;
586-
width: 16px;
621+
width: 1.2em;
622+
text-align: center !important;
587623

588-
&:ltr { text-align: right };
589-
&:rtl { text-align: left };
624+
&:ltr { text-align: right;}
625+
&:rtl { text-align: left;}
590626
}
591627

592-
.popup-menu-boxpointer {
593-
-arrow-border-radius: 2px;
594-
-arrow-background-color: rgba(0,0,0,0.0);
595-
-arrow-border-width: 1px;
596-
-arrow-border-color: rgba(0,0,0,0.0);
597-
-arrow-base: 0;
598-
-arrow-rise: 0;
628+
// separator
629+
.popup-separator-menu-item {
630+
&, .popup-sub-menu & {
631+
margin: 0;
632+
padding: 0 !important;
633+
634+
.popup-separator-menu-item-separator {
635+
height: 6px;
636+
margin: 0;
637+
background-color: transparent;
638+
border: none;
639+
}
640+
641+
// separators in submenus
642+
.popup-sub-menu & {
643+
background-color: transparent;
644+
height: 6px;
645+
}
646+
}
599647
}
600648

601-
.candidate-popup-boxpointer {
602-
-arrow-border-radius: 2px;
603-
-arrow-background-color: $osd_bg_color;
604-
-arrow-border-width: 1px;
605-
-arrow-border-color: transparentize(black, 0.6);
606-
-arrow-base: 20px;
607-
-arrow-rise: 10px;
649+
// desktop ackground menu
650+
.background-menu { -boxpointer-gap: 4px; -arrow-rise: 0px; }
651+
652+
// system status menu
653+
.aggregate-menu {
654+
min-width: 23.5em;
655+
656+
// this is unneeded at the top-level in this menu, hide it
657+
.popup-menu-ornament { width: 0 !important; }
658+
659+
// lock screen, shutdown, etc. buttons
660+
.popup-menu-icon {
661+
margin: 0 4px;
662+
-st-icon-style: symbolic;
663+
}
664+
665+
// account for ornaments in submenus with padding
666+
.popup-sub-menu .popup-menu-item > :first-child {
667+
// this value is hardcoded for visual effect
668+
&:ltr { margin-left: 20px;}
669+
&:rtl { margin-right: 20px;}
670+
}
608671
}
609672

610-
.popup-separator-menu-item-separator {
611-
//-margin-horizontal: 24px;
612-
height: 2px; //not really the whole box
613-
margin: 0;
614-
background-color: transparent;
615-
border: none;
673+
// right-click (and panel) app menu
674+
.app-menu {
675+
max-width: 27.25em;
676+
677+
// this is unneeded at the top-level in this menu, hide it
678+
.popup-menu-ornament { width: 0 !important; }
679+
680+
.popup-separator-menu-item:first-child {
681+
margin: .4em 4px;
682+
spacing: 0;
683+
}
684+
685+
.popup-inactive-menu-item:first-child {
686+
// "Open Windows" label
687+
> StLabel {
688+
@include fontsize($font-size);
689+
font-weight: normal;
690+
&:ltr {margin-right: 8px;}
691+
&:rtl {margin-left: 8px;}
692+
}
693+
}
616694
}
617695

696+
618697
// Rename popup
619698
.rename-folder-popup {
620699
.rename-folder-popup-item {
@@ -623,14 +702,6 @@ StScrollBar {
623702
}
624703
}
625704

626-
// Background menu
627-
.background-menu { -boxpointer-gap: 4px; -arrow-rise: 0px; }
628-
629-
// fallback menu
630-
//- odd thing for styling App menu when apparently not running under shell. Light Adwaita styled
631-
// app menu inside the main app window itself rather than the top bar
632-
//
633-
634705
//
635706
// OSD
636707
//
@@ -959,23 +1030,6 @@ $ws_dot_inactive: $ws_indicator_height / 6;
9591030
spacing: 4px;
9601031
}
9611032

962-
.app-menu {
963-
max-width: 27.25em;
964-
}
965-
966-
.aggregate-menu {
967-
min-width: 23.5em;
968-
.popup-menu-icon { padding: 0;
969-
margin: 0 4px;
970-
-st-icon-style: symbolic; }
971-
.popup-sub-menu .popup-menu-item > :first-child {
972-
&:ltr { /* 12px spacing + 2*4px padding + 16px icon */
973-
padding-left: 36px; }
974-
&:rtl { /* 12px spacing + 2*4px padding + 16px icon */
975-
padding-right: 36px; }
976-
}
977-
}
978-
9791033
//
9801034
// Calendar popover
9811035
//

0 commit comments

Comments
 (0)