Use full-colored icons by default, symbolic icons configurable.

yahoo_weather
simon04 14 years ago
parent 9ee242cfe0
commit c18ae6b751
  1. 17
      README.md
  2. 8
      src/extension.js
  3. 5
      src/org.gnome.shell.extensions.weather.gschema.xml.in

@ -42,7 +42,7 @@ You can specify your location buy using this command:
gsettings set org.gnome.shell.extensions.weather woeid your_woeid
```
#### Temperature units (optional, celsius by default)
#### Temperature Units (optional, celsius by default)
You can modify the temperature unit with one of the following commands:
@ -51,7 +51,7 @@ gsettings set org.gnome.shell.extensions.weather unit celsius
gsettings set org.gnome.shell.extensions.weather unit fahrenheit
```
#### Displayed location (optional)
#### Displayed Location (optional)
Sometimes your WOEID location isn't quite right (it's the next major city around). To customise the displayed city you can type:
@ -59,7 +59,7 @@ Sometimes your WOEID location isn't quite right (it's the next major city around
gsettings set org.gnome.shell.extensions.weather city your_city
```
#### Translate weather conditions (optional, true by default)
#### Translate Weather Conditions (optional, true by default)
You may want to configure whether to translate the weather condition. If enabled, the condition is translated based on the weather code. If disabled, the condition string from Yahoo is taken. Note: Enabling the translation sometimes results in loss of accuracy, e.g., the condition string "PM Thunderstorms" cannot be expressed in terms of weather codes.
@ -68,7 +68,16 @@ gsettings set org.gnome.shell.extensions.weather translate-condition true
gsettings set org.gnome.shell.extensions.weather translate-condition false
```
#### Restart Gnome-Shell
#### Use Symbolic Icons (optional, false by default)
If desired, you can enable the usage of symbolic icons to display the weather condition (instead of full-colored icons).
```bash
gsettings set org.gnome.shell.extensions.weather use-symbolic-icons false
gsettings set org.gnome.shell.extensions.weather use-symbolic-icons true
```
#### Restart GNOME Shell
Don't forget to restart GNOME Shell:

@ -52,6 +52,7 @@ const WEATHER_UNIT_KEY = 'unit';
const WEATHER_CITY_KEY = 'city';
const WEATHER_WOEID_KEY = 'woeid';
const WEATHER_TRANSLATE_CONDITION_KEY = 'translate-condition';
const WEATHER_SYMBOLIC_ICONS = 'use-symbolic-icons';
// Keep enums in sync with GSettings schemas
const WeatherUnits = {
@ -79,10 +80,11 @@ WeatherMenuButton.prototype = {
this._city = this._settings.get_string(WEATHER_CITY_KEY);
this._woeid = this._settings.get_string(WEATHER_WOEID_KEY);
this._translate_condition = this._settings.get_boolean(WEATHER_TRANSLATE_CONDITION_KEY);
this._icontype = this._settings.get_boolean(WEATHER_SYMBOLIC_ICONS) ? St.IconType.SYMBOLIC : St.IconType.FULLCOLOR;
// Panel icon
this._weatherIcon = new St.Icon({
icon_type: St.IconType.SYMBOLIC,
icon_type: this._icontype,
icon_size: Main.panel.button.get_child().height,
icon_name: 'view-refresh-symbolic',
style_class: 'weather-icon' + (Main.panel.actor.get_direction() == St.TextDirection.RTL ? '-rtl' : '')
@ -487,7 +489,7 @@ WeatherMenuButton.prototype = {
// This will hold the icon for the current weather
this._currentWeatherIcon = new St.Icon({
icon_type: St.IconType.SYMBOLIC,
icon_type: this._icontype,
icon_size: 64,
icon_name: 'view-refresh-symbolic',
style_class: 'weather-current-icon'
@ -560,7 +562,7 @@ WeatherMenuButton.prototype = {
let forecastWeather = {};
forecastWeather.Icon = new St.Icon({
icon_type: St.IconType.SYMBOLIC,
icon_type: this._icontype,
icon_size: 48,
icon_name: 'view-refresh-symbolic',
style_class: 'weather-forecast-icon'

@ -24,5 +24,10 @@
<_summary>Whether to translate the weather condition</_summary>
<_description>Whether to translate the weather condition. If enabled, the condition is translated based on the weather code. If disabled, the condition string from Yahoo is taken. Note: Enabling the translation sometimes results in loss of accuracy, e.g., the condition string "PM Thunderstorms" cannot be expressed in terms of weather codes.</_description>
</key>
<key name="use-symbolic-icons" type="b">
<default>false</default>
<_summary>Whether to use symbolic icons</_summary>
<_description>Whether to use symbolic icons instead of full-colored icons.</_description>
</key>
</schema>
</schemalist>

Loading…
Cancel
Save