[gnome-shell] keyboard: Use camelCase
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] keyboard: Use camelCase
- Date: Wed, 4 Dec 2019 21:50:20 +0000 (UTC)
commit 85f10f1f6afa149c06b95f999b57e9d4ac537512
Author: Florian Müllner <fmuellner gnome org>
Date: Wed Dec 4 18:51:08 2019 +0100
keyboard: Use camelCase
Those aren't GObject properties, so should follow the regular JS style.
https://gitlab.gnome.org/GNOME/gnome-shell/issues/1976
js/ui/keyboard.js | 34 ++++++++++++++++++----------------
1 file changed, 18 insertions(+), 16 deletions(-)
---
diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js
index 708a52fb65..a0483cc8a7 100644
--- a/js/ui/keyboard.js
+++ b/js/ui/keyboard.js
@@ -269,8 +269,8 @@ var Key = GObject.registerClass({
this.add_child(this.keyButton);
this.connect('destroy', this._onDestroy.bind(this));
- this._extended_keys = extendedKeys;
- this._extended_keyboard = null;
+ this._extendedKeys = extendedKeys;
+ this._extendedKeyboard = null;
this._pressTimeoutId = 0;
this._capturedPress = false;
@@ -289,7 +289,7 @@ var Key = GObject.registerClass({
}
_ensureExtendedKeysPopup() {
- if (this._extended_keys.length == 0)
+ if (this._extendedKeys.length === 0)
return;
this._boxPointer = new BoxPointer.BoxPointer(St.Side.BOTTOM);
@@ -300,7 +300,7 @@ var Key = GObject.registerClass({
// Adds style to existing keyboard style to avoid repetition
this._boxPointer.add_style_class_name('keyboard-subkeys');
this._getExtendedKeys();
- this.keyButton._extended_keys = this._extended_keyboard;
+ this.keyButton._extendedKeys = this._extendedKeyboard;
}
_getKeyval(key) {
@@ -311,7 +311,7 @@ var Key = GObject.registerClass({
_press(key) {
this.emit('activated');
- if (key != this.key || this._extended_keys.length == 0)
+ if (key !== this.key || this._extendedKeys.length === 0)
this.emit('pressed', this._getKeyval(key), key);
if (key == this.key) {
@@ -323,7 +323,7 @@ var Key = GObject.registerClass({
this.emit('long-press');
- if (this._extended_keys.length > 0) {
+ if (this._extendedKeys.length > 0) {
this._touchPressed = false;
this.keyButton.set_hover(false);
this.keyButton.fake_release();
@@ -342,7 +342,7 @@ var Key = GObject.registerClass({
this._pressTimeoutId = 0;
}
- if (!this._longPress && key == this.key && this._extended_keys.length > 0)
+ if (!this._longPress && key === this.key && this._extendedKeys.length > 0)
this.emit('pressed', this._getKeyval(key), key);
this.emit('released', this._getKeyval(key), key);
@@ -445,19 +445,21 @@ var Key = GObject.registerClass({
}
_getExtendedKeys() {
- this._extended_keyboard = new St.BoxLayout({ style_class: 'key-container',
- vertical: false });
- for (let i = 0; i < this._extended_keys.length; ++i) {
- let extendedKey = this._extended_keys[i];
+ this._extendedKeyboard = new St.BoxLayout({
+ style_class: 'key-container',
+ vertical: false,
+ });
+ for (let i = 0; i < this._extendedKeys.length; ++i) {
+ let extendedKey = this._extendedKeys[i];
let key = this._makeKey(extendedKey);
- key.extended_key = extendedKey;
- this._extended_keyboard.add(key);
+ key.extendedKey = extendedKey;
+ this._extendedKeyboard.add(key);
key.width = this.keyButton.width;
key.height = this.keyButton.height;
}
- this._boxPointer.bin.add_actor(this._extended_keyboard);
+ this._boxPointer.bin.add_actor(this._extendedKeyboard);
}
get subkeys() {
@@ -1177,7 +1179,7 @@ var KeyboardManager = class KeyBoardManager {
let actor = event.get_source();
return Main.layoutManager.keyboardBox.contains(actor) ||
- !!actor._extended_keys || !!actor.extended_key;
+ !!actor._extendedKeys || !!actor.extendedKey;
}
};
@@ -1339,7 +1341,7 @@ class Keyboard extends St.BoxLayout {
// Showing an extended key popup and clicking a key from the extended keys
// will grab focus, but ignore that
let extendedKeysWereFocused = this._focusInExtendedKeys;
- this._focusInExtendedKeys = focus && (focus._extended_keys || focus.extended_key);
+ this._focusInExtendedKeys = focus && (focus._extendedKeys || focus.extendedKey);
if (this._focusInExtendedKeys || extendedKeysWereFocused)
return;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]