dateMenu: Re-indent weather section

Before making code changes, make sure the class confirms to the
new coding style.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1927
This commit is contained in:
Florian Müllner 2019-11-22 15:41:19 +01:00
parent d52b23dec3
commit 669d12f957

View File

@ -268,19 +268,25 @@ class WeatherSection extends St.Button {
this.child = box; this.child = box;
let titleBox = new St.BoxLayout(); let titleBox = new St.BoxLayout();
titleBox.add_child(new St.Label({ style_class: 'weather-header', titleBox.add_child(new St.Label({
x_align: Clutter.ActorAlign.START, style_class: 'weather-header',
x_expand: true, x_align: Clutter.ActorAlign.START,
text: _("Weather") })); x_expand: true,
text: _('Weather'),
}));
box.add_child(titleBox); box.add_child(titleBox);
this._titleLocation = new St.Label({ style_class: 'weather-header location', this._titleLocation = new St.Label({
x_align: Clutter.ActorAlign.END }); style_class: 'weather-header location',
x_align: Clutter.ActorAlign.END,
});
titleBox.add_child(this._titleLocation); 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({
layout_manager: layout }); style_class: 'weather-grid',
layout_manager: layout,
});
layout.hookup_style(this._forecastGrid); layout.hookup_style(this._forecastGrid);
box.add_child(this._forecastGrid); box.add_child(this._forecastGrid);
@ -341,16 +347,22 @@ class WeatherSection extends St.Button {
ampm: false, ampm: false,
}); });
let icon = new St.Icon({ style_class: 'weather-forecast-icon', let icon = new St.Icon({
icon_name: fc.get_symbolic_icon_name(), style_class: 'weather-forecast-icon',
x_align: Clutter.ActorAlign.CENTER, icon_name: fc.get_symbolic_icon_name(),
x_expand: true }); x_align: Clutter.ActorAlign.CENTER,
let temp = new St.Label({ style_class: 'weather-forecast-temp', x_expand: true,
text: fc.get_temp_summary(), });
x_align: Clutter.ActorAlign.CENTER }); let temp = new St.Label({
let time = new St.Label({ style_class: 'weather-forecast-time', style_class: 'weather-forecast-temp',
text: timeStr, text: fc.get_temp_summary(),
x_align: Clutter.ActorAlign.CENTER }); x_align: Clutter.ActorAlign.CENTER,
});
let time = new St.Label({
style_class: 'weather-forecast-time',
text: timeStr,
x_align: Clutter.ActorAlign.CENTER,
});
layout.attach(icon, col, 0, 1, 1); layout.attach(icon, col, 0, 1, 1);
layout.attach(temp, col, 1, 1, 1); layout.attach(temp, col, 1, 1, 1);