Browse Source

initial commit

Peter Cai 11 months ago
commit
fa96754ce6
Signed by: Peter Cai <[email protected]> GPG Key ID: 71F5FB4E4F3FD54F
6 changed files with 381 additions and 0 deletions
  1. 68
    0
      close.svg
  2. 65
    0
      maximize.svg
  3. 64
    0
      minimize.svg
  4. 58
    0
      userChrome.css
  5. 105
    0
      userChrome.js
  6. 21
    0
      userChrome.xml

+ 68
- 0
close.svg View File

@@ -0,0 +1,68 @@
1
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
3
+
4
+<svg
5
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
6
+   xmlns:cc="http://creativecommons.org/ns#"
7
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
8
+   xmlns:svg="http://www.w3.org/2000/svg"
9
+   xmlns="http://www.w3.org/2000/svg"
10
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
11
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
12
+   width="48"
13
+   height="48"
14
+   viewBox="0 0 12.7 12.7"
15
+   version="1.1"
16
+   id="svg8"
17
+   inkscape:version="0.92.2 2405546, 2018-03-11"
18
+   sodipodi:docname="close.svg">
19
+  <defs
20
+     id="defs2" />
21
+  <sodipodi:namedview
22
+     id="base"
23
+     pagecolor="#ffffff"
24
+     bordercolor="#666666"
25
+     borderopacity="1.0"
26
+     inkscape:pageopacity="0.0"
27
+     inkscape:pageshadow="2"
28
+     inkscape:zoom="31.678384"
29
+     inkscape:cx="14.572874"
30
+     inkscape:cy="21.693397"
31
+     inkscape:document-units="mm"
32
+     inkscape:current-layer="layer1"
33
+     showgrid="false"
34
+     units="px"
35
+     inkscape:window-width="3840"
36
+     inkscape:window-height="2039"
37
+     inkscape:window-x="0"
38
+     inkscape:window-y="60"
39
+     inkscape:window-maximized="1" />
40
+  <metadata
41
+     id="metadata5">
42
+    <rdf:RDF>
43
+      <cc:Work
44
+         rdf:about="">
45
+        <dc:format>image/svg+xml</dc:format>
46
+        <dc:type
47
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
48
+        <dc:title />
49
+      </cc:Work>
50
+    </rdf:RDF>
51
+  </metadata>
52
+  <g
53
+     inkscape:label="Layer 1"
54
+     inkscape:groupmode="layer"
55
+     id="layer1"
56
+     transform="translate(0,-284.29998)">
57
+    <path
58
+       style="fill:none;stroke:#000000;stroke-width:1.05833333;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
59
+       d="M 0.08352173,284.4049 12.57002,296.89975"
60
+       id="path815"
61
+       inkscape:connector-curvature="0" />
62
+    <path
63
+       style="fill:none;stroke:#000000;stroke-width:1.05833333;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
64
+       d="M 12.645189,284.37149 0.06681738,296.94151"
65
+       id="path817"
66
+       inkscape:connector-curvature="0" />
67
+  </g>
68
+</svg>

+ 65
- 0
maximize.svg View File

