зеркало из https://github.com/mozilla/pjs.git
Fix bug # 75772: On Mac OS X, add support for window toolbar button which hides/shows toolbar buttons. r=ben sr=hyatt
This commit is contained in:
Родитель
82b64534c6
Коммит
e5077bf2e5
|
@ -162,7 +162,7 @@
|
|||
|
||||
<!-- toolbar filled out from editorOverlay -->
|
||||
<!-- add class="standard" for dark blue background (icons need rework first) -->
|
||||
<toolbar class="toolbar-primary" id="EditToolbar" persist="collapsed" tbalign="stretch" grippytooltip="aTooltip" grippytooltiptext="&compositionToolbar.tooltip;">
|
||||
<toolbar class="chromeclass-toolbar toolbar-primary" id="EditToolbar" persist="collapsed" tbalign="stretch" grippytooltip="aTooltip" grippytooltiptext="&compositionToolbar.tooltip;">
|
||||
<toolbarbutton id="newButton"/>
|
||||
<toolbarbutton id="openButton"/>
|
||||
<toolbarbutton id="saveButton"/>
|
||||
|
@ -182,7 +182,7 @@
|
|||
</button>
|
||||
</hbox>
|
||||
</toolbar>
|
||||
<toolbar id="FormatToolbar" persist="collapsed" tbalign="center" grippytooltip="aTooltip" grippytooltiptext="&formatToolbar.tooltip;">
|
||||
<toolbar class="chromeclass-toolbar" id="FormatToolbar" persist="collapsed" tbalign="center" grippytooltip="aTooltip" grippytooltiptext="&formatToolbar.tooltip;">
|
||||
<!-- We need this else menulists get stretched -->
|
||||
<hbox align="center">
|
||||
<!-- from editorOverlay -->
|
||||
|
@ -259,7 +259,7 @@
|
|||
</hbox><!-- sidebar-parent -->
|
||||
|
||||
<!-- Some of this is from globarOverlay.xul -->
|
||||
<statusbar id="status-bar">
|
||||
<statusbar class="chromeclass-status" id="status-bar">
|
||||
<hbox id="component-bar"/>
|
||||
<statusbarpanel id="statusText" label="&statusText.label;" flex="1"/>
|
||||
<statusbarpanel class="statusbarpanel-icononly" id="offline-status"/>
|
||||
|
|
|
@ -240,7 +240,7 @@
|
|||
|
||||
<!-- Statusbar (hey, it's /almost/ a menu) -->
|
||||
<overlaytarget id="statusbar-overlay-target">
|
||||
<statusbar id="status-bar" flex="1">
|
||||
<statusbar class="chromeclass-status" id="status-bar" flex="1">
|
||||
<hbox id="component-bar"/>
|
||||
<statusbarpanel id="status-text" label="&StatusText.label;" flex="1"
|
||||
crop="right"/>
|
||||
|
|
|
@ -216,7 +216,7 @@ Rights Reserved.
|
|||
</menubar>
|
||||
|
||||
<!-- toolbar -->
|
||||
<toolbar class="toolbar-primary" id="abToolbar" persist="collapsed" grippytooltip="aTooltip" grippytooltiptext="&addressbookToolbar.tooltip;">
|
||||
<toolbar class="chromeclass-toolbar toolbar-primary" id="abToolbar" persist="collapsed" grippytooltip="aTooltip" grippytooltiptext="&addressbookToolbar.tooltip;">
|
||||
<hbox id="toolbar_button_box">
|
||||
<toolbarbutton class="toolbarbutton-1" id="button-newcard" label="&newcardButton.label;" tooltip="aTooltip" tooltiptext="&newcardButton.tooltip;" oncommand="AbNewCard('dirTree');"/>
|
||||
<toolbarbutton class="toolbarbutton-1" id="button-newlist" label="&newlistButton.label;" tooltip="aTooltip" tooltiptext="&newlistButton.tooltip;" oncommand="AbNewList('dirTree');"/>
|
||||
|
@ -277,7 +277,7 @@ Rights Reserved.
|
|||
|
||||
</hbox>
|
||||
|
||||
<statusbar id="status-bar" >
|
||||
<statusbar id="status-bar" class="chromeclass-status">
|
||||
<hbox id="component-bar"/>
|
||||
<statusbarpanel id="statusText" class="status-bar" flex="1" value="&statusText.label;"/>
|
||||
<statusbarpanel id="offline-status" class="statusbarpanel-icononly"/>
|
||||
|
|
|
@ -826,9 +826,9 @@ function MsgOpenNewWindowForFolder(uri, key)
|
|||
var layoutType = gPrefs.getIntPref("mail.pane_config");
|
||||
|
||||
if(layoutType == 0)
|
||||
window.openDialog("chrome://messenger/content/messenger.xul", "_blank", "chrome,all,dialog=no", {uri: uriToOpen, key: keyToSelect});
|
||||
window.openDialog("chrome://messenger/content/messenger.xul", "_blank", "all,chrome,dialog=no,status,toolbar", {uri: uriToOpen, key: keyToSelect});
|
||||
else
|
||||
window.openDialog("chrome://messenger/content/mail3PaneWindowVertLayout.xul", "_blank", "chrome,all,dialog=no", {uri: uriToOpen, key: keyToSelect});
|
||||
window.openDialog("chrome://messenger/content/mail3PaneWindowVertLayout.xul", "_blank", "all,chrome,dialog=no,status,toolbar", {uri: uriToOpen, key: keyToSelect});
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -865,7 +865,7 @@ function MsgOpenNewWindowForMessage(messageUri, folderUri)
|
|||
|
||||
// be sure to pass in the current view....
|
||||
if (messageUri && folderUri) {
|
||||
window.openDialog( "chrome://messenger/content/messageWindow.xul", "_blank", "chrome,all,dialog=no", messageUri, folderUri, gDBView );
|
||||
window.openDialog( "chrome://messenger/content/messageWindow.xul", "_blank", "all,chrome,dialog=no,status,toolbar", messageUri, folderUri, gDBView );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -953,7 +953,7 @@ function MsgSearchMessages()
|
|||
searchWindow.focus();
|
||||
else
|
||||
window.openDialog("chrome://messenger/content/SearchDialog.xul", "",
|
||||
"chrome,resizable,centerscreen,dialog=no", { folder: preselectedFolder });
|
||||
"chrome,resizable,status,centerscreen,dialog=no", { folder: preselectedFolder });
|
||||
}
|
||||
|
||||
function MsgFilters(emailAddress)
|
||||
|
|
|
@ -1402,7 +1402,7 @@ Rights Reserved.
|
|||
<button id="advancedButton" label="&advancedButton.label;" tooltip="aTooltip" tooltiptext="&advancedButton.tooltip;" oncommand="onAdvancedSearch();"/>
|
||||
</hbox>
|
||||
|
||||
<statusbar id="status-bar">
|
||||
<statusbar class="chromeclass-status" id="status-bar">
|
||||
<hbox insertbefore="unreadMessageCount" flex="1">
|
||||
<hbox id="component-bar"/>
|
||||
<statusbarpanel id="statusText" label="&statusText.label;" crop="right" flex="1"/>
|
||||
|
|
|
@ -136,6 +136,6 @@ Rights Reserved.
|
|||
</vbox>
|
||||
|
||||
|
||||
<statusbar id="status-bar"/>
|
||||
<statusbar class="chromeclass-status" id="status-bar"/>
|
||||
|
||||
</window>
|
||||
|
|
|
@ -186,7 +186,7 @@ Rights Reserved.
|
|||
|
||||
</hbox>
|
||||
|
||||
<statusbar id="status-bar" class="mailwindow-statusbar">
|
||||
<statusbar id="status-bar" class="chromeclass-status mailwindow-statusbar">
|
||||
<statusbarpanel id="unreadMessageCount" style="min-width: 5px"/>
|
||||
<statusbarpanel id="totalMessageCount" style="min-width: 5px"/>
|
||||
</statusbar>
|
||||
|
|
|
@ -180,5 +180,5 @@ Rights Reserved.
|
|||
</vbox>
|
||||
</groupbox>
|
||||
</vbox>
|
||||
<statusbar id="status-bar"/>
|
||||
<statusbar class="chromeclass-status" id="status-bar"/>
|
||||
</window>
|
||||
|
|
|
@ -431,7 +431,7 @@
|
|||
</toolbar>
|
||||
|
||||
<!-- These toolbar items get filled out from the editorOverlay -->
|
||||
<toolbar id="FormatToolbar" persist="collapsed" tbautostretch="never" grippytooltip="aTooltip" grippytooltiptext="&formatToolbar.tooltip;">
|
||||
<toolbar class="chromeclass-toolbar" id="FormatToolbar" persist="collapsed" tbautostretch="never" grippytooltip="aTooltip" grippytooltiptext="&formatToolbar.tooltip;">
|
||||
<menulist id="ParagraphSelect"/>
|
||||
<menulist id="FontFaceSelect"/>
|
||||
<stack id="ColorButtons"/>
|
||||
|
@ -462,7 +462,7 @@
|
|||
onkeypress="editorKeyPress(event);"/>
|
||||
</vbox>
|
||||
|
||||
<statusbar id="status-bar">
|
||||
<statusbar id="status-bar" class="chromeclass-status">
|
||||
<hbox id="component-bar"/>
|
||||
<statusbarpanel id="statusText" flex="1"/>
|
||||
|
||||
|
|
|
@ -215,7 +215,7 @@ nsresult nsMsgComposeService::OpenWindow(const char *chrome, nsIMsgComposeParams
|
|||
|
||||
nsCOMPtr<nsIDOMWindow> newWindow;
|
||||
rv = wwatch->OpenWindow(0, chrome && *chrome ? chrome : DEFAULT_CHROME,
|
||||
"_blank", "chrome,dialog=no,all", msgParamsWrapper,
|
||||
"_blank", "all,chrome,dialog=no,status,toolbar", msgParamsWrapper,
|
||||
getter_AddRefs(newWindow));
|
||||
|
||||
return rv;
|
||||
|
|
|
@ -403,7 +403,7 @@ enum nsDragDropEventStatus {
|
|||
// Tab control's selected tab has changed
|
||||
#define NS_TABCHANGE (NS_WINDOW_START + 35)
|
||||
|
||||
|
||||
#define NS_OS_TOOLBAR (NS_WINDOW_START + 36)
|
||||
|
||||
// Menu item selected
|
||||
#define NS_MENU_SELECTED (NS_WINDOW_START + 38)
|
||||
|
|
|
@ -720,6 +720,19 @@ void nsMacMessagePump::DoMouseDown(EventRecord &anEvent)
|
|||
}
|
||||
nsWatchTask::GetTask().Resume();
|
||||
break;
|
||||
|
||||
#if TARGET_CARBON
|
||||
case inToolbarButton: // rjc: Mac OS X
|
||||
nsWatchTask::GetTask().Suspend();
|
||||
nsMacWindow *mw = mMessageSink->GetNSWindowFromMacWindow(whichWindow);
|
||||
if (mw)
|
||||
{
|
||||
gEventDispatchHandler.DispatchGuiEvent(mw, NS_OS_TOOLBAR);
|
||||
}
|
||||
nsWatchTask::GetTask().Resume();
|
||||
break;
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -578,7 +578,12 @@ nsresult nsMacWindow::StandardCreate(nsIWidget *aParent,
|
|||
Inherited::StandardCreate(nil, bounds, aHandleEventFunction, aContext, aAppShell, theToolkit, aInitData);
|
||||
|
||||
#if TARGET_CARBON
|
||||
if ( mWindowType == eWindowType_popup ) {
|
||||
if ( mWindowType == eWindowType_toplevel)
|
||||
{
|
||||
// rjc: Mac OS X - enable toolbar box
|
||||
::ChangeWindowAttributes(mWindowPtr, kWindowToolbarButtonAttribute, 0L );
|
||||
}
|
||||
else if ( mWindowType == eWindowType_popup ) {
|
||||
// OSX enforces window layering so we have to make sure that popups can
|
||||
// appear over modal dialogs (at the top of the layering chain). Create
|
||||
// the popup like normal and change its window class to the modal layer.
|
||||
|
|
|
@ -57,6 +57,7 @@ public:
|
|||
|
||||
NS_IMETHOD Show(PRBool aShow) = 0;
|
||||
NS_IMETHOD ShowModal() = 0;
|
||||
NS_IMETHOD Toolbar() = 0;
|
||||
NS_IMETHOD Close() = 0;
|
||||
NS_IMETHOD GetWebShell(nsIWebShell *& aWebShell) = 0;
|
||||
NS_IMETHOD GetWidget(nsIWidget *& aWidget) = 0;
|
||||
|
|
|
@ -344,6 +344,36 @@ nsresult nsWebShellWindow::Initialize(nsIXULWindow* aParent,
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
* Toolbar
|
||||
*/
|
||||
NS_METHOD
|
||||
nsWebShellWindow::Toolbar()
|
||||
{
|
||||
nsCOMPtr<nsIWebShellWindow> kungFuDeathGrip(this);
|
||||
nsCOMPtr<nsIWebBrowserChrome> wbc(do_GetInterface(kungFuDeathGrip));
|
||||
if (!wbc) return(PR_FALSE);
|
||||
|
||||
// rjc: don't use "nsIWebBrowserChrome::CHROME_EXTRA"
|
||||
// due to components with multiple sidebar components
|
||||
// (such as Mail/News, Addressbook, etc)... and frankly,
|
||||
// Mac IE, OmniWeb, and other Mac OS X apps all work this way
|
||||
|
||||
PRUint32 chromeMask = (nsIWebBrowserChrome::CHROME_TOOLBAR |
|
||||
nsIWebBrowserChrome::CHROME_LOCATIONBAR |
|
||||
nsIWebBrowserChrome::CHROME_PERSONAL_TOOLBAR |
|
||||
nsIWebBrowserChrome::CHROME_STATUSBAR);
|
||||
|
||||
PRUint32 chromeFlags, newChromeFlags = 0;
|
||||
wbc->GetChromeFlags(&chromeFlags);
|
||||
newChromeFlags = chromeFlags & chromeMask;
|
||||
if (!newChromeFlags) chromeFlags |= chromeMask;
|
||||
else chromeFlags &= (~newChromeFlags);
|
||||
wbc->SetChromeFlags(chromeFlags);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Close the window
|
||||
*/
|
||||
|
@ -413,6 +443,11 @@ nsWebShellWindow::HandleEvent(nsGUIEvent *aEvent)
|
|||
// then need to be different.
|
||||
break;
|
||||
}
|
||||
case NS_OS_TOOLBAR: {
|
||||
nsCOMPtr<nsIWebShellWindow> kungFuDeathGrip(eventWindow);
|
||||
eventWindow->Toolbar();
|
||||
break;
|
||||
}
|
||||
case NS_XUL_CLOSE: {
|
||||
// Calling ExecuteCloseHandler may actually close the window
|
||||
// (it probably shouldn't, but you never know what the users JS
|
||||
|
|
|
@ -96,6 +96,7 @@ public:
|
|||
NS_IMETHOD Show(PRBool aShow);
|
||||
NS_IMETHOD ShowModal();
|
||||
NS_IMETHOD ShowModally(PRBool aPrepare);
|
||||
NS_IMETHOD Toolbar();
|
||||
NS_IMETHOD Close();
|
||||
NS_IMETHOD GetWebShell(nsIWebShell *& aWebShell);
|
||||
NS_IMETHOD GetContentWebShell(nsIWebShell **aResult);
|
||||
|
|
|
@ -1,32 +1,3 @@
|
|||
/* ::::::::::
|
||||
:: Rules for 'hiding' portions of the chrome for special
|
||||
:: kinds of browser windows.
|
||||
::::: */
|
||||
|
||||
window[chromehidden~="menubar"] .chromeclass-menubar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
window[chromehidden~="toolbar"] .chromeclass-toolbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
window[chromehidden~="location"] .chromeclass-location {
|
||||
display: none;
|
||||
}
|
||||
|
||||
window[chromehidden~="directories"] .chromeclass-directories {
|
||||
display: none;
|
||||
}
|
||||
|
||||
window[chromehidden~="status"] .chromeclass-status {
|
||||
display: none;
|
||||
}
|
||||
|
||||
window[chromehidden~="extrachrome"] .chromeclass-extrachrome {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* ::::: Hide the link toolbar if it is set to autohide and has no items. ::::: */
|
||||
|
||||
#linktoolbar[hidden="maybe"][hasitems="false"]
|
||||
|
|
|
@ -875,7 +875,8 @@ function BrowserEditBookmarks()
|
|||
if (!gDisableBookmarks) {
|
||||
gDisableBookmarks = true;
|
||||
|
||||
open("chrome://communicator/content/bookmarks/bookmarks.xul", "_blank", "chrome,menubar,resizable,scrollbars");
|
||||
open("chrome://communicator/content/bookmarks/bookmarks.xul", "_blank",
|
||||
"chrome,extrachrome,menubar,resizable,scrollbars,status,toolbar");
|
||||
setTimeout(enableBookmarks, 2000);
|
||||
}
|
||||
}
|
||||
|
@ -1081,12 +1082,14 @@ function readFromClipboard()
|
|||
|
||||
function OpenMessenger()
|
||||
{
|
||||
open("chrome://messenger/content/messenger.xul", "_blank", "chrome,menubar,toolbar,resizable");
|
||||
open("chrome://messenger/content/messenger.xul", "_blank",
|
||||
"chrome,extrachrome,menubar,resizable,status,toolbar");
|
||||
}
|
||||
|
||||
function OpenAddressbook()
|
||||
{
|
||||
open("chrome://messenger/content/addressbook/addressbook.xul", "_blank", "chrome,menubar,toolbar,resizable");
|
||||
open("chrome://messenger/content/addressbook/addressbook.xul", "_blank",
|
||||
"chrome,extrachrome,menubar,resizable,status,toolbar");
|
||||
}
|
||||
|
||||
var gFullScreen = false;
|
||||
|
|
|
@ -70,7 +70,8 @@ function toHistory()
|
|||
}
|
||||
gDisableHistory = true;
|
||||
|
||||
window.open( "chrome://communicator/content/history/history.xul", "_blank", "chrome,menubar,resizable,scrollbars" );
|
||||
window.open( "chrome://communicator/content/history/history.xul", "_blank",
|
||||
"chrome,extrachrome,menubar,resizable,scrollbars,status,toolbar" );
|
||||
setTimeout(enableHistory, 2000);
|
||||
}
|
||||
|
||||
|
@ -108,7 +109,7 @@ function toOpenWindowByType( inType, uri )
|
|||
if ( topWindow )
|
||||
topWindow.focus();
|
||||
else
|
||||
window.open(uri, "_blank", "chrome,menubar,toolbar,resizable,scrollbars");
|
||||
window.open(uri, "_blank", "chrome,extrachrome,menubar,resizable,scrollbars,status,toolbar");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -232,7 +232,7 @@
|
|||
<menu id="menu_Help"/>
|
||||
</menubar>
|
||||
|
||||
<toolbar id="command-toolbar" tbalign="stretch" grippytooltip="aTooltip" grippytooltiptext="&bookmarkToolbar.tooltip;">
|
||||
<toolbar class="chromeclass-toolbar" id="command-toolbar" tbalign="stretch" grippytooltip="aTooltip" grippytooltiptext="&bookmarkToolbar.tooltip;">
|
||||
<toolbarbutton id="newfolder" label="&command.newFolder.label;"
|
||||
command="cmd_newfolder"/>
|
||||
<toolbarbutton id="newseparator" label="&command.newSeparator.label;"
|
||||
|
@ -399,7 +399,7 @@
|
|||
onclick="gBookmarksShell.treeOpen(event);"/>
|
||||
</tree>
|
||||
|
||||
<statusbar id="status-bar">
|
||||
<statusbar class="chromeclass-status" id="status-bar">
|
||||
<statusbarpanel id="statusbar-text" flex="1"/>
|
||||
</statusbar>
|
||||
|
||||
|
|
|
@ -131,7 +131,7 @@ Contributor(s): Joe Hewitt <hewitt@netscape.com>
|
|||
<menu id="menu_Help"/>
|
||||
</menubar>
|
||||
|
||||
<toolbar id="ToolbarMode" grippytooltip="aTooltip" grippytooltiptext="&modeToolbar.tooltip;">
|
||||
<toolbar class="chromeclass-toolbar" id="ToolbarMode" grippytooltip="aTooltip" grippytooltiptext="&modeToolbar.tooltip;">
|
||||
<toolbarbutton type="radio" group="mode" observes="Console:modeAll"/>
|
||||
<toolbarbutton type="radio" group="mode" observes="Console:modeErrors"/>
|
||||
<toolbarbutton type="radio" group="mode" observes="Console:modeWarnings"/>
|
||||
|
@ -140,7 +140,7 @@ Contributor(s): Joe Hewitt <hewitt@netscape.com>
|
|||
<toolbarbutton observes="Console:clear"/>
|
||||
</toolbar>
|
||||
|
||||
<toolbar id="ToolbarEval" grippytooltip="aTooltip" grippytooltiptext="&entryToolbar.tooltip;">
|
||||
<toolbar class="chromeclass-toolbar" id="ToolbarEval" grippytooltip="aTooltip" grippytooltiptext="&entryToolbar.tooltip;">
|
||||
<textbox id="TextboxEval" class="toolbar" value="" onkeypress="onEvalKeyPress(event)" flex="1"/>
|
||||
<toolbarbutton id="ButtonEval" label="&evaluate.label;" oncommand="evaluateTypein()"/>
|
||||
</toolbar>
|
||||
|
|
|
@ -140,7 +140,7 @@
|
|||
</toolbox>
|
||||
|
||||
<outliner id="historyOutliner"/>
|
||||
<statusbar id="status-bar">
|
||||
<statusbar id="status-bar" class="chromeclass-status">
|
||||
<statusbarpanel id="statusbar-display" crop="right" flex="1"/>
|
||||
<statusbarpanel class="statusbarpanel-icononly" id="offline-status"/>
|
||||
</statusbar>
|
||||
|
|
|
@ -161,7 +161,7 @@
|
|||
|
||||
<!-- Splitter on the right of sidebar -->
|
||||
<splitter id="sidebar-splitter" collapse="before" persist="state hidden"
|
||||
class="chromeclass-extrachrome sidebar-splitter" align="center"
|
||||
class="sidebar-splitter" align="center"
|
||||
onmouseup="SidebarFinishClick();">
|
||||
<grippy class="sidebar-splitter-grippy"
|
||||
onclick="SidebarCleanUpExpandCollapse();"/>
|
||||
|
|
|
@ -696,3 +696,32 @@ wizardpage {
|
|||
-moz-binding: url("chrome://global/content/bindings/wizard.xml#wizard-buttons");
|
||||
}
|
||||
|
||||
|
||||
/* ::::::::::
|
||||
:: Rules for 'hiding' portions of the chrome for special
|
||||
:: kinds of browser windows.
|
||||
::::: */
|
||||
|
||||
window[chromehidden~="menubar"] .chromeclass-menubar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
window[chromehidden~="toolbar"] .chromeclass-toolbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
window[chromehidden~="location"] .chromeclass-location {
|
||||
display: none;
|
||||
}
|
||||
|
||||
window[chromehidden~="directories"] .chromeclass-directories {
|
||||
display: none;
|
||||
}
|
||||
|
||||
window[chromehidden~="status"] .chromeclass-status {
|
||||
display: none;
|
||||
}
|
||||
|
||||
window[chromehidden~="extrachrome"] .chromeclass-extrachrome {
|
||||
display: none;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче