diff --git a/src/extension.js b/src/extension.js index 651c6f0..86203e6 100644 --- a/src/extension.js +++ b/src/extension.js @@ -173,16 +173,6 @@ WeatherMenuButton.prototype = { this.menu.addActor(mainBox); - /* TODO install script via Makefile - this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem()); - - let item = new PopupMenu.PopupMenuItem(_("Preferences...")); - item.connect('activate', function() { - Util.spawn(["weather-extension-configurator"]); - }); - this.menu.addMenuItem(item); - */ - // Items this.showLoadingUi(); @@ -196,6 +186,27 @@ WeatherMenuButton.prototype = { }, + getPreferencesIcon: function() { + let prefIcon = new St.Icon ({ + icon_type: this._icon_type, + icon_size: 16, + icon_name: 'system-run' + }); + let prefButton = new St.Button({ + style_class: 'panel-button' + }); + prefButton.connect('clicked', function() { + Util.spawn(["weather-extension-configurator"]); + }); + let prefBox = new St.BoxLayout({ + style_class: 'weather-config', + vertical: true + }); + prefButton.add_actor(prefIcon); + prefBox.add_actor(prefButton); + return prefBox; + }, + unit_to_url: function() { return this._units == WeatherUnits.FAHRENHEIT ? 'f' : 'c'; }, @@ -625,6 +636,7 @@ WeatherMenuButton.prototype = { let xb = new St.BoxLayout(); xb.add_actor(bb); xb.add_actor(rb); + xb.add_actor(this.getPreferencesIcon()); let box = new St.BoxLayout({ style_class: 'weather-current-iconbox' diff --git a/src/stylesheet.css b/src/stylesheet.css index cfddcaa..c79ffa6 100644 --- a/src/stylesheet.css +++ b/src/stylesheet.css @@ -46,3 +46,6 @@ font-size: 90%; } +.weather-config { + padding-right: 10px; +}