From c44cd60ea271b383108dc3a53cb68c0d18257057 Mon Sep 17 00:00:00 2001 From: simon04 Date: Thu, 12 May 2011 12:10:42 +0200 Subject: [PATCH] Separate labels for weather parameters for alignment, formatting. --- weather@venemo.net/extension.js | 27 ++++++++++++++++++--------- weather@venemo.net/stylesheet.css | 6 ++++++ 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/weather@venemo.net/extension.js b/weather@venemo.net/extension.js index ea93712..83d0e5a 100644 --- a/weather@venemo.net/extension.js +++ b/weather@venemo.net/extension.js @@ -170,10 +170,10 @@ WeatherMenuButton.prototype = { this._currentWeatherSummary.text = comment; this._currentWeatherLocation.text = location; - this._currentWeatherTemperature.text = _('Temperature') + ': ' + temperature + ' ' + temperature_unit; - this._currentWeatherHumidity.text = _('Humidity') + ': ' + humidity; - this._currentWeatherPressure.text = _('Pressure') + ': ' + pressure + ' ' + pressure_unit; - this._currentWeatherWind.text = _('Wind') + ': ' + wind_direction + ' ' + wind + ' ' + wind_unit; + this._currentWeatherTemperature.text = temperature + ' ' + temperature_unit; + this._currentWeatherHumidity.text = humidity; + this._currentWeatherPressure.text = pressure + ' ' + pressure_unit; + this._currentWeatherWind.text = wind_direction + ' ' + wind + ' ' + wind_unit; // Repeatedly refresh weather here = this; @@ -228,11 +228,20 @@ WeatherMenuButton.prototype = { this._currentWeatherPressure = new St.Label({ text: _('Pressure') + ': ...' }); this._currentWeatherWind = new St.Label({ text: _('Wind') + ': ...' }); - let rb = new St.BoxLayout({vertical: true, style_class: 'weather-current-databox'}); - rb.add_actor(this._currentWeatherTemperature); - rb.add_actor(this._currentWeatherHumidity); - rb.add_actor(this._currentWeatherPressure); - rb.add_actor(this._currentWeatherWind); + let rb = new St.BoxLayout({style_class: 'weather-current-databox'}); + rb_captions = new St.BoxLayout({vertical: true, style_class: 'weather-current-databox-captions'}); + rb_values = new St.BoxLayout({vertical: true, style_class: 'weather-current-databox-values'}); + rb.add_actor(rb_captions); + rb.add_actor(rb_values); + + rb_captions.add_actor(new St.Label({text: _('Temperature:')})); + rb_values.add_actor(this._currentWeatherTemperature); + rb_captions.add_actor(new St.Label({text: _('Humidity:')})); + rb_values.add_actor(this._currentWeatherHumidity); + rb_captions.add_actor(new St.Label({text: _('Pressure:')})); + rb_values.add_actor(this._currentWeatherPressure); + rb_captions.add_actor(new St.Label({text: _('Wind:')})); + rb_values.add_actor(this._currentWeatherWind); let xb = new St.BoxLayout(); xb.add_actor(bb); diff --git a/weather@venemo.net/stylesheet.css b/weather@venemo.net/stylesheet.css index 04076cd..750cb9d 100644 --- a/weather@venemo.net/stylesheet.css +++ b/weather@venemo.net/stylesheet.css @@ -26,3 +26,9 @@ .weather-icon-rtl { padding-left: 5px; } + +.weather-current-databox-captions { + text-align: right; + padding-right: 5px; + color: #999999; +}