dateMenu: Show weather location in section header
It is useful information, in particular when the location is set automatically via geoclue. https://gitlab.gnome.org/GNOME/gnome-shell/issues/262
This commit is contained in:
parent
5dedb97fcc
commit
3cf67b1236
@ -922,6 +922,11 @@ StScrollBar {
|
|||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.weather-header.location {
|
||||||
|
font-weight: normal;
|
||||||
|
font-size: 0.9em;
|
||||||
|
}
|
||||||
|
|
||||||
.world-clocks-grid,
|
.world-clocks-grid,
|
||||||
.weather-grid {
|
.weather-grid {
|
||||||
spacing-rows: 0.4em;
|
spacing-rows: 0.4em;
|
||||||
|
@ -218,9 +218,16 @@ var WeatherSection = class WeatherSection {
|
|||||||
|
|
||||||
this.actor.child = box;
|
this.actor.child = box;
|
||||||
|
|
||||||
box.add_child(new St.Label({ style_class: 'weather-header',
|
let titleBox = new St.BoxLayout();
|
||||||
x_align: Clutter.ActorAlign.START,
|
titleBox.add_child(new St.Label({ style_class: 'weather-header',
|
||||||
text: _("Weather") }));
|
x_align: Clutter.ActorAlign.START,
|
||||||
|
x_expand: true,
|
||||||
|
text: _("Weather") }));
|
||||||
|
box.add_child(titleBox);
|
||||||
|
|
||||||
|
this._titleLocation = new St.Label({ style_class: 'weather-header location',
|
||||||
|
x_align: Clutter.ActorAlign.END });
|
||||||
|
titleBox.add_child(this._titleLocation);
|
||||||
|
|
||||||
let layout = new Clutter.GridLayout({ orientation: Clutter.Orientation.VERTICAL });
|
let layout = new Clutter.GridLayout({ orientation: Clutter.Orientation.VERTICAL });
|
||||||
this._forecastGrid = new St.Widget({ style_class: 'weather-grid',
|
this._forecastGrid = new St.Widget({ style_class: 'weather-grid',
|
||||||
@ -302,12 +309,14 @@ var WeatherSection = class WeatherSection {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let info = this._weatherClient.info;
|
||||||
|
this._titleLocation.text = info.get_location().get_name();
|
||||||
|
|
||||||
if (this._weatherClient.loading) {
|
if (this._weatherClient.loading) {
|
||||||
this._setStatusLabel(_("Loading…"));
|
this._setStatusLabel(_("Loading…"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let info = this._weatherClient.info;
|
|
||||||
if (info.is_valid()) {
|
if (info.is_valid()) {
|
||||||
this._addForecasts();
|
this._addForecasts();
|
||||||
return;
|
return;
|
||||||
@ -325,6 +334,8 @@ var WeatherSection = class WeatherSection {
|
|||||||
if (!this.actor.visible)
|
if (!this.actor.visible)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
this._titleLocation.visible = this._weatherClient.hasLocation;
|
||||||
|
|
||||||
this._updateForecasts();
|
this._updateForecasts();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user