Added setting whether to show text in panel.

yahoo_weather
simon04 13 years ago
parent 57f6878d4b
commit eb1302f599
  1. 7
      README.md
  2. 3
      src/extension.js
  3. 5
      src/org.gnome.shell.extensions.weather.gschema.xml.in

@ -65,6 +65,13 @@ If desired, you can enable the usage of symbolic icons to display the weather co
gsettings set org.gnome.shell.extensions.weather use-symbolic-icons false
gsettings set org.gnome.shell.extensions.weather use-symbolic-icons true
#### Show Text in Panel (optional, true by default)
You can configure whether to show the weather condition text together with the temperature in the panel (requires restart of GNOME Shell).
gsettings set org.gnome.shell.extensions.weather show-text-in-panel true
gsettings set org.gnome.shell.extensions.weather show-text-in-panel false
#### Restart GNOME Shell
Don't forget to restart GNOME Shell:

@ -54,6 +54,7 @@ const WEATHER_CITY_KEY = 'city';
const WEATHER_WOEID_KEY = 'woeid';
const WEATHER_TRANSLATE_CONDITION_KEY = 'translate-condition';
const WEATHER_SYMBOLIC_ICONS = 'use-symbolic-icons';
const WEATHER_SHOW_TEXT_IN_PANEL_KEY = 'show-text-in-panel';
// Keep enums in sync with GSettings schemas
const WeatherUnits = {
@ -82,6 +83,7 @@ WeatherMenuButton.prototype = {
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;
this._text_in_panel = this._settings.get_boolean(WEATHER_SHOW_TEXT_IN_PANEL_KEY);
// Watch settings for changes
let load_settings_and_refresh_weather = Lang.bind(this, function() {
@ -125,6 +127,7 @@ WeatherMenuButton.prototype = {
// Putting the panel item together
let topBox = new St.BoxLayout();
topBox.add_actor(this._weatherIcon);
if (this._text_in_panel)
topBox.add_actor(this._weatherInfo);
this.actor.set_child(topBox);
Main.panel._centerBox.add(this.actor, { y_fill: true });

@ -29,5 +29,10 @@
<_summary>Whether to use symbolic icons</_summary>
<_description>Whether to use symbolic icons instead of full-colored icons.</_description>
</key>
<key name="show-text-in-panel" type="b">
<default>true</default>
<_summary>Whether to show the text in the panel.</_summary>
<_description>Whether to show the weather condition text together with the temperature in the panel (requires restart).</_description>
</key>
</schema>
</schemalist>

Loading…
Cancel
Save