[gnome-shell] popupBaseMenuItem: Add support for Hidden Ornament
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] popupBaseMenuItem: Add support for Hidden Ornament
- Date: Fri, 20 Sep 2019 15:59:16 +0000 (UTC)
commit af1aabff75cc62d178e9166464fada6b47bb3299
Author: Marco Trevisan (Treviño) <mail 3v1n0 net>
Date: Fri Sep 13 17:59:16 2019 +0200
popupBaseMenuItem: Add support for Hidden Ornament
The menu item ornament is used to put dots or checks in menus or otherwise
to define a padding for a label.
However in some cases we want to create a menu item with no left (in ltr)
padding.
In order to do that, define a HIDDEN Ornament mode that completely hides the
ornament actor.
The naming here might be confusing as this should probably be called NONE,
while the default mode is the invisible one, but it's too late to change it
now.
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/720
js/ui/popupMenu.js | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js
index e26771555b..ad9b3c77c3 100644
--- a/js/ui/popupMenu.js
+++ b/js/ui/popupMenu.js
@@ -15,6 +15,7 @@ var Ornament = {
NONE: 0,
DOT: 1,
CHECK: 2,
+ HIDDEN: 3,
};
function isPopupMenuItemVisible(child) {
@@ -248,10 +249,12 @@ var PopupBaseMenuItem = GObject.registerClass({
} else if (ornament == Ornament.CHECK) {
this._ornamentLabel.text = '\u2713';
this.add_accessible_state(Atk.StateType.CHECKED);
- } else if (ornament == Ornament.NONE) {
+ } else if (ornament == Ornament.NONE || ornament == Ornament.HIDDEN) {
this._ornamentLabel.text = '';
this.remove_accessible_state(Atk.StateType.CHECKED);
}
+
+ this._ornamentLabel.visible = ornament != Ornament.HIDDEN;
}
});
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]