theme: Style .selected menu items instead of :focus/:hover

The .selected style class indicates the "active" menu item, which
is generally the last hovered or focused one (whichever happened
last). Styling that instead of :focus and :hover directly guarantees
that only a single item will be selected at a time, which removes
ambiguity and matches the behavior of GTK+ menus.

https://bugzilla.gnome.org/show_bug.cgi?id=745246
This commit is contained in:
Florian Müllner 2015-03-17 15:47:27 +01:00
parent 8b6e566728
commit 826682cc07
3 changed files with 3 additions and 7 deletions

View File

@ -393,7 +393,7 @@ StScrollBar {
background-color: black; background-color: black;
box-shadow: inset 0 1px 0px #0d0d0d; box-shadow: inset 0 1px 0px #0d0d0d;
font-weight: bold; } font-weight: bold; }
.popup-menu .popup-menu-item:hover, .popup-menu .popup-menu-item:focus { .popup-menu .popup-menu-item.selected {
background-color: rgba(255, 255, 255, 0.1); background-color: rgba(255, 255, 255, 0.1);
color: #fff; } color: #fff; }
.popup-menu .popup-menu-item:active { .popup-menu .popup-menu-item:active {
@ -401,8 +401,6 @@ StScrollBar {
color: #ffffff; } color: #ffffff; }
.popup-menu .popup-menu-item:insensitive { .popup-menu .popup-menu-item:insensitive {
color: rgba(255, 255, 255, 0.5); } color: rgba(255, 255, 255, 0.5); }
.popup-menu .selected {
background-color: #215d9c; }
.popup-menu .popup-inactive-menu-item { .popup-menu .popup-inactive-menu-item {
color: #fff; } color: #fff; }
.popup-menu .popup-inactive-menu-item:insensitive { .popup-menu .popup-inactive-menu-item:insensitive {

@ -1 +1 @@
Subproject commit bc0a7a9fcdc32bf79679542dba41a4a6de5615f1 Subproject commit a84637bf55bca3b515bc5602cf02ec48b8450dfd

View File

@ -393,7 +393,7 @@ StScrollBar {
background-color: #343a3a; background-color: #343a3a;
box-shadow: inset 0 1px 0px #282c2c; box-shadow: inset 0 1px 0px #282c2c;
font-weight: bold; } font-weight: bold; }
.popup-menu .popup-menu-item:hover, .popup-menu .popup-menu-item:focus { .popup-menu .popup-menu-item.selected {
background-color: rgba(238, 238, 236, 0.1); background-color: rgba(238, 238, 236, 0.1);
color: #eeeeec; } color: #eeeeec; }
.popup-menu .popup-menu-item:active { .popup-menu .popup-menu-item:active {
@ -401,8 +401,6 @@ StScrollBar {
color: #ffffff; } color: #ffffff; }
.popup-menu .popup-menu-item:insensitive { .popup-menu .popup-menu-item:insensitive {
color: rgba(238, 238, 236, 0.5); } color: rgba(238, 238, 236, 0.5); }
.popup-menu .selected {
background-color: #215d9c; }
.popup-menu .popup-inactive-menu-item { .popup-menu .popup-inactive-menu-item {
color: #eeeeec; } color: #eeeeec; }
.popup-menu .popup-inactive-menu-item:insensitive { .popup-menu .popup-inactive-menu-item:insensitive {