[gnome-shell] dateMenu: Update empty weather label
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] dateMenu: Update empty weather label
- Date: Thu, 9 Apr 2020 14:00:44 +0000 (UTC)
commit da0c7fc2b69beda3134e0142e9bdf94d059b6581
Author: Mariana Picolo <marianapicolo hotmail com>
Date: Sun Apr 5 04:39:02 2020 -0300
dateMenu: Update empty weather label
Remove subtitle for the empty weather state
to match world clocks button.
https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2179
js/ui/dateMenu.js | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/js/ui/dateMenu.js b/js/ui/dateMenu.js
index ca9611f2de..bee755c9a9 100644
--- a/js/ui/dateMenu.js
+++ b/js/ui/dateMenu.js
@@ -281,13 +281,13 @@ class WeatherSection extends St.Button {
this.child = box;
let titleBox = new St.BoxLayout({ style_class: 'weather-header-box' });
- titleBox.add_child(new St.Label({
+ this._titleLabel = new St.Label({
style_class: 'weather-header',
x_align: Clutter.ActorAlign.START,
x_expand: true,
y_align: Clutter.ActorAlign.END,
- text: _('Weather'),
- }));
+ });
+ titleBox.add_child(this._titleLabel);
box.add_child(titleBox);
this._titleLocation = new St.Label({
@@ -414,10 +414,8 @@ class WeatherSection extends St.Button {
_updateForecasts() {
this._forecastGrid.destroy_all_children();
- if (!this._weatherClient.hasLocation) {
- this._setStatusLabel(_("Select a location…"));
+ if (!this._weatherClient.hasLocation)
return;
- }
const { info } = this._weatherClient;
this._titleLocation.text = this._findBestLocationName(info.location);
@@ -444,6 +442,12 @@ class WeatherSection extends St.Button {
if (!this.visible)
return;
+ if (this._weatherClient.hasLocation)
+ this._titleLabel.text = _('Weather');
+ else
+ this._titleLabel.text = _('Select weather location…');
+
+ this._forecastGrid.visible = this._weatherClient.hasLocation;
this._titleLocation.visible = this._weatherClient.hasLocation;
this._updateForecasts();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]