diff options
Diffstat (limited to 'debian/patches/add-support-for-gnome-3.34.patch')
-rw-r--r-- | debian/patches/add-support-for-gnome-3.34.patch | 95 |
1 files changed, 0 insertions, 95 deletions
diff --git a/debian/patches/add-support-for-gnome-3.34.patch b/debian/patches/add-support-for-gnome-3.34.patch deleted file mode 100644 index aa2ff28..0000000 --- a/debian/patches/add-support-for-gnome-3.34.patch +++ /dev/null @@ -1,95 +0,0 @@ -From: Bartosz Jaroszewski <b.jarosze@gmail.com> -Date: Sun, 7 Jun 2020 14:20:33 +0200 -Subject: add support for gnome 3.34 - ---- - metadata.json | 3 ++- - ui.js | 28 ++++++++++++++++++---------- - 2 files changed, 20 insertions(+), 11 deletions(-) - -diff --git a/metadata.json b/metadata.json -index bc3f83f..e710ffd 100644 ---- a/metadata.json -+++ b/metadata.json -@@ -6,6 +6,7 @@ - "settings-schema": "org.gnome.shell.extensions.bluetooth-quick-connect", - "gettext-domain": "bluetooth-quick-connect", - "shell-version": [ -- "3.36" -+ "3.36", -+ "3.34" - ] - } -diff --git a/ui.js b/ui.js -index e773f98..b2dc363 100644 ---- a/ui.js -+++ b/ui.js -@@ -20,11 +20,7 @@ const GObject = imports.gi.GObject; - const St = imports.gi.St; - const Tweener = imports.ui.tweener; - const PopupMenu = imports.ui.popupMenu; -- --const ExtensionUtils = imports.misc.extensionUtils; --const Me = ExtensionUtils.getCurrentExtension(); --const Utils = Me.imports.utils; -- -+const Config = imports.misc.config; - - var PopupBluetoothDeviceMenuItem = GObject.registerClass( - class PopupSwitchWithButtonMenuItem extends PopupMenu.PopupSwitchMenuItem { -@@ -42,6 +38,11 @@ var PopupBluetoothDeviceMenuItem = GObject.registerClass( - this._pendingLabel = this._buildPendingLabel(); - this._connectToggledEvent(); - -+ if (this._isOldGnome()) { -+ this.remove_child(this._statusBin); -+ this.add(this._statusBin, { expand: false }); -+ } -+ - this.insert_child_at_index(this._refreshButton, this.get_n_children() - 1); - this.add_child(this._pendingLabel); - -@@ -50,7 +51,7 @@ var PopupBluetoothDeviceMenuItem = GObject.registerClass( - - sync(device) { - this._device = device; -- this._switch.state = device.isConnected; -+ this._syncSwitch(device); - this.visible = device.isPaired; - if (this._showRefreshButton && device.isConnected) - this._refreshButton.show(); -@@ -58,6 +59,13 @@ var PopupBluetoothDeviceMenuItem = GObject.registerClass( - this._refreshButton.hide(); - } - -+ _syncSwitch(device) { -+ if (this._isOldGnome()) -+ return this._switch.setToggleState(device.isConnected); -+ -+ this._switch.state = device.isConnected; -+ } -+ - _buildRefreshButton() { - let icon = new St.Icon({ - icon_name: 'view-refresh', -@@ -144,10 +152,6 @@ var PopupBluetoothDeviceMenuItem = GObject.registerClass( - this._enablePending(); - } - -- hideRefreshButton() { -- this._refreshButton.hide(); -- } -- - _enablePending() { - this._refreshButton.reactive = false; - this._switch.hide(); -@@ -161,5 +165,9 @@ var PopupBluetoothDeviceMenuItem = GObject.registerClass( - this._pendingLabel.hide(); - this.reactive = true; - } -+ -+ _isOldGnome() { -+ return Config.PACKAGE_VERSION.match(/3\.3[24]/); -+ } - } - ); |