Bug 334697 - Implement pie-chart throbber. r=vlad, ui-r=beltzner

This commit is contained in:
Dão Gottwald 2009-10-01 14:31:24 +02:00
Родитель d1b3e0e73d
Коммит ffb64b861a
13 изменённых файлов: 129 добавлений и 3 удалений

Просмотреть файл

@ -305,6 +305,10 @@
// count of open requests (should always be 0 or 1) // count of open requests (should always be 0 or 1)
mRequestCount: 0, mRequestCount: 0,
destroy: function () {
this._cancelStalledTimer();
},
onProgressChange : function (aWebProgress, aRequest, onProgressChange : function (aWebProgress, aRequest,
aCurSelfProgress, aMaxSelfProgress, aCurSelfProgress, aMaxSelfProgress,
aCurTotalProgress, aMaxTotalProgress) aCurTotalProgress, aMaxTotalProgress)
@ -314,6 +318,16 @@
if (this.mBlank) if (this.mBlank)
return; return;
if (this.mTotalProgress) {
const STATES = 8;
let state = Math.ceil(STATES * this.mTotalProgress);
if (state != this.mTab.getAttribute("progress")) {
this.mTab.setAttribute("progress", state);
this.mTab.removeAttribute("stalled");
this._startStalledTimer();
}
}
if (this.mTabBrowser.mCurrentTab == this.mTab) { if (this.mTabBrowser.mCurrentTab == this.mTab) {
for (let i = 0; i < this.mTabBrowser.mProgressListeners.length; i++) { for (let i = 0; i < this.mTabBrowser.mProgressListeners.length; i++) {
let p = this.mTabBrowser.mProgressListeners[i]; let p = this.mTabBrowser.mProgressListeners[i];
@ -393,6 +407,7 @@
if (!this.mBlank) { if (!this.mBlank) {
if (!(aStateFlags & nsIWebProgressListener.STATE_RESTORING)) { if (!(aStateFlags & nsIWebProgressListener.STATE_RESTORING)) {
this.mTab.setAttribute("busy", "true"); this.mTab.setAttribute("busy", "true");
this._startStalledTimer();
this.mTabBrowser.updateIcon(this.mTab); this.mTabBrowser.updateIcon(this.mTab);
this.mTabBrowser.setTabTitleLoading(this.mTab); this.mTabBrowser.setTabTitleLoading(this.mTab);
} }
@ -419,6 +434,9 @@
this.mBlank = false; this.mBlank = false;
this.mTab.removeAttribute("busy"); this.mTab.removeAttribute("busy");
this.mTab.removeAttribute("progress");
this.mTab.removeAttribute("stalled");
this._cancelStalledTimer();
this.mTabBrowser.updateIcon(this.mTab); this.mTabBrowser.updateIcon(this.mTab);
var location = aRequest.QueryInterface(nsIChannel).URI; var location = aRequest.QueryInterface(nsIChannel).URI;
@ -613,6 +631,20 @@
aIID.equals(Components.interfaces.nsISupports)) aIID.equals(Components.interfaces.nsISupports))
return this; return this;
throw Components.results.NS_NOINTERFACE; throw Components.results.NS_NOINTERFACE;
},
_startStalledTimer: function () {
this._cancelStalledTimer();
this._stalledTimer = setTimeout(function (self) {
self.mTab.setAttribute("stalled", "true");
}, 700, this);
},
_cancelStalledTimer: function () {
if (this._stalledTimer) {
clearTimeout(this._stalledTimer);
this._stalledTimer = 0;
}
} }
}); });
]]> ]]>
@ -1496,6 +1528,7 @@
const filter = this.mTabFilters[aTab._tPos]; const filter = this.mTabFilters[aTab._tPos];
browser.webProgress.removeProgressListener(filter); browser.webProgress.removeProgressListener(filter);
filter.removeProgressListener(this.mTabListeners[aTab._tPos]); filter.removeProgressListener(this.mTabListeners[aTab._tPos]);
this.mTabListeners[aTab._tPos].destroy();
// Remove our title change and blocking listeners // Remove our title change and blocking listeners
browser.removeEventListener("DOMTitleChanged", this.onTitleChanged, true); browser.removeEventListener("DOMTitleChanged", this.onTitleChanged, true);
@ -2736,6 +2769,7 @@
this.getBrowserAtIndex(i).webProgress.removeProgressListener(this.mTabFilters[i]); this.getBrowserAtIndex(i).webProgress.removeProgressListener(this.mTabFilters[i]);
this.mTabFilters[i].removeProgressListener(this.mTabListeners[i]); this.mTabFilters[i].removeProgressListener(this.mTabListeners[i]);
this.mTabFilters[i] = null; this.mTabFilters[i] = null;
this.mTabListeners[i].destroy();
this.mTabListeners[i] = null; this.mTabListeners[i] = null;
this.getBrowserAtIndex(i).removeEventListener("DOMTitleChanged", this.onTitleChanged, true); this.getBrowserAtIndex(i).removeEventListener("DOMTitleChanged", this.onTitleChanged, true);
} }

