popup: Include active item as part of the submenu

This commit is contained in:
Carlos Soriano 2015-01-21 17:14:42 +01:00 committed by Florian Müllner
parent 48cfd35b65
commit c398e02700
4 changed files with 15 additions and 6 deletions

View File

@ -412,8 +412,7 @@ StScrollBar {
.popup-menu-arrow { } //defined globally in the TOP BAR .popup-menu-arrow { } //defined globally in the TOP BAR
.popup-sub-menu { .popup-sub-menu {
background-color: darken($bg_color,2%); background-color: darken($bg_color,2%);
border-top: 1px solid lighten($borders_color,5%); box-shadow: inset 0 -1px 0px lighten($borders_color,5%);
border-bottom: 1px solid lighten($borders_color,5%);
} }
.popup-menu-content { padding: 1em 0em; } .popup-menu-content { padding: 1em 0em; }
@ -422,6 +421,10 @@ StScrollBar {
&:ltr { padding: .4em 1.75em .4em 0em; } &:ltr { padding: .4em 1.75em .4em 0em; }
&:rtl { padding: .4em 0em .4em 1.75em; } &:rtl { padding: .4em 0em .4em 1.75em; }
&:checked {
background-color: darken($bg_color,2%);
box-shadow: inset 0 1px 0px lighten($borders_color,5%);
}
&:active { background-color: $selected_bg_color; } &:active { background-color: $selected_bg_color; }
&:insensitive { background-color: transparentize($bg_color,.5); } &:insensitive { background-color: transparentize($bg_color,.5); }
} }

View File

@ -751,8 +751,7 @@ StScrollBar {
min-width: 200px; } min-width: 200px; }
.popup-menu .popup-sub-menu { .popup-menu .popup-sub-menu {
background-color: black; background-color: black;
border-top: 1px solid #0d0d0d; box-shadow: inset 0 -1px 0px #0d0d0d; }
border-bottom: 1px solid #0d0d0d; }
.popup-menu .popup-menu-content { .popup-menu .popup-menu-content {
padding: 1em 0em; } padding: 1em 0em; }
.popup-menu .popup-menu-item { .popup-menu .popup-menu-item {
@ -761,6 +760,9 @@ StScrollBar {
padding: .4em 1.75em .4em 0em; } padding: .4em 1.75em .4em 0em; }
.popup-menu .popup-menu-item:rtl { .popup-menu .popup-menu-item:rtl {
padding: .4em 0em .4em 1.75em; } padding: .4em 0em .4em 1.75em; }
.popup-menu .popup-menu-item:checked {
background-color: black;
box-shadow: inset 0 1px 0px #0d0d0d; }
.popup-menu .popup-menu-item:active { .popup-menu .popup-menu-item:active {
background-color: #215d9c; } background-color: #215d9c; }
.popup-menu .popup-menu-item:insensitive { .popup-menu .popup-menu-item:insensitive {

View File

@ -751,8 +751,7 @@ StScrollBar {
min-width: 200px; } min-width: 200px; }
.popup-menu .popup-sub-menu { .popup-menu .popup-sub-menu {
background-color: #343a3a; background-color: #343a3a;
border-top: 1px solid #282c2c; box-shadow: inset 0 -1px 0px #282c2c; }
border-bottom: 1px solid #282c2c; }
.popup-menu .popup-menu-content { .popup-menu .popup-menu-content {
padding: 1em 0em; } padding: 1em 0em; }
.popup-menu .popup-menu-item { .popup-menu .popup-menu-item {
@ -761,6 +760,9 @@ StScrollBar {
padding: .4em 1.75em .4em 0em; } padding: .4em 1.75em .4em 0em; }
.popup-menu .popup-menu-item:rtl { .popup-menu .popup-menu-item:rtl {
padding: .4em 0em .4em 1.75em; } padding: .4em 0em .4em 1.75em; }
.popup-menu .popup-menu-item:checked {
background-color: #343a3a;
box-shadow: inset 0 1px 0px #282c2c; }
.popup-menu .popup-menu-item:active { .popup-menu .popup-menu-item:active {
background-color: #215d9c; } background-color: #215d9c; }
.popup-menu .popup-menu-item:insensitive { .popup-menu .popup-menu-item:insensitive {

View File

@ -1075,10 +1075,12 @@ const PopupSubMenuMenuItem = new Lang.Class({
this.actor.add_style_pseudo_class('open'); this.actor.add_style_pseudo_class('open');
this._getTopMenu()._setOpenedSubMenu(this.menu); this._getTopMenu()._setOpenedSubMenu(this.menu);
this.actor.add_accessible_state (Atk.StateType.EXPANDED); this.actor.add_accessible_state (Atk.StateType.EXPANDED);
this.actor.add_style_pseudo_class('checked');
} else { } else {
this.actor.remove_style_pseudo_class('open'); this.actor.remove_style_pseudo_class('open');
this._getTopMenu()._setOpenedSubMenu(null); this._getTopMenu()._setOpenedSubMenu(null);
this.actor.remove_accessible_state (Atk.StateType.EXPANDED); this.actor.remove_accessible_state (Atk.StateType.EXPANDED);
this.actor.remove_style_pseudo_class('checked');
} }
}, },