[gnome-shell-extensions] places-menu: Emphasize eject buttons here as well
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell-extensions] places-menu: Emphasize eject buttons here as well
- Date: Fri, 10 Apr 2020 14:33:01 +0000 (UTC)
commit bce63d3168419fb51400635bc674fd9aed2cd835
Author: Florian Müllner <fmuellner gnome org>
Date: Fri Apr 10 16:02:30 2020 +0200
places-menu: Emphasize eject buttons here as well
We already align the buttons correctly here, but otherwise they can
use the same treatment as in the drive-menu.
https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/issues/223
extensions/places-menu/extension.js | 15 ++++++++++++---
extensions/places-menu/stylesheet.css | 9 ++++++++-
2 files changed, 20 insertions(+), 4 deletions(-)
---
diff --git a/extensions/places-menu/extension.js b/extensions/places-menu/extension.js
index be884f3..9165a0a 100644
--- a/extensions/places-menu/extension.js
+++ b/extensions/places-menu/extension.js
@@ -20,7 +20,9 @@ const PLACE_ICON_SIZE = 16;
var PlaceMenuItem = GObject.registerClass(
class PlaceMenuItem extends PopupMenu.PopupBaseMenuItem {
_init(info) {
- super._init();
+ super._init({
+ style_class: 'place-menu-item',
+ });
this._info = info;
this._icon = new St.Icon({
@@ -29,7 +31,11 @@ class PlaceMenuItem extends PopupMenu.PopupBaseMenuItem {
});
this.add_child(this._icon);
- this._label = new St.Label({ text: info.name, x_expand: true });
+ this._label = new St.Label({
+ text: info.name,
+ x_expand: true,
+ y_align: Clutter.ActorAlign.CENTER,
+ });
this.add_child(this._label);
if (info.isRemovable()) {
@@ -37,7 +43,10 @@ class PlaceMenuItem extends PopupMenu.PopupBaseMenuItem {
icon_name: 'media-eject-symbolic',
style_class: 'popup-menu-icon',
});
- this._ejectButton = new St.Button({ child: this._ejectIcon });
+ this._ejectButton = new St.Button({
+ child: this._ejectIcon,
+ style_class: 'button',
+ });
this._ejectButton.connect('clicked', info.eject.bind(info));
this.add_child(this._ejectButton);
}
diff --git a/extensions/places-menu/stylesheet.css b/extensions/places-menu/stylesheet.css
index db99e0c..5743762 100644
--- a/extensions/places-menu/stylesheet.css
+++ b/extensions/places-menu/stylesheet.css
@@ -1 +1,8 @@
-/* none used*/
+.place-menu-item .button {
+ border-radius: 99px;
+ padding: 3px;
+ min-height: auto;
+}
+
+.place-menu-item .button:ltr { margin-left: 6px; }
+.place-menu-item .button:rtl { margin-right: 6px; }
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]