@@ -0,0 +1,65 @@
1
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
3
+
4
+<svg
5
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
6
+   xmlns:cc="http://creativecommons.org/ns#"
7
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
8
+   xmlns:svg="http://www.w3.org/2000/svg"
9
+   xmlns="http://www.w3.org/2000/svg"
10
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
11
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
12
+   width="48"
13
+   height="48"
14
+   viewBox="0 0 12.7 12.7"
15
+   version="1.1"
16
+   id="svg8"
17
+   inkscape:version="0.92.2 2405546, 2018-03-11"
18
+   sodipodi:docname="maximize.svg">
19
+  <defs
20
+     id="defs2" />
21
+  <sodipodi:namedview
22
+     id="base"
23
+     pagecolor="#ffffff"
24
+     bordercolor="#666666"
25
+     borderopacity="1.0"
26
+     inkscape:pageopacity="0.0"
27
+     inkscape:pageshadow="2"
28
+     inkscape:zoom="31.678384"
29
+     inkscape:cx="32.348213"
30
+     inkscape:cy="21.914799"
31
+     inkscape:document-units="mm"
32
+     inkscape:current-layer="layer1"
33
+     showgrid="false"
34
+     units="px"
35
+     inkscape:window-width="3840"
36
+     inkscape:window-height="2039"
37
+     inkscape:window-x="0"
38
+     inkscape:window-y="60"
39
+     inkscape:window-maximized="1" />
40
+  <metadata
41
+     id="metadata5">
42
+    <rdf:RDF>
43
+      <cc:Work
44
+         rdf:about="">
45
+        <dc:format>image/svg+xml</dc:format>
46
+        <dc:type
47
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
48
+        <dc:title></dc:title>
49
+      </cc:Work>
50
+    </rdf:RDF>
51
+  </metadata>
52
+  <g
53
+     inkscape:label="Layer 1"
54
+     inkscape:groupmode="layer"
55
+     id="layer1"
56
+     transform="translate(0,-284.29998)">
57
+    <rect
58
+       style="opacity:1;fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.94468272;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
59
+       id="rect837"
60
+       width="11.749166"
61
+       height="11.75752"
62
+       x="0.47306734"
63
+       y="284.77765" />
64
+  </g>
65
+</svg>

+ 64
- 0
minimize.svg View File

@@ -0,0 +1,64 @@
1
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
3
+
4
+<svg
5
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
6
+   xmlns:cc="http://creativecommons.org/ns#"
7
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
8
+   xmlns:svg="http://www.w3.org/2000/svg"
9
+   xmlns="http://www.w3.org/2000/svg"
10
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
11
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
12
+   width="48"
13
+   height="48"
14
+   viewBox="0 0 12.7 12.7"
15
+   version="1.1"
16
+   id="svg8"
17
+   inkscape:version="0.92.2 2405546, 2018-03-11"
18
+   sodipodi:docname="minimize.svg">
19
+  <defs
20
+     id="defs2" />
21
+  <sodipodi:namedview
22
+     id="base"
23
+     pagecolor="#ffffff"
24
+     bordercolor="#666666"
25
+     borderopacity="1.0"
26
+     inkscape:pageopacity="0.0"
27
+     inkscape:pageshadow="2"
28
+     inkscape:zoom="22.4"
29
+     inkscape:cx="29.760268"
30
+     inkscape:cy="23.645942"
31
+     inkscape:document-units="mm"
32
+     inkscape:current-layer="layer1"
33
+     showgrid="false"
34
+     units="px"
35
+     inkscape:window-width="3840"
36
+     inkscape:window-height="2039"
37
+     inkscape:window-x="0"
38
+     inkscape:window-y="60"
39
+     inkscape:window-maximized="1" />
40
+  <metadata
41
+     id="metadata5">
42
+    <rdf:RDF>
43
+      <cc:Work
44
+         rdf:about="">
45
+        <dc:format>image/svg+xml</dc:format>
46
+        <dc:type
47
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
48
+        <dc:title></dc:title>
49
+      </cc:Work>
50
+    </rdf:RDF>
51
+  </metadata>
52
+  <g
53
+     inkscape:label="Layer 1"
54
+     inkscape:groupmode="layer"
55
+     id="layer1"
56
+     transform="translate(0,-284.29998)">
57
+    <path
58
+       style="fill:none;stroke:#000000;stroke-width:1.01325345;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
59
+       d="M 0.05433414,290.64998 H 12.645666"
60
+       id="path815"
61
+       inkscape:connector-curvature="0"
62
+       sodipodi:nodetypes="cc" />
63
+  </g>
64
+</svg>

+ 58
- 0
userChrome.css View File

