From a5e6be5064ea193c23671ac23427807aee208120 Mon Sep 17 00:00:00 2001 From: "enndeakin%sympatico.ca" Date: Wed, 19 Apr 2006 20:50:25 +0000 Subject: [PATCH] Bug 268590, add notification widget, r=mconnor git-svn-id: svn://10.0.0.236/trunk@194704 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/browser/base/content/browser.js | 232 +++++++------ .../themes/pinstripe/browser/browser.css | 24 -- mozilla/toolkit/content/jar.mn | 1 + mozilla/toolkit/content/widgets/browser.xml | 179 ---------- .../toolkit/content/widgets/notification.xml | 321 ++++++++++++++++++ .../toolkit/content/widgets/tabbrowser.xml | 106 ++---- mozilla/toolkit/content/xul.css | 19 +- .../toolkit/themes/pinstripe/global/jar.mn | 1 + .../themes/pinstripe/global/notification.css | 34 ++ .../themes/winstripe/global/browser.css | 27 -- .../toolkit/themes/winstripe/global/jar.mn | 1 + .../themes/winstripe/global/notification.css | 43 +++ 12 files changed, 559 insertions(+), 429 deletions(-) create mode 100644 mozilla/toolkit/content/widgets/notification.xml create mode 100644 mozilla/toolkit/themes/pinstripe/global/notification.css create mode 100644 mozilla/toolkit/themes/winstripe/global/notification.css diff --git a/mozilla/browser/base/content/browser.js b/mozilla/browser/base/content/browser.js index 578e32249da..fee4a1c6361 100644 --- a/mozilla/browser/base/content/browser.js +++ b/mozilla/browser/base/content/browser.js @@ -328,9 +328,24 @@ const gPopupBlockerObserver = { else message = bundle_browser.getFormattedString("popupWarning", [brandShortName]); - gBrowser.showMessage(gBrowser.selectedBrowser, "chrome://browser/skin/Info.png", - message, popupButtonText, null, null, "blockedPopupOptions", - "top", true, popupButtonAccesskey); + var notificationBox = gBrowser.getNotificationBox(); + var notification = notificationBox.getNotificationWithValue("popup-blocked"); + if (notification) { + notification.label = message; + } + else { + var buttons = [{ + label: popupButtonText, + accessKey: popupButtonAccesskey, + popup: "blockedPopupOptions", + callback: null + }]; + + const priority = notificationBox.PRIORITY_WARNING_MEDIUM; + notificationBox.appendNotification(message, "popup-blocked", + "chrome://browser/skin/Info.png", + priority, buttons); + } } } else @@ -346,7 +361,7 @@ const gPopupBlockerObserver = { var perm = shouldBlock ? this._kIPM.DENY_ACTION : this._kIPM.ALLOW_ACTION; pm.add(currentURI, "popup", perm); - gBrowser.hideMessage(null, "top"); + gBrowser.getNotificationBox().removeCurrentNotification(); }, fillPopupList: function (aEvent) @@ -515,7 +530,7 @@ const gPopupBlockerObserver = { gPrefService.setBoolPref("privacy.popups.showBrowserMessage", !showMessage); - gBrowser.hideMessage(null, "top"); + gBrowser.getNotificationBox().removeCurrentNotification(); }, _displayPageReportFirstTime: function () @@ -564,82 +579,86 @@ const gXPInstallObserver = { if (browser) { var host = browser.docShell.QueryInterface(Components.interfaces.nsIWebNavigation).currentURI.host; var brandShortName = brandBundle.getString("brandShortName"); - var iconURL, messageKey, buttonKey, buttonAccesskeyKey; - if (aData == "install-chrome") { + var notificationName, messageString, buttons; + if (!gPrefService.getBoolPref("xpinstall.enabled")) { + notificationName = "xpinstall-disabled" + if (gPrefService.prefIsLocked("xpinstall.enabled")) { + messageString = browserBundle.getString("xpinstallDisabledMessageLocked"); + buttons = []; + } + else { + messageString = browserBundle.getFormattedString("xpinstallDisabledMessage", + [brandShortName, host]); + + buttons = [{ + label: browserBundle.getString("xpinstallDisabledButton"), + accessKey: browserBundle.getString("xpinstallDisabledButton.accesskey"), + popup: null, + callback: function editPrefs() { + gPrefService.setBoolPref("xpinstall.enabled", true); + return false; + } + }]; + } + } + else { // XXXben - use regular software install warnings for now until we can // properly differentiate themes. It's likely in fact that themes won't // be blocked so this code path will only be reached for extensions. - iconURL = "chrome://mozapps/skin/xpinstall/xpinstallItemGeneric.png"; - messageKey = "xpinstallWarning"; - buttonKey = "xpinstallWarningButton"; - buttonAccesskeyKey = "xpinstallWarningButton.accesskey"; - } - else { - iconURL = "chrome://mozapps/skin/xpinstall/xpinstallItemGeneric.png"; - messageKey = "xpinstallWarning"; - buttonKey = "xpinstallWarningButton"; - buttonAccesskeyKey = "xpinstallWarningButton.accesskey"; - } - var messageString, buttonString, buttonAccesskeyString; - if (!gPrefService.getBoolPref("xpinstall.enabled")) { - if (gPrefService.prefIsLocked("xpinstall.enabled")) { - messageString = browserBundle.getString("xpinstallDisabledMessageLocked"); - buttonString = ""; // don't show the button - } - else { - messageString = browserBundle.getString("xpinstallDisabledMessage"); - buttonString = browserBundle.getString("xpinstallDisabledButton"); - buttonAccesskeyString = browserBundle.getString("xpinstallDisabledButton.accesskey"); - } - getBrowser().showMessage(browser, iconURL, messageString, buttonString, - null, "xpinstall-install-edit-prefs", - null, "top", true, buttonAccesskeyString); - } - else { - messageString = browserBundle.getFormattedString(messageKey, [brandShortName, host]); - buttonString = browserBundle.getString(buttonKey); - buttonAccesskeyString = browserBundle.getString(buttonAccesskeyKey); - webNav = shell.QueryInterface(Components.interfaces.nsIWebNavigation); - getBrowser().showMessage(browser, iconURL, messageString, buttonString, - shell, "xpinstall-install-edit-permissions", - null, "top", false, buttonAccesskeyString); - } - } - break; - case "xpinstall-install-edit-prefs": - gPrefService.setBoolPref("xpinstall.enabled", true); - getBrowser().hideMessage(null, "top"); - break; - case "xpinstall-install-edit-permissions": - browser = this._getBrowser(aSubject.QueryInterface(Components.interfaces.nsIDocShell)); - if (browser) { - var bundlePreferences = document.getElementById("bundle_preferences"); - webNav = aSubject.QueryInterface(Components.interfaces.nsIWebNavigation); - var params = { blockVisible : false, - sessionVisible : false, - allowVisible : true, - prefilledHost : webNav.currentURI.host, - permissionType : "install", - windowTitle : bundlePreferences.getString("installpermissionstitle"), - introText : bundlePreferences.getString("installpermissionstext") }; - wm = Components.classes["@mozilla.org/appshell/window-mediator;1"] - .getService(Components.interfaces.nsIWindowMediator); - var existingWindow = wm.getMostRecentWindow("Browser:Permissions"); - if (existingWindow) { - existingWindow.initWithParams(params); - existingWindow.focus(); - } - else - window.openDialog("chrome://browser/content/preferences/permissions.xul", - "_blank", "resizable,dialog=no,centerscreen", params); + notificationName = "xpinstall" + messageString = browserBundle.getFormattedString("xpinstallWarning", + [brandShortName, host]); - getBrowser().hideMessage(null, "top"); + buttons = [{ + label: browserBundle.getString("xpinstallWarningButton"), + accessKey: browserBundle.getString("xpinstallWarningButton.accesskey"), + popup: null, + callback: function() { return xpinstallEditPermissions(browser.docShell); } + }]; + } + + var notificationBox = gBrowser.getNotificationBox(browser); + if (!notificationBox.getNotificationWithValue(notificationName)) { + const priority = notificationBox.PRIORITY_WARNING_MEDIUM; + const iconURL = "chrome://mozapps/skin/xpinstall/xpinstallItemGeneric.png"; + notificationBox.appendNotification(messageString, notificationName, + iconURL, priority, buttons); + } } break; } } }; +function xpinstallEditPermissions(aDocShell) +{ + var browser = gXPInstallObserver._getBrowser(aDocShell); + if (browser) { + var bundlePreferences = document.getElementById("bundle_preferences"); + var webNav = aDocShell.QueryInterface(Components.interfaces.nsIWebNavigation); + var params = { blockVisible : false, + sessionVisible : false, + allowVisible : true, + prefilledHost : webNav.currentURI.host, + permissionType : "install", + windowTitle : bundlePreferences.getString("installpermissionstitle"), + introText : bundlePreferences.getString("installpermissionstext") }; + wm = Components.classes["@mozilla.org/appshell/window-mediator;1"] + .getService(Components.interfaces.nsIWindowMediator); + var existingWindow = wm.getMostRecentWindow("Browser:Permissions"); + if (existingWindow) { + existingWindow.initWithParams(params); + existingWindow.focus(); + } + else + window.openDialog("chrome://browser/content/preferences/permissions.xul", + "_blank", "resizable,dialog=no,centerscreen", params); + return false; + } + + return true; +} + function BrowserStartup() { gBrowser = document.getElementById("content"); @@ -846,9 +865,6 @@ function delayedStartup() var os = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService); os.addObserver(gSessionHistoryObserver, "browser:purge-session-history", false); os.addObserver(gXPInstallObserver, "xpinstall-install-blocked", false); - os.addObserver(gXPInstallObserver, "xpinstall-install-edit-prefs", false); - os.addObserver(gXPInstallObserver, "xpinstall-install-edit-permissions", false); - os.addObserver(gMissingPluginInstaller, "missing-plugin", false); if (!gPrefService) gPrefService = Components.classes["@mozilla.org/preferences-service;1"] @@ -1007,9 +1023,6 @@ function BrowserShutdown() .getService(Components.interfaces.nsIObserverService); os.removeObserver(gSessionHistoryObserver, "browser:purge-session-history"); os.removeObserver(gXPInstallObserver, "xpinstall-install-blocked"); - os.removeObserver(gXPInstallObserver, "xpinstall-install-edit-permissions"); - os.removeObserver(gXPInstallObserver, "xpinstall-install-edit-prefs"); - os.removeObserver(gMissingPluginInstaller, "missing-plugin"); try { gBrowser.removeProgressListener(window.XULBrowserWindow); @@ -2443,9 +2456,9 @@ function toggleAffectedChrome(aHide) gChromeState.sidebarOpen = !sidebar.hidden; gSidebarCommand = sidebar.getAttribute("sidebarcommand"); - var message = gBrowser.getMessageForBrowser(gBrowser.selectedBrowser, "top"); - gChromeState.messageOpen = !message.hidden; - message.hidden = aHide; + var notificationBox = gBrowser.getNotificationBox(); + gChromeState.notificationsOpen = !notificationBox.notificationsHidden; + notificationBox.notificationsHidden = aHide; var statusbar = document.getElementById("status-bar"); gChromeState.statusbarOpen = !statusbar.hidden; @@ -2456,9 +2469,8 @@ function toggleAffectedChrome(aHide) gFindBar.closeFindBar(); } else { - if (gChromeState.messageOpen) { - var message = gBrowser.getMessageForBrowser(gBrowser.selectedBrowser, "top"); - message.hidden = aHide; + if (gChromeState.notificationsOpen) { + gBrowser.getNotificationBox().notificationsHidden = aHide; } if (gChromeState.statusbarOpen) { @@ -3523,7 +3535,7 @@ nsBrowserStatusHandler.prototype = if (newIndexOfHash != -1) newSpec = newSpec.substr(0, newSpec.indexOf("#")); if (newSpec != oldSpec) { - getBrowser().hideMessage(null, "both"); + gBrowser.getNotificationBox(selectedBrowser).removeAllNotifications(true); } } selectedBrowser.lastURI = aLocation; @@ -6003,7 +6015,8 @@ missingPluginInstaller.prototype.installSinglePlugin = function(aEvent){ if (missingPluginsArray) { window.openDialog("chrome://mozapps/content/plugins/pluginInstallerWizard.xul", - "PFSWindow", "modal,chrome,resizable=yes", {plugins: missingPluginsArray, tab: tabbrowser.mCurrentTab}); + "PFSWindow", "modal,chrome,resizable=yes", + {plugins: missingPluginsArray, tab: tabbrowser.mCurrentTab}); } aEvent.preventDefault(); @@ -6049,32 +6062,35 @@ missingPluginInstaller.prototype.newMissingPlugin = function(aEvent){ tab.missingPlugins[pluginInfo.mimetype] = pluginInfo; var browser = tabbrowser.getBrowserAtIndex(i); - var iconURL = "chrome://mozapps/skin/xpinstall/xpinstallItemGeneric.png"; + var notificationBox = gBrowser.getNotificationBox(browser); + if (!notificationBox.getNotificationWithValue("missing-plugins")) { + var bundle_browser = document.getElementById("bundle_browser"); + var messageString = bundle_browser.getString("missingpluginsMessage.title"); + var buttons = [{ + label: bundle_browser.getString("missingpluginsMessage.button.label"), + accessKey: bundle_browser.getString("missingpluginsMessage.button.accesskey"), + popup: null, + callback: pluginsMissing + }]; - var bundle_browser = document.getElementById("bundle_browser"); - var messageString = bundle_browser.getString("missingpluginsMessage.title"); - var buttonString = bundle_browser.getString("missingpluginsMessage.button.label"); - var buttonAccesskeyString = bundle_browser.getString("missingpluginsMessage.button.accesskey"); - - tabbrowser.showMessage(browser, iconURL, messageString, buttonString,"", - "missing-plugin", null, "top", true, buttonAccesskeyString); -} - -missingPluginInstaller.prototype.observe = function(aSubject, aTopic, aData){ - switch (aTopic) { - case "missing-plugin": - // get the urls of missing plugins - var tabbrowser = getBrowser(); - var missingPluginsArray = tabbrowser.mCurrentTab.missingPlugins; - - if (missingPluginsArray) { - window.openDialog("chrome://mozapps/content/plugins/pluginInstallerWizard.xul", - "PFSWindow", "modal,chrome,resizable=yes", {plugins: missingPluginsArray, tab: tabbrowser.mCurrentTab}); - } - - break; + const priority = notificationBox.PRIORITY_WARNING_MEDIUM; + const iconURL = "chrome://mozapps/skin/xpinstall/xpinstallItemGeneric.png"; + notificationBox.appendNotification(messageString, "missing-plugins", + iconURL, priority, buttons); } } + +function pluginsMissing() +{ + // get the urls of missing plugins + var tabbrowser = getBrowser(); + var missingPluginsArray = tabbrowser.mCurrentTab.missingPlugins; + if (missingPluginsArray) { + window.openDialog("chrome://mozapps/content/plugins/pluginInstallerWizard.xul", + "PFSWindow", "modal,chrome,resizable=yes", {plugins: missingPluginsArray, tab: tabbrowser.mCurrentTab}); + } +} + var gMissingPluginInstaller = new missingPluginInstaller(); function convertFromUnicode(charset, str) diff --git a/mozilla/browser/themes/pinstripe/browser/browser.css b/mozilla/browser/themes/pinstripe/browser/browser.css index 87a47f80f6d..3ba74ae7b87 100755 --- a/mozilla/browser/themes/pinstripe/browser/browser.css +++ b/mozilla/browser/themes/pinstripe/browser/browser.css @@ -878,30 +878,6 @@ tabpanels.plain { background-color: #fff !important; } -browsermessage { - background-color: #E6E6E6; - border: 1px solid #C8C8C8; - -moz-border-radius: 7px; - margin: 6px; - padding: 4px; - font: icon; - color: #505050; -} - -.messageImage { - margin: 0px 6px 0px 2px; -} - -.messageText { - margin: 0px 0px 0px 1px; -} - -.messageButton { - font-weight: normal; - color: #000; - margin: 0px 4px 0px 8px; -} - #places-bookmark { list-style-image: url("chrome://browser/skin/places/bookmarksToolbar.png"); } diff --git a/mozilla/toolkit/content/jar.mn b/mozilla/toolkit/content/jar.mn index 766cb020a27..ce90964dde3 100644 --- a/mozilla/toolkit/content/jar.mn +++ b/mozilla/toolkit/content/jar.mn @@ -48,6 +48,7 @@ toolkit.jar: *+ content/global/bindings/menu.xml (widgets/menu.xml) *+ content/global/bindings/menulist.xml (widgets/menulist.xml) *+ content/global/bindings/nativescrollbar.xml (widgets/nativescrollbar.xml) +*+ content/global/bindings/notification.xml (widgets/notification.xml) *+ content/global/bindings/popup.xml (widgets/popup.xml) *+ content/global/bindings/preferences.xml (widgets/preferences.xml) *+ content/global/bindings/progressmeter.xml (widgets/progressmeter.xml) diff --git a/mozilla/toolkit/content/widgets/browser.xml b/mozilla/toolkit/content/widgets/browser.xml index 6f8ec56be71..c687c130ee2 100644 --- a/mozilla/toolkit/content/widgets/browser.xml +++ b/mozilla/toolkit/content/widgets/browser.xml @@ -919,184 +919,5 @@ - - - - - - - - - - - - - - - - - - - - - - document.getAnonymousElementByAttribute(this, "anonid", "messageImage"); - - - - - - - - - - - - null; - - - ""; - - - - ""; - - - - - - - - - - - - document.getAnonymousElementByAttribute(this, "anonid", "messageText"); - - - ""; - - - - - - - - - - - - document.getAnonymousElementByAttribute(this, "anonid", "messageButton"); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if (event.originalTarget.getAttribute("anonid") == "messageButton") { - var os = Components.classes["@mozilla.org/observer-service;1"] - .getService(Components.interfaces.nsIObserverService); - var subject = this.docShell ? this.docShell : null; - os.notifyObservers(subject, this.source, ""); - } - - - diff --git a/mozilla/toolkit/content/widgets/notification.xml b/mozilla/toolkit/content/widgets/notification.xml new file mode 100644 index 00000000000..d552936ebaf --- /dev/null +++ b/mozilla/toolkit/content/widgets/notification.xml @@ -0,0 +1,321 @@ + + + + + + + + + + + + + + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + + null + 4 + + null + null + + + + if (val) + this.setAttribute('notificationshidden', true); + else this.removeAttribute('notificationshidden'); + + + + + + + + + = 0; n--) { + if (aValue == notifications[n].value) + return notifications[n]; + } + return null; + ]]> + + + + + + + + + + + this.PRIORITY_CRITICAL_BLOCK) + throw "Invalid notification priority " + aPriority; + + // check for where the notification should be inserted according to + // priority. If two are equal, the existing one appears on top. + var notifications = this.allNotifications; + var insertPos = null; + for (n = notifications.length - 1; n >= 0; n--) { + if (notifications[n].priority < aPriority) + break; + insertPos = notifications[n]; + } + + const XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; + var newitem = document.createElementNS(XULNS, "notification"); + newitem.setAttribute("label", aLabel); + newitem.setAttribute("value", aValue); + newitem.setAttribute("image", aImage); + this.insertBefore(newitem, insertPos); + + if (aButtons) { + for (var b = 0; b < aButtons.length; b++) { + var button = aButtons[b]; + var buttonElem = document.createElementNS(XULNS, "button"); + buttonElem.setAttribute("label", button.label); + buttonElem.setAttribute("accesskey", button.accessKey); + + newitem.appendChild(buttonElem); + buttonElem.buttonInfo = button; + } + } + + newitem.priority = aPriority; + if (aPriority >= this.PRIORITY_CRITICAL_LOW) + newitem.type = "critical"; + else if (aPriority <= this.PRIORITY_INFO_HIGH) + newitem.type = "info"; + else + newitem.type = "warning"; + + // Fire event for accessibility APIs + var event = document.createEvent("Events"); + event.initEvent("AlertActive", true, true); + this.dispatchEvent(event); + + if (!insertPos) + this._showNotification(newitem, true); + return newitem; + ]]> + + + + + + + + + + + + + + + + + + + + = 0; n--) { + if (aImmediate) + this.removeChild(notifications[n]); + else + this.removeNotification(notifications[n]); + } + this.currentNotification = null; + ]]> + + + + + + + + 0 && margin + change >= 0) { + aNotification.style.marginTop = "0px"; + aNotification.style.opacity = 1; + done = true; + } + else if (change < 0 && margin + change <= -height) { + aNotification.style.marginTop = -height + "px"; + done = true; + } + else { + aNotification.style.marginTop = (margin + change) + "px"; + if (opacitychange) + aNotification.style.opacity = + Number(aNotification.style.opacity) + opacitychange; + } + + if (done) { + clearInterval(self._timer); + var newitem; + if (aSlideIn) { + newitem = aNotification; + } + else { + aNotification.parentNode.removeChild(aNotification); + var notifications = self.allNotifications; + var idx = notifications.length - 1; + if (idx >= 0) + newitem = notifications[idx]; + } + if (newitem) + self.currentNotification = newitem; + } + } + + this._timer = setInterval(slide, 50); + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mozilla/toolkit/content/widgets/tabbrowser.xml b/mozilla/toolkit/content/widgets/tabbrowser.xml index 89c5b3cc287..62c54c5c90d 100644 --- a/mozilla/toolkit/content/widgets/tabbrowser.xml +++ b/mozilla/toolkit/content/widgets/tabbrowser.xml @@ -111,11 +111,10 @@ - - + + + @@ -215,68 +214,15 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - @@ -897,7 +843,7 @@ var i = 0; for ( ; i < this.parentNode.parentNode.childNodes.length; i++) { - if (this.parentNode.parentNode.childNodes[i].firstChild.nextSibling == this) + if (this.parentNode.parentNode.childNodes[i].firstChild == this) break; } @@ -1037,19 +983,6 @@ - - - - - - - @@ -1172,14 +1105,13 @@ b.setAttribute("autocompletepopup", this.getAttribute("autocompletepopup")); // Add the Message and the Browser to the box - var vbox = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", - "vbox"); - vbox.setAttribute("flex", "1"); - vbox.appendChild(this._createMessage("top")); - vbox.appendChild(b); - vbox.appendChild(this._createMessage("bottom")); + var notificationbox = document.createElementNS( + "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", + "notificationbox"); + notificationbox.setAttribute("flex", "1"); + notificationbox.appendChild(b); b.setAttribute("flex", "1"); - this.mPanelContainer.appendChild(vbox); + this.mPanelContainer.appendChild(notificationbox); b.addEventListener("DOMTitleChanged", this.onTitleChanged, false); @@ -2213,7 +2145,7 @@ diff --git a/mozilla/toolkit/content/xul.css b/mozilla/toolkit/content/xul.css index 29ff0f1858f..ad5c4dd1cdf 100644 --- a/mozilla/toolkit/content/xul.css +++ b/mozilla/toolkit/content/xul.css @@ -148,10 +148,6 @@ browser { -moz-binding: url("chrome://global/content/bindings/browser.xml#browser"); } -browsermessage { - -moz-binding: url("chrome://global/content/bindings/browser.xml#browsermessage"); -} - tabbrowser { -moz-binding: url("chrome://global/content/bindings/tabbrowser.xml#tabbrowser"); } @@ -164,6 +160,21 @@ iframe { -moz-binding: url("chrome://global/content/bindings/general.xml#iframe"); } +/********** notifications **********/ + +notificationbox { + -moz-binding: url("chrome://global/content/bindings/notification.xml#notificationbox"); + -moz-box-orient: vertical; +} + +notification { + -moz-binding: url("chrome://global/content/bindings/notification.xml#notification"); +} + +.notificationbox-stack { + overflow-y: hidden; +} + /********** image **********/ image { diff --git a/mozilla/toolkit/themes/pinstripe/global/jar.mn b/mozilla/toolkit/themes/pinstripe/global/jar.mn index d24b0fbd855..7b0ae38a2b5 100644 --- a/mozilla/toolkit/themes/pinstripe/global/jar.mn +++ b/mozilla/toolkit/themes/pinstripe/global/jar.mn @@ -34,6 +34,7 @@ classic.jar: + skin/classic/global/listbox.css + skin/classic/global/menu.css + skin/classic/global/menulist.css ++ skin/classic/global/notification.css + skin/classic/global/netError.css + skin/classic/global/popup.css + skin/classic/global/progressmeter.css diff --git a/mozilla/toolkit/themes/pinstripe/global/notification.css b/mozilla/toolkit/themes/pinstripe/global/notification.css new file mode 100644 index 00000000000..4fa2ecff5b4 --- /dev/null +++ b/mozilla/toolkit/themes/pinstripe/global/notification.css @@ -0,0 +1,34 @@ +@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); + +notification { + background-color: InfoBackground; + color: InfoText; +} + +notification[type="info"] { + background-color: -moz-Dialog; +} + +notification[type="critical"] { + background-color: red; +} + +.messageImage { + width: 16px; + height: 16px; +} + +.messageText { + -moz-margin-start: 5px; +} + +.messageButton { + margin: 0px 5px 0px 5px; +} + +.messageCloseButton { + -moz-appearance: none; + padding-right: 4px; + list-style-image: url("chrome://global/skin/icons/closetab.png") !important; + border: none; +} diff --git a/mozilla/toolkit/themes/winstripe/global/browser.css b/mozilla/toolkit/themes/winstripe/global/browser.css index 343ef82967f..995903e4625 100644 --- a/mozilla/toolkit/themes/winstripe/global/browser.css +++ b/mozilla/toolkit/themes/winstripe/global/browser.css @@ -71,33 +71,6 @@ tab { display: -moz-box; } -browsermessage { - background-color: InfoBackground; - color: InfoText; - padding: 3px; -} - -browsermessage[type="top"] { - border-bottom: 1px solid ThreeDDarkShadow; -} - -browsermessage[type="bottom"] { - border-top: 1px solid ThreeDDarkShadow; -} - -.messageImage { - width: 16px; - height: 16px; -} - -.messageText { - -moz-margin-start: 5px; -} - -.messageButton { - margin: 0px 5px 0px 5px; -} - /** * In-tab close button */ diff --git a/mozilla/toolkit/themes/winstripe/global/jar.mn b/mozilla/toolkit/themes/winstripe/global/jar.mn index 5ba04905c8d..2f727d89976 100644 --- a/mozilla/toolkit/themes/winstripe/global/jar.mn +++ b/mozilla/toolkit/themes/winstripe/global/jar.mn @@ -20,6 +20,7 @@ classic.jar: skin/classic/global/listbox.css skin/classic/global/menu.css skin/classic/global/menulist.css + skin/classic/global/notification.css skin/classic/global/netError.css skin/classic/global/popup.css skin/classic/global/preferences.css diff --git a/mozilla/toolkit/themes/winstripe/global/notification.css b/mozilla/toolkit/themes/winstripe/global/notification.css new file mode 100644 index 00000000000..ed445250ebe --- /dev/null +++ b/mozilla/toolkit/themes/winstripe/global/notification.css @@ -0,0 +1,43 @@ +@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); + +notification { + background-color: InfoBackground; + color: InfoText; +} + +notification[type="info"] { + background-color: -moz-Dialog; +} + +notification[type="critical"] { + background-color: red; +} + +.messageImage { + width: 16px; + height: 16px; +} + +.messageText { + -moz-margin-start: 5px; +} + +.messageButton { + margin: 0px 5px 0px 5px; +} + +.messageCloseButton { + list-style-image: url("chrome://global/skin/icons/close.png"); + -moz-appearance: none; + -moz-image-region: rect(0px, 16px, 16px, 0px); + padding: 4px 2px; + border: none !important; +} + +.messageCloseButton:hover { + -moz-image-region: rect(0px, 32px, 16px, 16px); +} + +.messageCloseButton:hover:active { + -moz-image-region: rect(0px, 48px, 16px, 32px); +} \ No newline at end of file