diff options
author | Pale Moon <git-repo@palemoon.org> | 2016-04-18 17:40:44 +0200 |
---|---|---|
committer | Pale Moon <git-repo@palemoon.org> | 2016-04-18 17:40:44 +0200 |
commit | 07e3c01f5011974fdbd2f59cd37930d062b18ed3 (patch) | |
tree | e5800c3f8a2622a282b3437aa6a56805de4b9aee | |
parent | 20f11644f4726cc412e591060ef24ddf4a19d644 (diff) | |
download | palemoon-gre-07e3c01f5011974fdbd2f59cd37930d062b18ed3.tar.gz |
Fix color detection module, revert incorrect style changes, add style change to window title.
-rw-r--r-- | browser/base/content/browser-title.css | 6 | ||||
-rw-r--r-- | browser/modules/Windows8WindowFrameColor.jsm | 32 | ||||
-rw-r--r-- | browser/themes/windows/browser-aero.css | 21 |
3 files changed, 22 insertions, 37 deletions
diff --git a/browser/base/content/browser-title.css b/browser/base/content/browser-title.css index 934d5f024..e7aa84a46 100644 --- a/browser/base/content/browser-title.css +++ b/browser/base/content/browser-title.css @@ -188,7 +188,11 @@ #main-window[sizemode="maximized"]::after { top: -5px; } - + + #main-window[darkwindowframe="true"]::after { + /* Dark window frame/accent color on Win 8/10 */ + color: white; + } } } diff --git a/browser/modules/Windows8WindowFrameColor.jsm b/browser/modules/Windows8WindowFrameColor.jsm index 096347342..a49d4d7c4 100644 --- a/browser/modules/Windows8WindowFrameColor.jsm +++ b/browser/modules/Windows8WindowFrameColor.jsm @@ -17,11 +17,13 @@ const Windows8WindowFrameColor = { get: function() { if (this._windowFrameColor) return this._windowFrameColor; - - let windowFrameColor = WindowsRegistry.readRegKey(Ci.nsIWindowsRegKey.ROOT_KEY_CURRENT_USER, - "Software\\Microsoft\\Windows\\DWM", + + let HKCU = Ci.nsIWindowsRegKey.ROOT_KEY_CURRENT_USER; + let dwmKey = "Software\\Microsoft\\Windows\\DWM"; + + let windowFrameColor = WindowsRegistry.readRegKey(HKCU, dwmKey, "ColorizationColor"); - if (!customizationColor) { + if (!windowFrameColor) { // This seems to be the default color if unset return [158, 158, 158]; } @@ -30,17 +32,17 @@ const Windows8WindowFrameColor = { // Zero-pad the number just to make sure that it is 8 digits. windowFrameColorHex = ("00000000" + windowFrameColorHex).substr(-8); let windowFrameColorArray = windowFrameColorHex.match(/../g); - let [unused, fgR, fgG, fgB] = windowFrameColorArray.map(function(val) parseInt(val, 16));
- let windowFrameColorBalance = WindowsRegistry.readRegKey(HKCU, dwmKey,
- "ColorizationColorBalance") || 0.5;
- // Window frame base color when Color Intensity is at 0.
- let frameBaseColor = 217;
- let alpha = windowFrameColorBalance / 100;
-
- // Alpha-blend the foreground color with the frame base color.
- let r = Math.round(fgR * alpha + frameBaseColor * (1 - alpha));
- let g = Math.round(fgG * alpha + frameBaseColor * (1 - alpha));
- let b = Math.round(fgB * alpha + frameBaseColor * (1 - alpha));
+ let [unused, fgR, fgG, fgB] = windowFrameColorArray.map(function(val) parseInt(val, 16)); + let windowFrameColorBalance = WindowsRegistry.readRegKey(HKCU, dwmKey, + "ColorizationColorBalance") || 0.5; + // Window frame base color when Color Intensity is at 0. + let frameBaseColor = 217; + let alpha = windowFrameColorBalance / 100; + + // Alpha-blend the foreground color with the frame base color. + let r = Math.round(fgR * alpha + frameBaseColor * (1 - alpha)); + let g = Math.round(fgG * alpha + frameBaseColor * (1 - alpha)); + let b = Math.round(fgB * alpha + frameBaseColor * (1 - alpha)); return this._windowFrameColor = [r, g, b]; }, }; diff --git a/browser/themes/windows/browser-aero.css b/browser/themes/windows/browser-aero.css index b88f32277..c211e36c8 100644 --- a/browser/themes/windows/browser-aero.css +++ b/browser/themes/windows/browser-aero.css @@ -463,27 +463,6 @@ #main-window[darkwindowframe="true"] #TabsToolbar:not(:-moz-lwtheme):not(:-moz-window-inactive) { color: white; } - - #main-window[darkwindowframe="true"] :-moz-any(#toolbar-menubar, #TabsToolbar) :-moz-any(@primaryToolbarButtons@):not(:-moz-lwtheme):not(:-moz-window-inactive), - #main-window[darkwindowframe="true"] :-moz-any(#toolbar-menubar, #TabsToolbar) #bookmarks-menu-button:not(:-moz-lwtheme) > .toolbarbutton-menubutton-dropmarker > .dropmarker-icon:not(:-moz-window-inactive) { - list-style-image: url(chrome://browser/skin/Toolbar-inverted.png); - } - - #main-window[darkwindowframe="true"] .tabs-newtab-button:not(:-moz-lwtheme):not(:-moz-window-inactive), - #main-window[darkwindowframe="true"] :-moz-any(#toolbar-menubar, #TabsToolbar) > #new-tab-button:not(:-moz-lwtheme):not(:-moz-window-inactive), - #main-window[darkwindowframe="true"] :-moz-any(#toolbar-menubar, #TabsToolbar) > toolbarpaletteitem > #new-tab-button:not(:-moz-lwtheme):not(:-moz-window-inactive) { - list-style-image: url(chrome://browser/skin/tabbrowser/newtab-inverted.png); - } - - #main-window[darkwindowframe="true"] .tab-close-button:not(:-moz-any(:hover, [selected="true"], :-moz-lwtheme, :-moz-window-inactive)) { - -moz-image-region: rect(0, 64px, 16px, 48px); - } - - #main-window[darkwindowframe="true"] :-moz-any(#toolbar-menubar, #TabsToolbar) > #sync-button[status="active"]:not(:-moz-lwtheme), - #main-window[darkwindowframe="true"] :-moz-any(#toolbar-menubar, #TabsToolbar) > toolbarpaletteitem > #sync-button[status="active"]:not(:-moz-lwtheme) { - list-style-image: url("chrome://browser/skin/syncProgress-toolbar-inverted.png"); - } - /* ==== ==== */ #main-window[sizemode=fullscreen]:not(:-moz-lwtheme) { |