Closed
Bug 345261
Opened 19 years ago
Closed 19 years ago
show status text when mousing over all tabs menu items
Categories
(Firefox :: Tabbed Browser, defect, P2)
Tracking
()
RESOLVED
FIXED
Firefox 3 alpha1
People
(Reporter: moco, Assigned: asaf)
References
Details
Attachments
(1 file, 2 obsolete files)
|
5.54 KB,
patch
|
Gavin
:
review+
|
Details | Diff | Splinter Review |
show status text when mousing over all tabs menu items
from tabbrowser.xml
+ // XXX todo
+ // statustext not working yet, since I don't have a menubar
+ // reuse the menubar statustext logic
from irc:
<sspitzer> about the status text, I'd like to re-factor the menubar statusbar code in a way that I can use it here, too.
<sspitzer> but that will be a spin off bug.
<Mano> note: you cannot assume there's a statusbar in the window
show status text when mousing over all tabs menu items
<sspitzer> it could be hidden, but the menubar statusbar code should already handle this.
<Mano> you can't even force it if you find out that there's a statusbar
<Mano> becuase, well, this code lives in toolkit for some reason
<Mano> (tabbrowser)
<sspitzer> I can't force what?
<sspitzer> setting the status text?
<Mano> yeah
<Mano> though i guess you can add a statusbar property to tabbrowser
Comment 1•19 years ago
|
||
Darin had some crazy branch interface that made it possible to goof around with status text more. I wish I could remember which bug that was.
Comment 2•19 years ago
|
||
Trunk only:
http://lxr.mozilla.org/mozilla/source/xpfe/appshell/public/nsIXULBrowserWindow.idl#63
Ugly branch version is in bug 324642. I never checked it in.
| Reporter | ||
Comment 3•19 years ago
|
||
note to self, once this works, we need to make sure we update statustext when the uri changes.
see bug #345260
| Assignee | ||
Comment 4•19 years ago
|
||
Taking, but i'm going to question the cons vs pros here. As in:
1. Activating a menuitem in the menu while a tab is loading will replace the current stauts text with the activated item URL.
2. While a menuitem is active, the statustext might be changed once the loading status of a tab has changed.
Assignee: nobody → bugs.mano
Comment 5•19 years ago
|
||
(In reply to comment #4)
> 1. Activating a menuitem in the menu while a tab is loading will replace the
> current stauts text with the activated item URL.
That seems like a pro to me. Doesn't the same thing happen when you hover a link in a page?
> 2. While a menuitem is active, the statustext might be changed once the
> loading status of a tab has changed.
Due to redirects, etc.? Yeah, that might look kinda unexpected, but perhaps not illogical. I'd certainly like to see it in action.
| Assignee | ||
Comment 6•19 years ago
|
||
(In reply to comment #5)
2. While a menuitem is active, the statustext might be changed once the
> > loading status of a tab has changed.
>
> Due to redirects, etc.? Yeah, that might look kinda unexpected, but perhaps
> not illogical. I'd certainly like to see it in action.
>
Much more common case: the tab loading state is changed ("Connecting", "Waiting", "Transfering data" etc).
Comment 7•19 years ago
|
||
(In reply to comment #6)
> Much more common case: the tab loading state is changed ("Connecting",
> "Waiting", "Transfering data" etc).
I thought the tooltip would show the URL of the tab in question, not a title/status/whatever. I agree that seeing the tab's status would be totally bizarre and weird. I just want to see the URL, that's all. (The status in many cases would just be "done" anyway...)
| Assignee | ||
Comment 8•19 years ago
|
||
You didn't parse this right: say you activate a menuitem while the current tab is "Connecting...", the statusbar text would change from "Connecting..." to the url of the activated item. Now, while the item is activated, the current tab state is changed to "Waiting...", the statusbar text will be replaced from the url of the activated item to "Waiting...".
Comment 9•19 years ago
|
||
(In reply to comment #8)
> You didn't parse this right: say you activate a menuitem while the current tab
> is "Connecting...", the statusbar text would change from "Connecting..." to the
> url of the activated item. Now, while the item is activated, the current tab
> state is changed to "Waiting...", the statusbar text will be replaced from the
> url of the activated item to "Waiting...".
Ah, you're right, I was mistaken.
So, once again, what happens currently in the case of hovering a link on a page that hasn't finished loading, or something like that? If we're broken there then this would be no worse than that, and one fix could solve both issues at the same time.
(Is the solution here some way to "lock the statusbar"?)
| Assignee | ||
Comment 10•19 years ago
|
||
*** Bug 347603 has been marked as a duplicate of this bug. ***
| Assignee | ||
Updated•19 years ago
|
Status: NEW → ASSIGNED
Priority: -- → P2
Target Milestone: --- → Firefox 2 beta2
| Assignee | ||
Comment 11•19 years ago
|
||
This takes care of the issues I pointed out earlier in this bug, i.e. the browser implementation of updateStatusField gives higher priority to hovered links.
Attachment #233437 -
Flags: review?(mconnor)
| Assignee | ||
Updated•19 years ago
|
Flags: blocking-firefox2?
Updated•19 years ago
|
Flags: blocking-firefox2? → blocking-firefox2-
Comment 12•19 years ago
|
||
Comment on attachment 233437 [details] [diff] [review]
patch
Yup, this looks like the right behaviour to me.
Attachment #233437 -
Flags: ui-review+
| Assignee | ||
Comment 13•19 years ago
|
||
Attachment #233437 -
Attachment is obsolete: true
Attachment #239069 -
Flags: review?(gavin.sharp)
Attachment #233437 -
Flags: review?(mconnor)
Comment 14•19 years ago
|
||
Comment on attachment 239069 [details] [diff] [review]
updated
>Index: toolkit/content/widgets/tabbrowser.xml
>+ <method name="_onMenuItemActive">
>+ <parameter name="aEvent"/>
>+ <body><![CDATA[
>+ var tab = aEvent.target.tab;
>+ if (tab) {
>+ var statusText = tab.linkedBrowser.currentURI.spec;
>+ if (statusText == "about:blank") {
>+ // XXXhack: Passing a space here (and not "")
>+ // to make sure the the browser implementation would
>+ // still consider it a hovered link.
>+ statusText = " ";
>+ }
>+
>+ window.XULBrowserWindow.setOverLink(url, null);
>+ }
>+ ]]></body>
>+ </method>
>+
>+ <method name="_onMenuItemInactive">
>+ <parameter name="aEvent"/>
>+ <body><![CDATA[
>+ window.XULBrowserWindow.setOverLink("", null);
>+ ]]></body>
>+ </method>
Any reason you didn't inline these in the <handler>?
I don't think it's a good idea to be relying on XULBrowserWindow being defined in the global scope, that's only true for our browser. Could we instead do something like what menubar does, and have a statusbar attribute on the tabbrowser? At the very least, you should fail gracefully if it isn't defined. None of this is really a problem if tabbrowser moves out of toolkit, but until it does...
Updated•19 years ago
|
Attachment #239069 -
Flags: review?(gavin.sharp) → review-
| Assignee | ||
Comment 15•19 years ago
|
||
Attachment #239069 -
Attachment is obsolete: true
Attachment #239421 -
Flags: review?(gavin.sharp)
Comment 16•19 years ago
|
||
Comment on attachment 239421 [details] [diff] [review]
patch
>Index: toolkit/content/widgets/tabbrowser.xml
>+ <constructor><![CDATA[
>+ // We cannot cache the XULBrowserWindow object itself since it might
>+ // be set after this binding is constructed.
>+ try {
>+ this._xulWindow =
>+ window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
>+ .getInterface(Components.interfaces.nsIWebNavigation)
>+ .QueryInterface(Components.interfaces.nsIDocShellTreeItem)
>+ .treeOwner
>+ .QueryInterface(Components.interfaces.nsIInterfaceRequestor)
>+ .getInterface(Components.interfaces.nsIXULWindow);
>+ }
>+ catch(ex) { }
>+ ]]></constructor>
I wonder if perhaps the XULBrowserWindow should be gotten lazily (i.e. have it's own readonly property that does caching itself), to minimize startup cost, and avoid having to cache the xulWindow (and simplify the checks in the handlers). I guess it probably doesn't matter.
>+ <method name="_onMenuItemActive">
>+ <parameter name="aEvent"/>
>+ <body><![CDATA[
>+ if (!this._xulWindow || !this._xulWindow.XULBrowserWindow)
>+ return;
>+
>+ var tab = aEvent.target.tab;
>+ if (tab) {
>+ var statusText = tab.linkedBrowser.currentURI.spec;
>+ if (statusText == "about:blank") {
>+ // XXXhack: Passing a space here (and not "")
>+ // to make sure the the browser implementation would
>+ // still consider it a hovered link.
>+ statusText = " ";
File a bug on this? nsBrowserStatusHandler should probably default overLink to null and explicitly compare to null in updateStatusField instead of ignoring "" values.
>- <handler event="popupshowing"><![CDATA[
>- if (event.target == this)
>- this._onShowingAllTabsPopup();
>- ]]></handler>
>- <handler event="popuphiding"><![CDATA[
>- if (event.target == this)
>- this._onHidingAllTabsPopup();
>- ]]></handler>
>+ <handler event="popupshowing" action="this._onShowingAllTabsPopup();"/>
>+ <handler event="popuphiding" action="this._onHidingAllTabsPopup();"/>
>+ <handler event="DOMMenuItemActive" action="this._onMenuItemActive(event);"/>
>+ <handler event="DOMMenuItemInactive" action="this._onMenuItemInactive(event);"/>
> </handlers>
> </binding>
I still prefer having the handlers inline, like all the other handlers in this file.
Attachment #239421 -
Flags: review?(gavin.sharp) → review+
| Assignee | ||
Comment 17•19 years ago
|
||
(In reply to comment #16)
> I wonder if perhaps the XULBrowserWindow should be gotten lazily (i.e. have
> it's own readonly property that does caching itself), to minimize startup cost,
> and avoid having to cache the xulWindow (and simplify the checks in the
> handlers). I guess it probably doesn't matter.
I don't think this would be right, esp. for the case where XULBrowserWindow is changed ;).
> >+ <method name="_onMenuItemActive">
> >+ <parameter name="aEvent"/>
> >+ <body><![CDATA[
> >+ if (!this._xulWindow || !this._xulWindow.XULBrowserWindow)
> >+ return;
> >+
> >+ var tab = aEvent.target.tab;
> >+ if (tab) {
> >+ var statusText = tab.linkedBrowser.currentURI.spec;
> >+ if (statusText == "about:blank") {
> >+ // XXXhack: Passing a space here (and not "")
> >+ // to make sure the the browser implementation would
> >+ // still consider it a hovered link.
> >+ statusText = " ";
>
> File a bug on this? nsBrowserStatusHandler should probably default overLink to
> null and explicitly compare to null in updateStatusField instead of ignoring ""
> values.
will do.
>
> >- <handler event="popupshowing"><![CDATA[
> >- if (event.target == this)
> >- this._onShowingAllTabsPopup();
> >- ]]></handler>
> >- <handler event="popuphiding"><![CDATA[
> >- if (event.target == this)
> >- this._onHidingAllTabsPopup();
> >- ]]></handler>
> >+ <handler event="popupshowing" action="this._onShowingAllTabsPopup();"/>
> >+ <handler event="popuphiding" action="this._onHidingAllTabsPopup();"/>
> >+ <handler event="DOMMenuItemActive" action="this._onMenuItemActive(event);"/>
> >+ <handler event="DOMMenuItemInactive" action="this._onMenuItemInactive(event);"/>
> > </handlers>
> > </binding>
>
> I still prefer having the handlers inline, like all the other handlers in this
> file.
>
I'll clean this up in a separate bug.
Target Milestone: Firefox 2 beta2 → Firefox 3 alpha1
| Assignee | ||
Comment 18•19 years ago
|
||
mozilla/toolkit/content/widgets/tabbrowser.xml 1.202
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•