Просмотреть файл

@ -1127,7 +1127,35 @@ tabpanels {
} }
.tabbrowser-tab[busy] > .tab-icon-image { .tabbrowser-tab[busy] > .tab-icon-image {
list-style-image: url("chrome://global/skin/icons/loading_16.png") !important; list-style-image: url("chrome://browser/skin/tabbrowser/progress.png") !important;
-moz-image-region: rect(0, 16px, 16px, 0);
}
.tabbrowser-tab[busy][stalled] > .tab-icon-image {
list-style-image: url("chrome://browser/skin/tabbrowser/progress-pulsing.png") !important;
}
.tabbrowser-tab[busy][progress="1"] > .tab-icon-image {
-moz-image-region: rect(0, 32px, 16px, 16px);
}
.tabbrowser-tab[busy][progress="2"] > .tab-icon-image {
-moz-image-region: rect(0, 48px, 16px, 32px);
}
.tabbrowser-tab[busy][progress="3"] > .tab-icon-image {
-moz-image-region: rect(0, 64px, 16px, 48px);
}
.tabbrowser-tab[busy][progress="4"] > .tab-icon-image {
-moz-image-region: rect(0, 80px, 16px, 64px);
}
.tabbrowser-tab[busy][progress="5"] > .tab-icon-image {
-moz-image-region: rect(0, 96px, 16px, 80px);
}
.tabbrowser-tab[busy][progress="6"] > .tab-icon-image {
-moz-image-region: rect(0, 112px, 16px, 96px);
}
.tabbrowser-tab[busy][progress="7"] > .tab-icon-image {
-moz-image-region: rect(0, 128px, 16px, 112px);
}
.tabbrowser-tab[busy][progress="8"] > .tab-icon-image {
-moz-image-region: rect(0, 144px, 16px, 128px);
} }
.tabs-bottom { .tabs-bottom {

Просмотреть файл

@ -60,4 +60,6 @@ browser.jar:
* skin/classic/browser/preferences/preferences.css (preferences/preferences.css) * skin/classic/browser/preferences/preferences.css (preferences/preferences.css)
skin/classic/browser/preferences/applications.css (preferences/applications.css) skin/classic/browser/preferences/applications.css (preferences/applications.css)
skin/classic/browser/tabbrowser/alltabs.png (tabbrowser/alltabs.png) skin/classic/browser/tabbrowser/alltabs.png (tabbrowser/alltabs.png)
skin/classic/browser/tabbrowser/progress.png (tabbrowser/progress.png)
skin/classic/browser/tabbrowser/progress-pulsing.png (tabbrowser/progress-pulsing.png)
skin/classic/browser/tabbrowser/tabDragIndicator.png (tabbrowser/tabDragIndicator.png) skin/classic/browser/tabbrowser/tabDragIndicator.png (tabbrowser/tabDragIndicator.png)

Двоичные данные
browser/themes/gnomestripe/browser/tabbrowser/progress-pulsing.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 10 KiB

Двоичные данные
browser/themes/gnomestripe/browser/tabbrowser/progress.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 2.0 KiB

Просмотреть файл

@ -1477,7 +1477,35 @@ tabbrowser > tabbox {
} }
.tabbrowser-tab[busy] > .tab-icon-image { .tabbrowser-tab[busy] > .tab-icon-image {
list-style-image: url("chrome://global/skin/icons/loading_16.png") !important; list-style-image: url("chrome://browser/skin/tabbrowser/progress.png") !important;
-moz-image-region: rect(0, 16px, 16px, 0);
}
.tabbrowser-tab[busy][stalled] > .tab-icon-image {
list-style-image: url("chrome://browser/skin/tabbrowser/progress-pulsing.png") !important;
}
.tabbrowser-tab[busy][progress="1"] > .tab-icon-image {
-moz-image-region: rect(0, 32px, 16px, 16px);
}
.tabbrowser-tab[busy][progress="2"] > .tab-icon-image {
-moz-image-region: rect(0, 48px, 16px, 32px);
}
.tabbrowser-tab[busy][progress="3"] > .tab-icon-image {
-moz-image-region: rect(0, 64px, 16px, 48px);
}
.tabbrowser-tab[busy][progress="4"] > .tab-icon-image {
-moz-image-region: rect(0, 80px, 16px, 64px);
}
.tabbrowser-tab[busy][progress="5"] > .tab-icon-image {
-moz-image-region: rect(0, 96px, 16px, 80px);
}
.tabbrowser-tab[busy][progress="6"] > .tab-icon-image {
-moz-image-region: rect(0, 112px, 16px, 96px);
}
.tabbrowser-tab[busy][progress="7"] > .tab-icon-image {
-moz-image-region: rect(0, 128px, 16px, 112px);
}
.tabbrowser-tab[busy][progress="8"] > .tab-icon-image {
-moz-image-region: rect(0, 144px, 16px, 128px);
} }
.tabbrowser-tab:not(:hover):not([selected="true"]) > .tab-icon-image { .tabbrowser-tab:not(:hover):not([selected="true"]) > .tab-icon-image {

Просмотреть файл

@ -101,6 +101,8 @@ browser.jar:
skin/classic/browser/tabbrowser/alltabs-box-bkgnd-icon.png (tabbrowser/alltabs-box-bkgnd-icon.png) skin/classic/browser/tabbrowser/alltabs-box-bkgnd-icon.png (tabbrowser/alltabs-box-bkgnd-icon.png)
skin/classic/browser/tabbrowser/alltabs-box-overflow-bkgnd-animate.png (tabbrowser/alltabs-box-overflow-bkgnd-animate.png) skin/classic/browser/tabbrowser/alltabs-box-overflow-bkgnd-animate.png (tabbrowser/alltabs-box-overflow-bkgnd-animate.png)
skin/classic/browser/tabbrowser/newtab.png (tabbrowser/newtab.png) skin/classic/browser/tabbrowser/newtab.png (tabbrowser/newtab.png)
skin/classic/browser/tabbrowser/progress.png (tabbrowser/progress.png)
skin/classic/browser/tabbrowser/progress-pulsing.png (tabbrowser/progress-pulsing.png)
skin/classic/browser/tabbrowser/tab-arrow-left.png (tabbrowser/tab-arrow-left.png) skin/classic/browser/tabbrowser/tab-arrow-left.png (tabbrowser/tab-arrow-left.png)
skin/classic/browser/tabbrowser/tab-arrow-right.png (tabbrowser/tab-arrow-right.png) skin/classic/browser/tabbrowser/tab-arrow-right.png (tabbrowser/tab-arrow-right.png)
skin/classic/browser/tabbrowser/tabbrowser-tabs-bkgnd.png (tabbrowser/tabbrowser-tabs-bkgnd.png) skin/classic/browser/tabbrowser/tabbrowser-tabs-bkgnd.png (tabbrowser/tabbrowser-tabs-bkgnd.png)

Двоичные данные
browser/themes/pinstripe/browser/tabbrowser/progress-pulsing.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 10 KiB

Двоичные данные
browser/themes/pinstripe/browser/tabbrowser/progress.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 2.0 KiB

Просмотреть файл

@ -1201,7 +1201,35 @@ statusbarpanel#statusbar-display {
} }
.tabbrowser-tab[busy] > .tab-icon-image { .tabbrowser-tab[busy] > .tab-icon-image {
list-style-image: url("chrome://global/skin/icons/loading_16.png") !important; list-style-image: url("chrome://browser/skin/tabbrowser/progress.png") !important;
-moz-image-region: rect(0, 16px, 16px, 0);
}
.tabbrowser-tab[busy][stalled] > .tab-icon-image {
list-style-image: url("chrome://browser/skin/tabbrowser/progress-pulsing.png") !important;
}
.tabbrowser-tab[busy][progress="1"] > .tab-icon-image {
-moz-image-region: rect(0, 32px, 16px, 16px);
}
.tabbrowser-tab[busy][progress="2"] > .tab-icon-image {
-moz-image-region: rect(0, 48px, 16px, 32px);
}
.tabbrowser-tab[busy][progress="3"] > .tab-icon-image {
-moz-image-region: rect(0, 64px, 16px, 48px);
}
.tabbrowser-tab[busy][progress="4"] > .tab-icon-image {
-moz-image-region: rect(0, 80px, 16px, 64px);
}
.tabbrowser-tab[busy][progress="5"] > .tab-icon-image {
-moz-image-region: rect(0, 96px, 16px, 80px);
}
.tabbrowser-tab[busy][progress="6"] > .tab-icon-image {
-moz-image-region: rect(0, 112px, 16px, 96px);
}
.tabbrowser-tab[busy][progress="7"] > .tab-icon-image {
-moz-image-region: rect(0, 128px, 16px, 112px);
}
.tabbrowser-tab[busy][progress="8"] > .tab-icon-image {
-moz-image-region: rect(0, 144px, 16px, 128px);
} }
.tab-icon-image { .tab-icon-image {

Просмотреть файл

@ -83,6 +83,8 @@ browser.jar:
skin/classic/browser/tabbrowser/alltabs-box-overflow-end-bkgnd-animate.png (tabbrowser/alltabs-box-overflow-end-bkgnd-animate.png) skin/classic/browser/tabbrowser/alltabs-box-overflow-end-bkgnd-animate.png (tabbrowser/alltabs-box-overflow-end-bkgnd-animate.png)
skin/classic/browser/tabbrowser/alltabs-box-overflow-start-bkgnd-animate.png (tabbrowser/alltabs-box-overflow-start-bkgnd-animate.png) skin/classic/browser/tabbrowser/alltabs-box-overflow-start-bkgnd-animate.png (tabbrowser/alltabs-box-overflow-start-bkgnd-animate.png)
skin/classic/browser/tabbrowser/newtab.png (tabbrowser/newtab.png) skin/classic/browser/tabbrowser/newtab.png (tabbrowser/newtab.png)
skin/classic/browser/tabbrowser/progress.png (tabbrowser/progress.png)
skin/classic/browser/tabbrowser/progress-pulsing.png (tabbrowser/progress-pulsing.png)
skin/classic/browser/tabbrowser/tab-arrow-left.png (tabbrowser/tab-arrow-left.png) skin/classic/browser/tabbrowser/tab-arrow-left.png (tabbrowser/tab-arrow-left.png)
skin/classic/browser/tabbrowser/tab-arrow-right.png (tabbrowser/tab-arrow-right.png) skin/classic/browser/tabbrowser/tab-arrow-right.png (tabbrowser/tab-arrow-right.png)
skin/classic/browser/tabbrowser/tabbrowser-tabs-bkgnd.png (tabbrowser/tabbrowser-tabs-bkgnd.png) skin/classic/browser/tabbrowser/tabbrowser-tabs-bkgnd.png (tabbrowser/tabbrowser-tabs-bkgnd.png)
@ -177,6 +179,8 @@ browser.jar:
skin/classic/aero/browser/tabbrowser/alltabs-box-overflow-end-bkgnd-animate.png (tabbrowser/alltabs-box-overflow-end-bkgnd-animate.png) skin/classic/aero/browser/tabbrowser/alltabs-box-overflow-end-bkgnd-animate.png (tabbrowser/alltabs-box-overflow-end-bkgnd-animate.png)
skin/classic/aero/browser/tabbrowser/alltabs-box-overflow-start-bkgnd-animate.png (tabbrowser/alltabs-box-overflow-start-bkgnd-animate.png) skin/classic/aero/browser/tabbrowser/alltabs-box-overflow-start-bkgnd-animate.png (tabbrowser/alltabs-box-overflow-start-bkgnd-animate.png)
skin/classic/aero/browser/tabbrowser/newtab.png (tabbrowser/newtab-aero.png) skin/classic/aero/browser/tabbrowser/newtab.png (tabbrowser/newtab-aero.png)
skin/classic/aero/browser/tabbrowser/progress.png (tabbrowser/progress.png)
skin/classic/aero/browser/tabbrowser/progress-pulsing.png (tabbrowser/progress-pulsing.png)
skin/classic/aero/browser/tabbrowser/tab-arrow-left.png (tabbrowser/tab-arrow-left-aero.png) skin/classic/aero/browser/tabbrowser/tab-arrow-left.png (tabbrowser/tab-arrow-left-aero.png)
skin/classic/aero/browser/tabbrowser/tab-arrow-right.png (tabbrowser/tab-arrow-right-aero.png) skin/classic/aero/browser/tabbrowser/tab-arrow-right.png (tabbrowser/tab-arrow-right-aero.png)
skin/classic/aero/browser/tabbrowser/tabbrowser-tabs-bkgnd.png (tabbrowser/tabbrowser-tabs-bkgnd.png) skin/classic/aero/browser/tabbrowser/tabbrowser-tabs-bkgnd.png (tabbrowser/tabbrowser-tabs-bkgnd.png)

Двоичные данные
browser/themes/winstripe/browser/tabbrowser/progress-pulsing.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 10 KiB

Двоичные данные
browser/themes/winstripe/browser/tabbrowser/progress.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 2.0 KiB