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:

committed by
Florian Müllner

parent
8834088f3b
commit
9c7098816e
@ -282,8 +282,11 @@ class PopupMenuItem extends PopupBaseMenuItem {
|
||||
var PopupSeparatorMenuItem = GObject.registerClass(
|
||||
class PopupSeparatorMenuItem extends PopupBaseMenuItem {
|
||||
_init(text) {
|
||||
super._init({ reactive: false,
|
||||
can_focus: false });
|
||||
super._init({
|
||||
style_class: 'popup-separator-menu-item',
|
||||
reactive: false,
|
||||
can_focus: false,
|
||||
});
|
||||
|
||||
this.label = new St.Label({ text: text || '' });
|
||||
this.add(this.label);
|
||||
@ -293,10 +296,12 @@ class PopupSeparatorMenuItem extends PopupBaseMenuItem {
|
||||
this._syncVisibility.bind(this));
|
||||
this._syncVisibility();
|
||||
|
||||
this._separator = new St.Widget({ style_class: 'popup-separator-menu-item',
|
||||
x_expand: true,
|
||||
y_expand: true,
|
||||
y_align: Clutter.ActorAlign.CENTER });
|
||||
this._separator = new St.Widget({
|
||||
style_class: 'popup-separator-menu-item-separator',
|
||||
x_expand: true,
|
||||
y_expand: true,
|
||||
y_align: Clutter.ActorAlign.CENTER,
|
||||
});
|
||||
this.add_child(this._separator);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user