loginDialog: Split out getBannerText() helper
The new methods will make it easier to add alternative sources for the banner text. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3558>
This commit is contained in:
parent
52256a3b4a
commit
f328eee88c
@ -873,11 +873,18 @@ export const LoginDialog = GObject.registerClass({
|
|||||||
this._authPrompt.cancelButton.visible = cancelVisible;
|
this._authPrompt.cancelButton.visible = cancelVisible;
|
||||||
}
|
}
|
||||||
|
|
||||||
_updateBanner() {
|
_getBannerText() {
|
||||||
let enabled = this._settings.get_boolean(GdmUtil.BANNER_MESSAGE_KEY);
|
const enabled = this._settings.get_boolean(GdmUtil.BANNER_MESSAGE_KEY);
|
||||||
let text = this._settings.get_string(GdmUtil.BANNER_MESSAGE_TEXT_KEY);
|
if (!enabled)
|
||||||
|
return null;
|
||||||
|
|
||||||
if (enabled && text) {
|
return this._settings.get_string(GdmUtil.BANNER_MESSAGE_TEXT_KEY);
|
||||||
|
}
|
||||||
|
|
||||||
|
_updateBanner() {
|
||||||
|
const text = this._getBannerText();
|
||||||
|
|
||||||
|
if (text) {
|
||||||
this._bannerLabel.set_text(text);
|
this._bannerLabel.set_text(text);
|
||||||
this._bannerLabel.show();
|
this._bannerLabel.show();
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user