popupMenu: Remove excess padding from separators
Currently separators get all the padding from regular menu items, which is excessive for non-interactive elements. Shuffle style classes around a bit to allow overriding the normal padding for separators. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/1004
This commit is contained in:
parent
8834088f3b
commit
9c7098816e
@ -82,13 +82,17 @@ $popover_arrow_height: 12px;
|
|||||||
|
|
||||||
// separator
|
// separator
|
||||||
.popup-separator-menu-item {
|
.popup-separator-menu-item {
|
||||||
//-margin-horizontal: 24px;
|
padding: 0;
|
||||||
height: 1px; //not really the whole box
|
|
||||||
margin: 6px 64px;
|
.popup-separator-menu-item-separator {
|
||||||
background-color: lighten($borders_color, 2%);
|
//-margin-horizontal: 24px;
|
||||||
.popup-sub-menu & { //submenu separators
|
height: 1px; //not really the whole box
|
||||||
@if $variant == 'dark' {
|
margin: 6px 64px;
|
||||||
background-color: lighten($bg_color,10%);
|
background-color: lighten($borders_color, 2%);
|
||||||
|
.popup-sub-menu & { //submenu separators
|
||||||
|
@if $variant == 'dark' {
|
||||||
|
background-color: lighten($bg_color,10%);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -282,8 +282,11 @@ class PopupMenuItem extends PopupBaseMenuItem {
|
|||||||
var PopupSeparatorMenuItem = GObject.registerClass(
|
var PopupSeparatorMenuItem = GObject.registerClass(
|
||||||
class PopupSeparatorMenuItem extends PopupBaseMenuItem {
|
class PopupSeparatorMenuItem extends PopupBaseMenuItem {
|
||||||
_init(text) {
|
_init(text) {
|
||||||
super._init({ reactive: false,
|
super._init({
|
||||||
can_focus: false });
|
style_class: 'popup-separator-menu-item',
|
||||||
|
reactive: false,
|
||||||
|
can_focus: false,
|
||||||
|
});
|
||||||
|
|
||||||
this.label = new St.Label({ text: text || '' });
|
this.label = new St.Label({ text: text || '' });
|
||||||
this.add(this.label);
|
this.add(this.label);
|
||||||
@ -293,10 +296,12 @@ class PopupSeparatorMenuItem extends PopupBaseMenuItem {
|
|||||||
this._syncVisibility.bind(this));
|
this._syncVisibility.bind(this));
|
||||||
this._syncVisibility();
|
this._syncVisibility();
|
||||||
|
|
||||||
this._separator = new St.Widget({ style_class: 'popup-separator-menu-item',
|
this._separator = new St.Widget({
|
||||||
x_expand: true,
|
style_class: 'popup-separator-menu-item-separator',
|
||||||
y_expand: true,
|
x_expand: true,
|
||||||
y_align: Clutter.ActorAlign.CENTER });
|
y_expand: true,
|
||||||
|
y_align: Clutter.ActorAlign.CENTER,
|
||||||
|
});
|
||||||
this.add_child(this._separator);
|
this.add_child(this._separator);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user