-
Notifications
You must be signed in to change notification settings - Fork 732
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
userWidget: Back to using the theme to load the face image.
This only works properly when the image is set as a background as part of the theme, as some themes want to frame the image. Go back to using the original file picker for an image - simple icons don't really look very nice as avatar pics, and that was the only reason to involve the xapp icon picker.
- Loading branch information
Showing
3 changed files
with
70 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,11 +21,10 @@ class CinnamonUserApplet extends Applet.TextApplet { | |
this.setAllowedLayout(Applet.AllowedLayout.BOTH); | ||
|
||
this._panel_icon_box = new St.Bin(); // https://developer.gnome.org/st/stable/StBin.htm | ||
this._panel_icon_box.set_fill(true, true); | ||
this._panel_icon_box.set_alignment(St.Align.MIDDLE, St.Align.MIDDLE); | ||
this.actor.insert_child_at_index(this._panel_icon_box, 0); | ||
|
||
this._panel_icon = null; | ||
this._panel_avatar = null; | ||
|
||
this._session = new GnomeSession.SessionManager(); | ||
this._screenSaverProxy = new ScreenSaver.ScreenSaverProxy(); | ||
|
@@ -150,8 +149,10 @@ class CinnamonUserApplet extends Applet.TextApplet { | |
_updateLabel() { | ||
if (this.disp_name) { | ||
this.set_applet_label(this._user.get_real_name()); | ||
this._layoutBin.show(); | ||
} else { | ||
this.set_applet_label(""); | ||
this._layoutBin.hide(); | ||
} | ||
} | ||
|
||
|
@@ -171,22 +172,29 @@ class CinnamonUserApplet extends Applet.TextApplet { | |
|
||
_updatePanelIcon() { | ||
if (this.display_image) { | ||
this._panel_icon_box.show(); | ||
|
||
if (this._panel_icon == null) { | ||
this._panel_icon = new UserWidget.Avatar(this._user, { iconSize: this.getPanelIconSize() }); | ||
this._panel_icon_box.set_child(this._panel_icon); | ||
this._panel_icon.update(); | ||
this._panel_icon.show(); | ||
} else { | ||
this._panel_icon.resize(this.getPanelIconSize()) | ||
this._panel_icon.update(); | ||
if (this._panel_avatar == null) { | ||
this._panel_avatar = new UserWidget.Avatar(this._user, { iconSize: this.getPanelIconSize(St.IconType.FULLCOLOR) }); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong. |
||
} | ||
this._panel_icon_box.set_child(this._panel_avatar); | ||
this._panel_avatar.update(); | ||
this._panel_avatar.show(); | ||
} else { | ||
this._panel_icon_box.hide(); | ||
this._panel_icon = new St.Icon({ | ||
icon_name: 'avatar-default-symbolic', | ||
icon_size: this.getPanelIconSize(), | ||
This comment has been minimized.
Sorry, something went wrong.
anaximeno
Contributor
|
||
}); | ||
this._panel_icon_box.set_child(this._panel_icon); | ||
} | ||
} | ||
|
||
on_panel_height_changed() { | ||
this._updatePanelIcon(); | ||
} | ||
|
||
on_panel_icon_size_changed() { | ||
this._updatePanelIcon(); | ||
} | ||
|
||
on_applet_removed_from_panel() { | ||
this.settings.finalize(); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When updating the size of the colored icons on the panel it is not immediately reflecting on this, only when reloading the (user) applet.