Skip to content

Commit

Permalink
Merge pull request #9 from Tamas-Toth-ebola/master
Browse files Browse the repository at this point in the history
GNOME Shell 3.38 fixes and more...
  • Loading branch information
lachhebo committed Nov 2, 2020
2 parents 3a6f0e0 + b14ad22 commit 161c448
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 30 deletions.
7 changes: 5 additions & 2 deletions EXTENSIONS.GNOME.ORG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# corona-tracker

This file contains in one place all the required data of the GNOME Shell extension for extensions.gnome.org website to make perfect control of them and keep it in every aspect the up-to-date extraction of main README document.

## Homepage

https://github.com/lachhebo/corona-tracker
Expand Down Expand Up @@ -35,8 +37,9 @@ GNU - General Public License v3+: https://www.gnu.org/licenses/gpl-3.0.en.html
----- MORE DETAILS -----
https://github.com/lachhebo/corona-tracker/blob/master/README.md
GENERAL INFO: https://github.com/lachhebo/corona-tracker
RELEASE NOTES: https://github.com/lachhebo/corona-tracker/releases
```

---
[^1]: HighRes official GNOME Shell extension like puzzle in GNOME HIG color palette '**Green 5**' color *(#3d3846)* with the extension's GNOME Panel icon in GNOME HIG color palette '**Dark 3**' color *(#3d3846)* rendered in 256x256px with 16px margin.
[^1]: HighRes official GNOME Shell extension like puzzle in GNOME HIG color palette '**Green 5**' color *(#3d3846)* with the extension's GNOME Panel icon in GNOME HIG color palette '**Light 3**' color *(#deddda)* rendered in 256x256px with 16px margin.
31 changes: 8 additions & 23 deletions extension.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Imports

const St = imports.gi.St;
const Gio = imports.gi.Gio; // Just for custom icon
const Main = imports.ui.main;
const Tweener = imports.ui.tweener;

const Tweener = imports.tweener.tweener;

const Lang = imports.lang;
const PanelMenu = imports.ui.panelMenu;
Expand All @@ -29,7 +29,6 @@ const LOOP_UPDATE_TIME = 60*60*12; // every 12 hour, the result will be updated

// Functions


const CoronaItem = new Lang.Class({
Name: 'CoronaItem',
Extends: PopupMenu.PopupBaseMenuItem,
Expand All @@ -38,12 +37,11 @@ const CoronaItem = new Lang.Class({
this.parent();
this.connect('activate', function () {
});
this._label = label;
this._value = value;
this._label = new St.Label({text: label}); // Restructured as StBoxLayout's child meta was deprecated in 3.36 and removed in 3.38.
this._value = new St.Label({text: value}, {x_align: St.Align.END}); // Restructured as StBoxLayout's child meta was deprecated in 3.36 and removed in 3.38.


this.actor.add(new St.Label({text: label}));
this.actor.add(new St.Label({text: value}), {align: St.Align.END});
this.actor.add(this._label); // Restructured as StBoxLayout's child meta was deprecated in 3.36 and removed in 3.38.
this.actor.add(this._value); // Restructured as StBoxLayout's child meta was deprecated in 3.36 and removed in 3.38.
if(type){
this.actor.add(new St.Icon({ icon_name: type, icon_size : 12})); // COVID-19 panel icons
}
Expand All @@ -62,9 +60,6 @@ const CoronaItem = new Lang.Class({
},
});




const CoronaMenuButton = new Lang.Class({
Name: 'CoronaMenuButton',
Extends: PanelMenu.Button,
Expand Down Expand Up @@ -108,12 +103,10 @@ const CoronaMenuButton = new Lang.Class({

},


_fetchSettings: function () {
COUNTRY_NAME = this._settings.get_string(Prefs.Fields.COUNTRY_NAME);
},


_onSettingsChange: function () {
var that = this;

Expand All @@ -123,7 +116,6 @@ const CoronaMenuButton = new Lang.Class({

},


_get_soup_session: function() {
if(_SESSION === null) {
_SESSION = new Soup.Session();
Expand All @@ -136,7 +128,7 @@ const CoronaMenuButton = new Lang.Class({
}

return _SESSION;
},
},

_queryAPI: function(){
let request;
Expand All @@ -151,7 +143,6 @@ const CoronaMenuButton = new Lang.Class({
this._updateDisplay(result);
},


_updateDisplay: function(result){
this.menu.removeAll();
let section = new PopupMenu.PopupMenuSection("COVID");
Expand Down Expand Up @@ -179,7 +170,6 @@ const CoronaMenuButton = new Lang.Class({
let death_proportion = new CoronaItem(null, 'Deaths / 1M pop:', result.deathsPerOneMillion.toLocaleString());
let separator3 = new PopupMenu.PopupSeparatorMenuItem();


total_case.setMainSensor();
section.addMenuItem(total_case);
proportion.setMainSensor();
Expand Down Expand Up @@ -229,19 +219,15 @@ const CoronaMenuButton = new Lang.Class({

},


_openSettings: function () {
Util.spawn([
"gnome-shell-extension-prefs",
Me.uuid
]);
},


});



let coronaMenu;

function init() {
Expand All @@ -252,8 +238,7 @@ function enable() {
Main.panel.addToStatusArea('coronaMenu', coronaMenu, 1, 'right');
}


function disable() {
coronaMenu.destroy();
coronaMenu = null;
}
}
16 changes: 11 additions & 5 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
{
"name": "corona-tracker",
"uuid": "[email protected]",
"description": "A GNOME Shell extension (GNOME Panel applet) to notify you every day with information about the COVID-19 virus spread.",
"name": "corona-tracker",
"shell-version": [
"3.30",
"3.34",
"3.32",
"3.36",
"3.38"
],
"url": "https://github.com/lachhebo/corona-tracker",
"version": 8,
"shell-version": ["3.30", "3.32", "3.34", "3.36", "3.38"]
}
"uuid": "[email protected]",
"version": 10
}
Binary file modified resources/extensions.gnome.org.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 161c448

Please sign in to comment.