[gnome-shell/wip/re-search: 45/48] viewSelector: this.active --> this.entryNonEmpty
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/re-search: 45/48] viewSelector: this.active --> this.entryNonEmpty
- Date: Thu, 11 Oct 2012 22:33:33 +0000 (UTC)
commit ec5bbd328b15343d20a8899985ac27d56fd45f12
Author: Tanner Doshier <doshitan gmail com>
Date: Fri Aug 24 11:24:49 2012 -0500
viewSelector: this.active --> this.entryNonEmpty
'active' isn't terribly clear about just what is active, this variable is
true/false depending on whether or not the search entry has text.
https://bugzilla.gnome.org/show_bug.cgi?id=682050
js/ui/viewSelector.js | 22 +++++++++++-----------
1 files changed, 11 insertions(+), 11 deletions(-)
---
diff --git a/js/ui/viewSelector.js b/js/ui/viewSelector.js
index 079ff18..440ae4d 100644
--- a/js/ui/viewSelector.js
+++ b/js/ui/viewSelector.js
@@ -50,7 +50,7 @@ const ViewSelector = new Lang.Class({
this._activePage = null;
- this.active = false;
+ this.entryNonEmpty = false;
this._searchPending = false;
this._searchTimeoutId = 0;
@@ -207,7 +207,7 @@ const ViewSelector = new Lang.Class({
},
_onShowAppsButtonToggled: function() {
- if (this.active)
+ if (this.entryNonEmpty)
this.reset();
else
this._showPage(this._showAppsButton.checked ? this._appsPage
@@ -223,7 +223,7 @@ const ViewSelector = new Lang.Class({
let symbol = event.get_key_symbol();
if (symbol == Clutter.Escape) {
- if (this.active)
+ if (this.entryNonEmpty)
this.reset();
else if (this._showAppsButton.checked)
this._resetShowAppsButton();
@@ -231,9 +231,9 @@ const ViewSelector = new Lang.Class({
Main.overview.hide();
return true;
} else if (Clutter.keysym_to_unicode(symbol) ||
- (symbol == Clutter.BackSpace && this.active)) {
+ (symbol == Clutter.BackSpace && this.entryNonEmpty)) {
this.startSearch(event);
- } else if (!this.active) {
+ } else if (!this.entryNonEmpty) {
if (symbol == Clutter.Tab || symbol == Clutter.Down) {
this._activePage.navigate_focus(null, Gtk.DirectionType.TAB_FORWARD, false);
return true;
@@ -308,13 +308,13 @@ const ViewSelector = new Lang.Class({
},
_onTextChanged: function (se, prop) {
- let searchPreviouslyActive = this.active;
- this.active = this._entry.get_text() != '';
- this._searchPending = this.active && !searchPreviouslyActive;
+ let searchPreviouslyActive = this.entryNonEmpty;
+ this.entryNonEmpty = this._entry.get_text() != '';
+ this._searchPending = this.entryNonEmpty && !searchPreviouslyActive;
if (this._searchPending) {
this._searchResults.startingSearch();
}
- if (this.active) {
+ if (this.entryNonEmpty) {
this.emit('search-begin');
this._entry.set_secondary_icon(this._activeIcon);
@@ -332,7 +332,7 @@ const ViewSelector = new Lang.Class({
this._entry.set_secondary_icon(this._inactiveIcon);
this._searchCancelled();
}
- if (!this.active) {
+ if (!this.entryNonEmpty) {
if (this._searchTimeoutId > 0) {
Mainloop.source_remove(this._searchTimeoutId);
this._searchTimeoutId = 0;
@@ -360,7 +360,7 @@ const ViewSelector = new Lang.Class({
}
this._searchResults.activateDefault();
return true;
- } else if (this.active) {
+ } else if (this.entryNonEmpty) {
let arrowNext, nextDirection;
if (entry.get_text_direction() == Clutter.TextDirection.RTL) {
arrowNext = Clutter.Left;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]