@@ -0,0 +1,58 @@
1
[email protected] url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
2
+
3
+toolbarbutton#alltabs-button {
4
+  -moz-binding: url("userChrome.xml#js");
5
+}
6
+
7
+#TabsToolbar {
8
+  margin-right: 84px !important;
9
+}
10
+
11
+.titlebar-placeholder {
12
+  display:none !important;
13
+}
14
+
15
+.titlebar-button {
16
+  margin-right: 2px !important;
17
+}
18
+
19
+.titlebar-button > .toolbarbutton-icon {
20
+	height: 13px !important;
21
+	min-height: 13px !important;
22
+	width: 13px !important;
23
+	min-width: 13px !important;
24
+  margin: 3px !important;
25
+}
26
+
27
+#titlebar-close {
28
+  list-style-image: url("close.svg") !important;
29
+  filter: invert(1) !important;
30
+  -moz-appearance: none !important;
31
+}
32
+
33
+#titlebar-close:hover {
34
+  list-style-image: url("close.svg") !important;
35
+  background-color: #00000033 !important;
36
+}
37
+
38
+#titlebar-max {
39
+  list-style-image: url("maximize.svg") !important;
40
+  filter: invert(1) !important;
41
+  -moz-appearance: none !important;
42
+}
43
+
44
+#titlebar-max:hover {
45
+  list-style-image: url("maximize.svg") !important;
46
+  background-color: #00000033 !important;
47
+}
48
+
49
+#titlebar-min {
50
+  list-style-image: url("minimize.svg") !important;
51
+  filter: invert(1) !important;
52
+  -moz-appearance: none !important;
53
+}
54
+
55
+#titlebar-min:hover {
56
+  list-style-image: url("minimize.svg") !important;
57
+  background-color: #00000033 !important;
58
+}

+ 105
- 0
userChrome.js View File

