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