Allow placement on left (thanks to Miguel Aguilar Molina).

yahoo_weather
simon04 14 years ago
parent 7f9de73e61
commit b3669179cd
  1. 7
      README.md
  2. 14
      src/extension.js
  3. 3
      src/org.gnome.shell.extensions.weather.gschema.xml.in

@ -10,7 +10,7 @@ Currently, the weather report including forecast for today and tomorrow is fetch
![Screenshot](gnome-shell-extension-weather/raw/master/data/screenshot.png)
And with French translation:
And with French translation:
![Screenshot](gnome-shell-extension-weather/raw/master/data/screenshot2.png)
@ -23,7 +23,7 @@ For installation, run the following commands:
./autogen.sh --prefix=/usr
make
sudo make install
That's it!
----
@ -81,9 +81,10 @@ Configures whether to show the comment (aka. weather condition text, e.g. "Windy
#### Position in Panel (optional, center by default)
The position of this GNOME Shell extension in the panel can be configured to either 'center' or 'right' (requires restart of GNOME Shell).
The position of this GNOME Shell extension in the panel can be configured to either 'left', 'center' or 'right' (requires restart of GNOME Shell).
gsettings set org.gnome.shell.extensions.weather position-in-panel center
gsettings set org.gnome.shell.extensions.weather position-in-panel left
gsettings set org.gnome.shell.extensions.weather position-in-panel right
#### Restart GNOME Shell

@ -62,7 +62,8 @@ const WeatherUnits = {
}
const WeatherPosition = {
CENTER: 0,
RIGHT: 1
RIGHT: 1,
LEFT: 2
}
function WeatherMenuButton() {
@ -137,13 +138,18 @@ WeatherMenuButton.prototype = {
if (this._text_in_panel)
topBox.add_actor(this._weatherInfo);
this.actor.set_child(topBox);
let children = null;
switch (this._position_in_panel) {
case WeatherPosition.CENTER:
case WeatherPosition.LEFT:
children = Main.panel._leftBox.get_children();
Main.panel._leftBox.insert_actor (this.actor, children.length-1);
break;
case WeatherPosition.CENTER:
Main.panel._centerBox.add(this.actor, { y_fill: true });
break;
case WeatherPosition.RIGHT:
let children = Main.panel._rightBox.get_children();
children = Main.panel._rightBox.get_children();
Main.panel._rightBox.insert_actor(this.actor, children.length-1);
break;
}

@ -6,6 +6,7 @@
<enum id="org.gnome.shell.extensions.weather.position">
<value nick="center" value="0" />
<value nick="right" value="1" />
<value nick="left" value="2" />
</enum>
<schema id="org.gnome.shell.extensions.weather" path="/org/gnome/shell/extensions/weather/">
<key name="unit" enum="org.gnome.shell.extensions.weather.unit">
@ -46,7 +47,7 @@
<key name="position-in-panel" enum="org.gnome.shell.extensions.weather.position">
<default>'center'</default>
<_summary>Position in panel</_summary>
<_description>Set the position of this GNOME Shell extension in the panel to either 'center' or 'right' (requires restart).</_description>
<_description>Set the position of this GNOME Shell extension in the panel to either 'center', 'left' or 'right' (requires restart).</_description>
</key>
</schema>
</schemalist>

Loading…
Cancel
Save