fixes after test on GS 3.24
* use var to export extensionJs.manager
* remove duplicated (old) buildPrefsWidget
* set OsdWindow.HIDE_TIMEOUT in a try/catch because HIDE_TIMEOUT is not exported with 'var'
* capture i in callbacks in for(){} (i is changing)
* add 3.24 version as supported
This commit is contained in:
parent
fbd6ad709c
commit
6dd552ae7e
8
draw.js
8
draw.js
|
|
@ -1230,9 +1230,10 @@ var DrawingMenu = new Lang.Class({
|
||||||
else
|
else
|
||||||
text = _(obj[i]);
|
text = _(obj[i]);
|
||||||
|
|
||||||
|
let iCaptured = i;
|
||||||
let subItem = item.menu.addAction(text, () => {
|
let subItem = item.menu.addAction(text, () => {
|
||||||
item.label.set_text(_(obj[i]));
|
item.label.set_text(_(obj[iCaptured]));
|
||||||
target[targetProperty] = i;
|
target[targetProperty] = iCaptured;
|
||||||
if (callback)
|
if (callback)
|
||||||
callback();
|
callback();
|
||||||
});
|
});
|
||||||
|
|
@ -1256,8 +1257,9 @@ var DrawingMenu = new Lang.Class({
|
||||||
Mainloop.timeout_add(0, () => {
|
Mainloop.timeout_add(0, () => {
|
||||||
for (let i = 1; i < this.area.colors.length; i++) {
|
for (let i = 1; i < this.area.colors.length; i++) {
|
||||||
let text = `<span foreground="${this.area.colors[i].to_string()}">${this.area.colors[i].to_string()}</span>`;
|
let text = `<span foreground="${this.area.colors[i].to_string()}">${this.area.colors[i].to_string()}</span>`;
|
||||||
|
let iCaptured = i;
|
||||||
let colorItem = item.menu.addAction(text, () => {
|
let colorItem = item.menu.addAction(text, () => {
|
||||||
this.area.currentColor = this.area.colors[i];
|
this.area.currentColor = this.area.colors[iCaptured];
|
||||||
item.icon.set_style(`color:${this.area.currentColor.to_string().slice(0, 7)};`);
|
item.icon.set_style(`color:${this.area.currentColor.to_string().slice(0, 7)};`);
|
||||||
});
|
});
|
||||||
colorItem.label.get_clutter_text().set_use_markup(true);
|
colorItem.label.get_clutter_text().set_use_markup(true);
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ var DRAWING_ACTION_MODE = Math.pow(2,14);
|
||||||
// use 'login-dialog-message-warning' class in order to get GS theme warning color (default: #f57900)
|
// use 'login-dialog-message-warning' class in order to get GS theme warning color (default: #f57900)
|
||||||
var WARNING_COLOR_STYLE_CLASS_NAME = 'login-dialog-message-warning';
|
var WARNING_COLOR_STYLE_CLASS_NAME = 'login-dialog-message-warning';
|
||||||
|
|
||||||
let manager;
|
var manager;
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
Convenience.initTranslations();
|
Convenience.initTranslations();
|
||||||
|
|
@ -193,11 +193,12 @@ var AreaManager = new Lang.Class({
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let i = 1; i < 10; i++) {
|
for (let i = 1; i < 10; i++) {
|
||||||
|
let iCaptured = i;
|
||||||
Main.wm.addKeybinding('select-color' + i,
|
Main.wm.addKeybinding('select-color' + i,
|
||||||
this.settings,
|
this.settings,
|
||||||
Meta.KeyBindingFlags.NONE,
|
Meta.KeyBindingFlags.NONE,
|
||||||
DRAWING_ACTION_MODE,
|
DRAWING_ACTION_MODE,
|
||||||
() => this.activeArea.selectColor(i));
|
() => this.activeArea.selectColor(iCaptured));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -303,9 +304,9 @@ var AreaManager = new Lang.Class({
|
||||||
if (!this.osdDisabled) {
|
if (!this.osdDisabled) {
|
||||||
// increase OSD display time
|
// increase OSD display time
|
||||||
let hideTimeoutSave = OsdWindow.HIDE_TIMEOUT;
|
let hideTimeoutSave = OsdWindow.HIDE_TIMEOUT;
|
||||||
OsdWindow.HIDE_TIMEOUT = 2000;
|
try { OsdWindow.HIDE_TIMEOUT = 2000; } catch(e) { /* HIDE_TIMEOUT is not exported with 'var' */ }
|
||||||
Main.osdWindowManager.show(currentIndex, this.enterGicon, _("Press Ctrl + F1 for help") + "\n\n" + _("Entering drawing mode"), null);
|
Main.osdWindowManager.show(currentIndex, this.enterGicon, _("Press Ctrl + F1 for help") + "\n\n" + _("Entering drawing mode"), null);
|
||||||
OsdWindow.HIDE_TIMEOUT = hideTimeoutSave;
|
try { OsdWindow.HIDE_TIMEOUT = hideTimeoutSave; } catch(e) {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@
|
||||||
"settings-schema": "org.gnome.shell.extensions.draw-on-your-screen",
|
"settings-schema": "org.gnome.shell.extensions.draw-on-your-screen",
|
||||||
"gettext-domain": "draw-on-your-screen",
|
"gettext-domain": "draw-on-your-screen",
|
||||||
"shell-version": [
|
"shell-version": [
|
||||||
|
"3.24",
|
||||||
"3.26",
|
"3.26",
|
||||||
"3.28",
|
"3.28",
|
||||||
"3.30",
|
"3.30",
|
||||||
|
|
|
||||||
6
prefs.js
6
prefs.js
|
|
@ -88,12 +88,6 @@ function init() {
|
||||||
Convenience.initTranslations();
|
Convenience.initTranslations();
|
||||||
}
|
}
|
||||||
|
|
||||||
function buildPrefsWidget() {
|
|
||||||
let prefsPage = new PrefsPage();
|
|
||||||
prefsPage.show_all();
|
|
||||||
return prefsPage;
|
|
||||||
}
|
|
||||||
|
|
||||||
function buildPrefsWidget() {
|
function buildPrefsWidget() {
|
||||||
let topStack = new TopStack();
|
let topStack = new TopStack();
|
||||||
let switcher = new Gtk.StackSwitcher({halign: Gtk.Align.CENTER, visible: true, stack: topStack});
|
let switcher = new Gtk.StackSwitcher({halign: Gtk.Align.CENTER, visible: true, stack: topStack});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue