From 712bd6458eb15a595d25948c7539a7215fd103fb Mon Sep 17 00:00:00 2001 From: Jens Lody Date: Tue, 15 Oct 2013 06:42:59 +0200 Subject: [PATCH] Compatibility with gnome-shell 3.10 --- data/metadata.json.in | 2 +- data/stylesheet.css | 6 +++--- src/extension.js | 10 +++++++--- src/prefs.js | 7 ++++--- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/data/metadata.json.in b/data/metadata.json.in index de5c899..73513f1 100644 --- a/data/metadata.json.in +++ b/data/metadata.json.in @@ -2,7 +2,7 @@ "uuid": "@uuid@", "name": "Weather", "description": "A simple extension for displaying weather information from several cities in GNOME Shell", -"shell-version": [ "3.4", "3.5", "3.6" ], +"shell-version": [ "3.4", "3.5", "3.6", "3.8", "3.10" ], "localedir": "@LOCALEDIR@", "url": "@url@" } diff --git a/data/stylesheet.css b/data/stylesheet.css index fe991ac..34362c2 100644 --- a/data/stylesheet.css +++ b/data/stylesheet.css @@ -7,11 +7,11 @@ } .weather-current-databox { - padding: 5px 15px 0px 30px; + padding: 5px 15px 0px; } .weather-current-icon { - padding: 0px 30px; + padding-right: 30px; } .weather-current-iconbox { @@ -33,7 +33,7 @@ } .weather-forecast-icon { - padding: 0 15px 0px 25px; + padding-right: 15px; } .weather-forecast-databox { diff --git a/src/extension.js b/src/extension.js index fe2a383..c9a8db2 100644 --- a/src/extension.js +++ b/src/extension.js @@ -196,12 +196,16 @@ const WeatherMenuButton = new Lang.Class({ this._futureWeather = new St.Bin({ style_class: 'forecast'}); // Putting the popup item together - this.menu.addActor(this._currentWeather); + this._itemCurrent = new PopupMenu.PopupBaseMenuItem({reactive:false,style_class: 'current'}); + this._itemCurrent.actor.add_actor(this._currentWeather); + this.menu.addMenuItem(this._itemCurrent); let item = new PopupMenu.PopupSeparatorMenuItem(); this.menu.addMenuItem(item); - this.menu.addActor(this._futureWeather); + this._itemFuture = new PopupMenu.PopupBaseMenuItem({reactive:false,style_class: 'forecast'}); + this._itemFuture.actor.add_actor(this._futureWeather); + this.menu.addMenuItem(this._itemFuture); let item = new PopupMenu.PopupSeparatorMenuItem(); this.menu.addMenuItem(item); @@ -517,7 +521,7 @@ const WeatherMenuButton = new Lang.Class({ item = new PopupMenu.PopupMenuItem(this.extractLocation(cities[i])); item.location = i; if(i == this._actual_city) - item.setShowDot(true); + item.setOrnament(PopupMenu.Ornament.DOT); this._selectCity.menu.addMenuItem(item); item.connect('activate', function(actor,event) { diff --git a/src/prefs.js b/src/prefs.js index ac9aa4c..ad3f25e 100644 --- a/src/prefs.js +++ b/src/prefs.js @@ -280,7 +280,8 @@ Extends: Gtk.Box, let entry = new Gtk.Entry(); let completion = new Gtk.EntryCompletion(); entry.set_completion(completion); - let completionModel = new Gtk.ListStore.new([GObject.TYPE_STRING]); + let completionModel = new Gtk.ListStore; + completionModel.set_column_types([GObject.TYPE_STRING]); completion.set_model(completionModel); completion.set_text_column(0); completion.set_popup_single_match(true); @@ -501,14 +502,14 @@ Extends: Gtk.Box, let path = this.actual_city; if(arguments[0]) path = arguments[0]; - path = new Gtk.TreePath.new_from_string(String(path)); + path = Gtk.TreePath.new_from_string(String(path)); this.treeview.get_selection().select_path(path); }, loadJsonAsync : function(url, fun, id) { let here = this; - let message = new Soup.Message.new('GET', url); + let message = Soup.Message.new('GET', url); if(typeof this.asyncSession == "undefined") this.asyncSession = {};