[gnome-shell] popupMenu: Remove excess padding from separators
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] popupMenu: Remove excess padding from separators
- Date: Sat, 15 Feb 2020 00:22:07 +0000 (UTC)
commit 9c7098816ed223d03c015b07c1c57742835e5531
Author: Florian Müllner <fmuellner gnome org>
Date: Fri Feb 14 13:36:04 2020 +0100
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
data/theme/gnome-shell-sass/widgets/_popovers.scss | 18 +++++++++++-------
js/ui/popupMenu.js | 17 +++++++++++------
2 files changed, 22 insertions(+), 13 deletions(-)
---
diff --git a/data/theme/gnome-shell-sass/widgets/_popovers.scss
b/data/theme/gnome-shell-sass/widgets/_popovers.scss
index 2dd2b53c84..b28893fdc5 100644
--- a/data/theme/gnome-shell-sass/widgets/_popovers.scss
+++ b/data/theme/gnome-shell-sass/widgets/_popovers.scss
@@ -82,13 +82,17 @@ $popover_arrow_height: 12px;
// separator
.popup-separator-menu-item {
- //-margin-horizontal: 24px;
- height: 1px; //not really the whole box
- margin: 6px 64px;
- background-color: lighten($borders_color, 2%);
- .popup-sub-menu & { //submenu separators
- @if $variant == 'dark' {
- background-color: lighten($bg_color,10%);
+ padding: 0;
+
+ .popup-separator-menu-item-separator {
+ //-margin-horizontal: 24px;
+ height: 1px; //not really the whole box
+ margin: 6px 64px;
+ background-color: lighten($borders_color, 2%);
+ .popup-sub-menu & { //submenu separators
+ @if $variant == 'dark' {
+ background-color: lighten($bg_color,10%);
+ }
}
}
}
diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js
index 3119124f97..0cc2803a49 100644
--- a/js/ui/popupMenu.js
+++ b/js/ui/popupMenu.js
@@ -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);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]