[gnome-shell/uajain/adapt-user-avatar-part2: 20/21] userWidget: Add empty label when user is null
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/uajain/adapt-user-avatar-part2: 20/21] userWidget: Add empty label when user is null
- Date: Wed, 12 Feb 2020 19:09:39 +0000 (UTC)
commit fd36914ca6a3b8b78cca51ca28a75f542ac05b46
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Tue Feb 11 10:39:22 2020 -0300
userWidget: Add empty label when user is null
Currently, when a null user is passed, we don't add any
username label. That makes the layout of user and no-user
cases inconsistent.
Add a ghost label with no opacity to mimic the username
label.
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/922
js/ui/userWidget.js | 8 ++++++++
1 file changed, 8 insertions(+)
---
diff --git a/js/ui/userWidget.js b/js/ui/userWidget.js
index d21552555c..e5f7883381 100644
--- a/js/ui/userWidget.js
+++ b/js/ui/userWidget.js
@@ -225,6 +225,14 @@ class UserWidget extends St.BoxLayout {
this._userLoadedId = this._user.connect('notify::is-loaded', this._updateUser.bind(this));
this._userChangedId = this._user.connect('changed', this._updateUser.bind(this));
+ } else {
+ this._label = new St.Label({
+ style_class: 'user-widget-label',
+ text: 'Empty User',
+ opacity: 0,
+ });
+ this.add_child(this._label);
+
}
this._updateUser();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]