altTab: Use this._highlighted instead of this._curApp in AppSwitcher

Thanks to the parent class (SwitcherPopup), we already have a property
for the currently highlighted item, let's use it.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2097>
This commit is contained in:
Jonas Dreßler 2018-04-30 01:06:35 +02:00 committed by Marge Bot
parent 98e270e698
commit 7ae694990b

View File

@ -706,7 +706,6 @@ class AppSwitcher extends SwitcherPopup.SwitcherList {
this._addIcon(appIcon); this._addIcon(appIcon);
} }
this._curApp = -1;
this._altTabPopup = altTabPopup; this._altTabPopup = altTabPopup;
this._mouseTimeOutId = 0; this._mouseTimeOutId = 0;
@ -829,21 +828,20 @@ class AppSwitcher extends SwitcherPopup.SwitcherList {
// show a dim arrow, but show a bright arrow when they are // show a dim arrow, but show a bright arrow when they are
// highlighted. // highlighted.
highlight(n, justOutline) { highlight(n, justOutline) {
if (this.icons[this._curApp]) { if (this.icons[this._highlighted]) {
if (this.icons[this._curApp].cachedWindows.length == 1) if (this.icons[this._highlighted].cachedWindows.length === 1)
this._arrows[this._curApp].hide(); this._arrows[this._highlighted].hide();
else else
this._arrows[this._curApp].remove_style_pseudo_class('highlighted'); this._arrows[this._highlighted].remove_style_pseudo_class('highlighted');
} }
super.highlight(n, justOutline); super.highlight(n, justOutline);
this._curApp = n;
if (this._curApp != -1) { if (this._highlighted !== -1) {
if (justOutline && this.icons[this._curApp].cachedWindows.length == 1) if (justOutline && this.icons[this._highlighted].cachedWindows.length === 1)
this._arrows[this._curApp].show(); this._arrows[this._highlighted].show();
else else
this._arrows[this._curApp].add_style_pseudo_class('highlighted'); this._arrows[this._highlighted].add_style_pseudo_class('highlighted');
} }
} }