[gnome-shell/gbsneto/remove-generic-container: 17/25] boxPointer: Add compatibility API
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/gbsneto/remove-generic-container: 17/25] boxPointer: Add compatibility API
- Date: Sun, 30 Sep 2018 18:14:05 +0000 (UTC)
commit ffe39db197b99cf8ba6b827df20601de7bf37cee
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Fri Jul 27 13:15:16 2018 -0300
boxPointer: Add compatibility API
Because we're late in the cycle, and don't know how many
extensions actually rely on this API, this commit adds
back the BoxPointer.show() and .hide() functions, with
warning messages to notify consumers that this is going
to be removed.
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/153
js/ui/boxpointer.js | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
---
diff --git a/js/ui/boxpointer.js b/js/ui/boxpointer.js
index acb1487b6..f9394e3a7 100644
--- a/js/ui/boxpointer.js
+++ b/js/ui/boxpointer.js
@@ -80,6 +80,36 @@ var BoxPointer = new Lang.Class({
}
},
+ // BoxPointer.show() and BoxPointer.hide() are here for only compatibility
+ // purposes, and will be removed in 3.32.
+ show(animate, onComplete) {
+ if (animate !== undefined) {
+ try {
+ throw new Error('BoxPointer.show() has been moved to BoxPointer.open(), this code will break
in the future.');
+ } catch(e) {
+ logError(e);
+ this.open(animate, onComplete);
+ return;
+ }
+ }
+
+ this.visible = true;
+ },
+
+ hide(animate, onComplete) {
+ if (animate !== undefined) {
+ try {
+ throw new Error('BoxPointer.hide() has been moved to BoxPointer.close(), this code will
break in the future.');
+ } catch(e) {
+ logError(e);
+ this.close(animate, onComplete);
+ return;
+ }
+ }
+
+ this.visible = false;
+ },
+
open(animate, onComplete) {
let themeNode = this.actor.get_theme_node();
let rise = themeNode.get_length('-arrow-rise');
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]