@@ -0,0 +1,105 @@
1
+// ==UserScript==
2
+// @name           userChrome.js
3
+// @namespace      scrollbars_win10
4
+// @version        0.0.4
5
+// @note           Windows 10 style by /u/mrkwatz https://www.reddit.com/r/FirefoxCSS/comments/7fkha6/firefox_57_windows_10_uwp_style_overlay_scrollbars/
6
+// @note           Brought to Firefox 57 by /u/Wiidesire https://www.reddit.com/r/firefox/comments/7f6kc4/floating_scrollbar_finally_possible_in_firefox_57/
7
+// @note           userChrome.js https://github.com/nuchi/firefox-quantum-userchromejs
8
+// @note           Forked from https://github.com/Endor8/userChrome.js/blob/master/floatingscrollbar/FloatingScrollbar.uc.js
9
+// ==/UserScript==
10
+
11
+(function () {
12
+	var prefs = Services.prefs,
13
+		enabled;
14
+	if (prefs.prefHasUserValue('userChromeJS.floating_scrollbar.enabled')) {
15
+		enabled = prefs.getBoolPref('userChromeJS.floating_scrollbar.enabled')
16
+	} else {
17
+		prefs.setBoolPref('userChromeJS.floating_scrollbar.enabled', true);
18
+		enabled = true;
19
+	}
20
+
21
+	var css = `
22
+		@namespace url(http: //www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
23
+		scrollbar {
24
+			position: relative !important;
25
+			z-index: 2147483647 !important;
26
+		}
27
+		:not(select):not(hbox) > scrollbar {
28
+			-moz-appearance: none!important;
29
+			position: relative!important;
30
+			background-color: transparent;
31
+			pointer-events: none;
32
+		}
33
+		:not(select):not(hbox) > scrollbar thumb {
34
+			-moz-appearance: none!important;
35
+			background-color: transparent;
36
+			pointer-events: auto;
37
+		}
38
+		:not(select):not(hbox) > scrollbar[orient = "vertical"] {
39
+			min-width: 12px!important;
40
+			-moz-margin-start: -12px;/*margin to fill the whole render window with content and overlay the scrollbars*/
41
+		}
42
+		:not(select):not(hbox) > scrollbar[orient = "horizontal"] {
43
+			height: 12px!important;
44
+			margin-top: -12px;
45
+		}
46
+		:not(select):not(hbox) > scrollbar[orient = "vertical"] thumb {
47
+			border-right: 2px solid rgba(133, 132, 131, 1);
48
+			width: 12px;
49
+			min-height: 12px;
50
+			transition: border 0.1s ease-in;
51
+		}
52
+		:not(select):not(hbox) > scrollbar[orient = "horizontal"] thumb {
53
+			border-bottom: 2px solid rgba(133, 132, 131, 1);
54
+			min-width: 12px;
55
+			transition: border 0.1s ease-in;
56
+		}
57
+		:not(select):not(hbox) > scrollbar:hover {
58
+			background-color: rgba(0, 0, 0, 0.25);
59
+			max-width: 12px!important;
60
+			point-events: auto;
61
+		}
62
+		:not(select):not(hbox) > scrollbar:hover thumb {
63
+			border-width: 12px;
64
+			transition: border 0s linear;
65
+		}
66
+		:not(select):not(hbox) > scrollbar scrollbarbutton, :not(select):not(hbox) > scrollbar gripper {
67
+			display: none;
68
+		}
69
+	`;
70
+
71
+	var sss = Cc['@mozilla.org/content/style-sheet-service;1'].getService(Ci.nsIStyleSheetService);
72
+	var uri = makeURI('data:text/css;charset=UTF=8,' + encodeURIComponent(css));
73
+
74
+	var p = document.getElementById('devToolsSeparator');
75
+	var m = document.createElement('menuitem');
76
+	m.setAttribute('label', "Windows 10 Style Scrollbars");
77
+	m.setAttribute('type', 'checkbox');
78
+	m.setAttribute('autocheck', 'false');
79
+	m.setAttribute('checked', enabled);
80
+	p.parentNode.insertBefore(m, p);
81
+	m.addEventListener('command', command, false);
82
+
83
+	if (enabled) {
84
+		sss.loadAndRegisterSheet(uri, sss.AGENT_SHEET);
85
+	}
86
+
87
+	function command() {
88
+		if (sss.sheetRegistered(uri, sss.AGENT_SHEET)) {
89
+			prefs.setBoolPref('userChromeJS.floating_scrollbar.enabled', false);
90
+			sss.unregisterSheet(uri, sss.AGENT_SHEET);
91
+			m.setAttribute('checked', false);
92
+		} else {
93
+			prefs.setBoolPref('userChromeJS.floating_scrollbar.enabled', true);
94
+			sss.loadAndRegisterSheet(uri, sss.AGENT_SHEET);
95
+			m.setAttribute('checked', true);
96
+		}
97
+
98
+		let root = document.documentElement;
99
+		let display = root.style.display;
100
+		root.style.display = 'none';
101
+		window.getComputedStyle(root).display; // Flush
102
+		root.style.display = display;
103
+	}
104
+  
105
+})();

+ 21
- 0
userChrome.xml View File

@@ -0,0 +1,21 @@
1
+<?xml version="1.0"?>
2
+
3
+<bindings id="generalBindings"
4
+   xmlns="http://www.mozilla.org/xbl"
5
+   xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
6
+   xmlns:xbl="http://www.mozilla.org/xbl">
7
+
8
+  <binding id="js" extends="chrome://global/content/bindings/toolbarbutton.xml#menu">
9
+    <implementation>
10
+        <constructor><![CDATA[
11
+            function makeRelativePathURI(name) {
12
+              let absolutePath = Components.stack.filename;
13
+              return absolutePath.substring(0, absolutePath.lastIndexOf("/") + 1) + name;
14
+            }
15
+            // The following code executes in the browser context,
16
+            // i.e. chrome://browser/content/browser.xul
17
+            Services.scriptloader.loadSubScript(makeRelativePathURI("userChrome.js"), window);
18
+        ]]></constructor>
19
+    </implementation>
20
+  </binding>
21
+</bindings>

Loading…
Cancel
Save