From 10955354696221898e2665f7f5f2fd3f504b32e3 Mon Sep 17 00:00:00 2001 From: "cmanske%netscape.com" Date: Fri, 29 Oct 1999 22:33:34 +0000 Subject: [PATCH] Fixed Composer UI to adjust to latest global CSS changes. Mostly needed to add appropriate class to titled buttons. Change editorshell to stop throbber animation even if editor fails to initialize. r=sfraser git-svn-id: svn://10.0.0.236/trunk@52279 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/editor/base/nsEditorShell.cpp | 8 +- mozilla/editor/composer/src/nsEditorShell.cpp | 8 +- .../composer/content/TextEditorAppShell.xul | 6 +- mozilla/editor/ui/composer/content/editor.xul | 7 +- .../ui/composer/content/editorOverlay.xul | 40 ++++----- mozilla/editor/ui/composer/skin/editor.css | 88 +++++++------------ .../ui/dialogs/content/EdAdvancedEdit.xul | 8 +- .../ui/dialogs/content/EdDialogOverlay.xul | 2 +- .../ui/dialogs/content/EdDictionary.xul | 8 +- .../ui/dialogs/content/EdHLineProps.xul | 2 +- .../editor/ui/dialogs/content/EdImageMap.xul | 26 +++--- .../editor/ui/dialogs/content/EdImageProps.js | 9 +- .../ui/dialogs/content/EdImageProps.xul | 41 +++++---- .../editor/ui/dialogs/content/EdLinkProps.js | 18 ++-- .../editor/ui/dialogs/content/EdLinkProps.xul | 8 +- .../editor/ui/dialogs/content/EdMessage.xul | 8 +- .../ui/dialogs/content/EdTableProps.xul | 8 +- .../content/debugQATextEditorShell.xul | 6 +- 18 files changed, 137 insertions(+), 164 deletions(-) diff --git a/mozilla/editor/base/nsEditorShell.cpp b/mozilla/editor/base/nsEditorShell.cpp index 28a9d7903ac..58eda0002a6 100644 --- a/mozilla/editor/base/nsEditorShell.cpp +++ b/mozilla/editor/base/nsEditorShell.cpp @@ -163,7 +163,7 @@ GetDocument(nsIWebShell *aWebShell, nsIDocument **aDoc ) // Utility to set and attribute of an element (used for throbber) static nsresult -SetXULDocAttribute( nsIWebShell *shell, const char *id, +SetChromeAttribute( nsIWebShell *shell, const char *id, const char *name, const nsString &value ) { nsCOMPtr doc; @@ -3547,7 +3547,8 @@ nsEditorShell::OnStartDocumentLoad(nsIDocumentLoader* loader, nsIURI* aURL, cons { // Start the throbber // TODO: We should also start/stop it for saving and publishing? - return SetXULDocAttribute( mWebShell, "Editor:Throbber", "busy", "true" ); + SetChromeAttribute( mWebShell, "Editor:Throbber", "busy", "true" ); + return NS_OK; } NS_IMETHODIMP @@ -3568,8 +3569,7 @@ nsEditorShell::OnEndDocumentLoad(nsIDocumentLoader* loader, nsIChannel* channel, nsCOMPtr aUrl; channel->GetURI(getter_AddRefs(aUrl)); res = PrepareDocumentForEditing(aUrl); - if (NS_SUCCEEDED(res)) - res = SetXULDocAttribute( mWebShell, "Editor:Throbber", "busy", "false" ); + SetChromeAttribute( mWebShell, "Editor:Throbber", "busy", "false" ); } return res; diff --git a/mozilla/editor/composer/src/nsEditorShell.cpp b/mozilla/editor/composer/src/nsEditorShell.cpp index 28a9d7903ac..58eda0002a6 100644 --- a/mozilla/editor/composer/src/nsEditorShell.cpp +++ b/mozilla/editor/composer/src/nsEditorShell.cpp @@ -163,7 +163,7 @@ GetDocument(nsIWebShell *aWebShell, nsIDocument **aDoc ) // Utility to set and attribute of an element (used for throbber) static nsresult -SetXULDocAttribute( nsIWebShell *shell, const char *id, +SetChromeAttribute( nsIWebShell *shell, const char *id, const char *name, const nsString &value ) { nsCOMPtr doc; @@ -3547,7 +3547,8 @@ nsEditorShell::OnStartDocumentLoad(nsIDocumentLoader* loader, nsIURI* aURL, cons { // Start the throbber // TODO: We should also start/stop it for saving and publishing? - return SetXULDocAttribute( mWebShell, "Editor:Throbber", "busy", "true" ); + SetChromeAttribute( mWebShell, "Editor:Throbber", "busy", "true" ); + return NS_OK; } NS_IMETHODIMP @@ -3568,8 +3569,7 @@ nsEditorShell::OnEndDocumentLoad(nsIDocumentLoader* loader, nsIChannel* channel, nsCOMPtr aUrl; channel->GetURI(getter_AddRefs(aUrl)); res = PrepareDocumentForEditing(aUrl); - if (NS_SUCCEEDED(res)) - res = SetXULDocAttribute( mWebShell, "Editor:Throbber", "busy", "false" ); + SetChromeAttribute( mWebShell, "Editor:Throbber", "busy", "false" ); } return res; diff --git a/mozilla/editor/ui/composer/content/TextEditorAppShell.xul b/mozilla/editor/ui/composer/content/TextEditorAppShell.xul index 46229cf9fa3..70b91fd50a4 100644 --- a/mozilla/editor/ui/composer/content/TextEditorAppShell.xul +++ b/mozilla/editor/ui/composer/content/TextEditorAppShell.xul @@ -123,13 +123,11 @@ - + - - - + diff --git a/mozilla/editor/ui/composer/content/editor.xul b/mozilla/editor/ui/composer/content/editor.xul index c0d5102438a..588e3ed584c 100644 --- a/mozilla/editor/ui/composer/content/editor.xul +++ b/mozilla/editor/ui/composer/content/editor.xul @@ -132,21 +132,20 @@ + - + - + - - diff --git a/mozilla/editor/ui/composer/content/editorOverlay.xul b/mozilla/editor/ui/composer/content/editorOverlay.xul index 1a35312fa6e..c303b40acd5 100644 --- a/mozilla/editor/ui/composer/content/editorOverlay.xul +++ b/mozilla/editor/ui/composer/content/editorOverlay.xul @@ -551,47 +551,47 @@ - - - + + + - - - - - + + + + + - - - - + + + + - + - + - + - + - + - - - + + + diff --git a/mozilla/editor/ui/composer/skin/editor.css b/mozilla/editor/ui/composer/skin/editor.css index 718a2edb83b..db39be5d115 100644 --- a/mozilla/editor/ui/composer/skin/editor.css +++ b/mozilla/editor/ui/composer/skin/editor.css @@ -54,85 +54,67 @@ toolbar#EditToolbar titledbutton#SaveButton[dirty="true"] { list-style-image:url(chrome://editor/skin/images/savemod.gif); } -toolbar#FormatToolbar titledbutton:hover { - border: 1px solid transparent; - background-image:url("chrome://editor/skin/images/hover-teal.gif"); - background-repeat: no-repeat; - background-position: center center; +toolbar#FormatToolbar titledbutton[class~=format] { + margin: 2px 2px 2px 2px; + padding: 2px; + text-decoration: none; + color: inherit; } -toolbar#FormatToolbar titledbutton:active { - border: 1px inset white; +toolbar#FormatToolbar titledbutton[class~=format]:hover { +/* What we should use, but this has a blue border that doesn't look good against gray toolbars + background-image:url("chrome://global/skin/otherbutton28-bg-hover.gif"); +*/ background-image:url("chrome://editor/skin/images/hover-teal.gif"); background-repeat: no-repeat; background-position: center center; + text-decoration: none; + /* global class="plain" should do this! */ } -/* -titledbutton[class~=popup]:hover { - border: 1px solid white; - list-style-image:url(chrome://editor/skin/images/savefile.gif); + +toolbar#FormatToolbar titledbutton[class~=format]:active { + margin: 3px 1px 1px 3px; } -*/ + /* Experimental: a flat look for buttons that show "set" state, like bold -toolbar#FormatToolbar titledbutton[toggled="1"] { +toolbar#FormatToolbar titledbutton[class~=format][toggled="1"] { border: 1px solid #003366; } */ -/* -toolbar#FormatToolbar titledbutton[toggled="1"] { - background-color: #AACCCC; -} -*/ - -/* Use negative margins to bring buttons together to look like one */ -toolbar#FormatToolbar titledbutton#TextColorPopupButton { - margin-right: -3px; -} - -toolbar#FormatToolbar titledbutton#BackColorPopupButton { - margin-left: -3px; +toolbar#FormatToolbar titledbutton[class~=TextAttribute] { + /* Make these narrower */ + padding: 2px 0px; + min-width: 18px; + width: 18px; + /*height: 16px; */ + /* padding: 2px 0px 0px 0px;*/ + font-size: 19px; + font-family: times, serif, sans-serif; } toolbar#FormatToolbar titledbutton#boldButton { - min-width: 16px; - font-size: 19px; font-weight: bold; - font-family: times, serif, sans-serif; - height: 16px; - padding: 0px; - padding-top: 2px; -} - -toolbar#FormatToolbar titledbutton#boldButton:hover { - text-decoration: none; } toolbar#FormatToolbar titledbutton#italicButton { - min-width: 16px; - font-size: 19px; font-weight: bold; - font-family: times, serif, sans-serif; font-style: italic; - height: 16px; - padding: 0px; - padding-top: 2px; -} - -toolbar#FormatToolbar titledbutton#italicButton:hover { - text-decoration: none; } toolbar#FormatToolbar titledbutton#underlineButton { - min-width: 16px; - font-size: 19px; font-weight: normal; - font-family: times, serif, sans-serif; text-decoration: underline; - height: 16px; - padding: 0px; - padding-top: 2px; +} + +/* Use negative margins to bring buttons together to look like one */ +toolbar#FormatToolbar titledbutton#TextColorPopupButton { + margin-right: -2px; +} + +toolbar#FormatToolbar titledbutton#BackColorPopupButton { + margin-left: -2px; } box#DisplayModeBar titledbutton[class~=DisplayModeButton] { @@ -171,13 +153,11 @@ box#DisplayModeBar titledbutton[class~=DisplayModeButton][selected="1"] { box#DisplayModeBar titledbutton[class~=DisplayModeButton][selected="1"]:hover { background-color: #66AAAA; color: white; - text-decoration: none; } box#DisplayModeBar titledbutton[class~=DisplayModeButton][selected="1"]:active { background-color: #33FFFF; color: black; - text-decoration: none; } box#DisplayModeBar div.VerticalSeparator { diff --git a/mozilla/editor/ui/dialogs/content/EdAdvancedEdit.xul b/mozilla/editor/ui/dialogs/content/EdAdvancedEdit.xul index 4d02c1df519..12d52fa6b18 100644 --- a/mozilla/editor/ui/dialogs/content/EdAdvancedEdit.xul +++ b/mozilla/editor/ui/dialogs/content/EdAdvancedEdit.xul @@ -89,7 +89,7 @@ - + @@ -122,7 +122,7 @@ - + @@ -155,7 +155,7 @@ - + @@ -166,7 +166,7 @@ - + diff --git a/mozilla/editor/ui/dialogs/content/EdDialogOverlay.xul b/mozilla/editor/ui/dialogs/content/EdDialogOverlay.xul index bcf94eaef62..ce021c766a0 100644 --- a/mozilla/editor/ui/dialogs/content/EdDialogOverlay.xul +++ b/mozilla/editor/ui/dialogs/content/EdDialogOverlay.xul @@ -30,7 +30,7 @@ - + diff --git a/mozilla/editor/ui/dialogs/content/EdDictionary.xul b/mozilla/editor/ui/dialogs/content/EdDictionary.xul index 99d7868d9c3..384f79f077a 100644 --- a/mozilla/editor/ui/dialogs/content/EdDictionary.xul +++ b/mozilla/editor/ui/dialogs/content/EdDictionary.xul @@ -49,7 +49,7 @@ - + @@ -63,12 +63,12 @@ - +
- +
- + diff --git a/mozilla/editor/ui/dialogs/content/EdHLineProps.xul b/mozilla/editor/ui/dialogs/content/EdHLineProps.xul index b7b31501c43..b175ca0421f 100644 --- a/mozilla/editor/ui/dialogs/content/EdHLineProps.xul +++ b/mozilla/editor/ui/dialogs/content/EdHLineProps.xul @@ -79,7 +79,7 @@ &threeDShading.label; - + diff --git a/mozilla/editor/ui/dialogs/content/EdImageMap.xul b/mozilla/editor/ui/dialogs/content/EdImageMap.xul index e81c056aa74..c02671848b1 100644 --- a/mozilla/editor/ui/dialogs/content/EdImageMap.xul +++ b/mozilla/editor/ui/dialogs/content/EdImageMap.xul @@ -114,23 +114,23 @@ - - - + + + - - - - + + + - - - - - + + + +