From 6edb9421ccfbb0499d392a94cd40a888db41ebdf Mon Sep 17 00:00:00 2001 From: alstjr7375 Date: Mon, 19 Sep 2022 09:04:57 +0900 Subject: [PATCH] Add: Counter - Bookmark menu --- css/leptonChrome.css | 132 +++++++++++-------- src/counter/_bookmark_menu.scss | 17 +++ src/counter/_index.scss | 9 ++ src/{tab/_counter.scss => counter/_tab.scss} | 0 src/leptonChrome.scss | 3 + src/tab/_index.scss | 5 - user.js | 4 +- 7 files changed, 109 insertions(+), 61 deletions(-) create mode 100644 src/counter/_bookmark_menu.scss create mode 100644 src/counter/_index.scss rename src/{tab/_counter.scss => counter/_tab.scss} (100%) diff --git a/css/leptonChrome.css b/css/leptonChrome.css index 7afb1cf..9da505d 100644 --- a/css/leptonChrome.css +++ b/css/leptonChrome.css @@ -7316,61 +7316,6 @@ display: none !important; } } -/*= Counter for Tab ==========================================================*/ -@supports -moz-bool-pref("userChrome.tab.counter") { - #tabbrowser-tabs { - counter-reset: tab-counts; - } - - .tabbrowser-tab:not([hidden="true"]) { - counter-increment: tab-counts; - } - .tabbrowser-tab:not([hidden="true"])[pinned="true"] .tab-label-container::before { - content: " " counter(tab-counts); - } - .tabbrowser-tab:not([hidden="true"]):not([pinned="true"]) .tab-label-container::before { - content: counter(tab-counts) ": "; - } - .tabbrowser-tab:not([hidden="true"]) .tab-label-container { - display: grid; - align-content: safe center; - align-items: safe center; - } - @supports -moz-bool-pref("userChrome.centered.tab") { - @supports not -moz-bool-pref("userChrome.centered.tab.label") { - .tabbrowser-tab:not([hidden="true"]) .tab-label-container { - justify-content: start; - justify-items: start; - } - } - } - @supports not -moz-bool-pref("userChrome.centered.tab") { - .tabbrowser-tab:not([hidden="true"]) .tab-label-container { - justify-content: start; - justify-items: start; - } - } - .tabbrowser-tab:not([hidden="true"]) .tab-label-container::before { - display: inline-block; - grid-row: 1; - } - .tabbrowser-tab:not([hidden="true"]) .tab-label-container > .tab-text { - grid-row: 1; - } - .tabbrowser-tab:not([hidden="true"]) .tab-label-container[pinned] { - width: unset !important; - /* Original: 0 */ - } - .tabbrowser-tab:not([hidden="true"]) .tab-label-container[pinned] > .tab-text, - .tabbrowser-tab:not([hidden="true"]) .tab-label-container[pinned] > .tab-secondary-label { - width: 0; - } - - .tab-label, - .tab-secondary-label { - overflow: hidden; - } -} /** Url View UI ***************************************************************/ /*= Url View - Move icon to left =============================================*/ @supports -moz-bool-pref("userChrome.urlView.move_icon_to_left") { @@ -7494,6 +7439,83 @@ } } } +/** Others UI **************************************************************/ +/*= Counter for Tab ==========================================================*/ +@supports -moz-bool-pref("userChrome.counter.tab") { + #tabbrowser-tabs { + counter-reset: tab-counts; + } + + .tabbrowser-tab:not([hidden="true"]) { + counter-increment: tab-counts; + } + .tabbrowser-tab:not([hidden="true"])[pinned="true"] .tab-label-container::before { + content: " " counter(tab-counts); + } + .tabbrowser-tab:not([hidden="true"]):not([pinned="true"]) .tab-label-container::before { + content: counter(tab-counts) ": "; + } + .tabbrowser-tab:not([hidden="true"]) .tab-label-container { + display: grid; + align-content: safe center; + align-items: safe center; + } + @supports -moz-bool-pref("userChrome.centered.tab") { + @supports not -moz-bool-pref("userChrome.centered.tab.label") { + .tabbrowser-tab:not([hidden="true"]) .tab-label-container { + justify-content: start; + justify-items: start; + } + } + } + @supports not -moz-bool-pref("userChrome.centered.tab") { + .tabbrowser-tab:not([hidden="true"]) .tab-label-container { + justify-content: start; + justify-items: start; + } + } + .tabbrowser-tab:not([hidden="true"]) .tab-label-container::before { + display: inline-block; + grid-row: 1; + } + .tabbrowser-tab:not([hidden="true"]) .tab-label-container > .tab-text { + grid-row: 1; + } + .tabbrowser-tab:not([hidden="true"]) .tab-label-container[pinned] { + width: unset !important; + /* Original: 0 */ + } + .tabbrowser-tab:not([hidden="true"]) .tab-label-container[pinned] > .tab-text, + .tabbrowser-tab:not([hidden="true"]) .tab-label-container[pinned] > .tab-secondary-label { + width: 0; + } + + .tab-label, + .tab-secondary-label { + overflow: hidden; + } +} +/*= Counter for Bookmark menu ================================================*/ +@supports -moz-bool-pref("userChrome.counter.bookmark_menu") { + menupopup[placespopup="true"] > menu.bookmark-item > .menu-right { + counter-reset: bookmark-counts 0; + } + + menupopup[placespopup="true"] > menu.bookmark-item::after { + display: -moz-inline-box; + content: "(" counter(bookmark-counts) ")"; + } + + menupopup[placespopup="true"] > menu.bookmark-item > .menu-iconic-highlightable-text, + menupopup[placespopup="true"] > menu.bookmark-item > .menu-accel-container, + menupopup[placespopup="true"] > menu.bookmark-item > .menu-right { + -moz-box-ordinal-group: 2; + } + + menu.bookmark-item > menupopup[placespopup="true"] > .bookmark-item { + counter-increment: bookmark-counts; + } +} /** Fullscreen - Overlap toolbar **********************************************/ @supports -moz-bool-pref("userChrome.fullscreen.overlap") { @supports -moz-bool-pref("browser.fullscreen.autohide") { diff --git a/src/counter/_bookmark_menu.scss b/src/counter/_bookmark_menu.scss new file mode 100644 index 0000000..62359f8 --- /dev/null +++ b/src/counter/_bookmark_menu.scss @@ -0,0 +1,17 @@ +menupopup[placespopup="true"] > menu.bookmark-item > .menu-right { + counter-reset: bookmark-counts 0; +} +menupopup[placespopup="true"] > menu.bookmark-item::after { + display: -moz-inline-box; + content: "(" counter(bookmark-counts) ")"; +} + +menupopup[placespopup="true"] > menu.bookmark-item > .menu-iconic-highlightable-text, +menupopup[placespopup="true"] > menu.bookmark-item > .menu-accel-container, +menupopup[placespopup="true"] > menu.bookmark-item > .menu-right { + -moz-box-ordinal-group: 2; +} + +menu.bookmark-item > menupopup[placespopup="true"] > .bookmark-item { + counter-increment: bookmark-counts; +} diff --git a/src/counter/_index.scss b/src/counter/_index.scss new file mode 100644 index 0000000..2fea34a --- /dev/null +++ b/src/counter/_index.scss @@ -0,0 +1,9 @@ +/*= Counter for Tab ==========================================================*/ +@include Option("userChrome.counter.tab") { + @import "tab"; +} + +/*= Counter for Bookmark menu ================================================*/ +@include Option("userChrome.counter.bookmark_menu") { + @import "bookmark_menu"; +} diff --git a/src/tab/_counter.scss b/src/counter/_tab.scss similarity index 100% rename from src/tab/_counter.scss rename to src/counter/_tab.scss diff --git a/src/leptonChrome.scss b/src/leptonChrome.scss index dc06906..d0b793e 100644 --- a/src/leptonChrome.scss +++ b/src/leptonChrome.scss @@ -48,6 +48,9 @@ /** Sidebar UI ****************************************************************/ @import "sidebar/index"; +/** Others UI **************************************************************/ +@import "counter/index"; + /** Fullscreen - Overlap toolbar **********************************************/ @import "fullscreen/index"; diff --git a/src/tab/_index.scss b/src/tab/_index.scss index 3d3ee00..ec088a5 100644 --- a/src/tab/_index.scss +++ b/src/tab/_index.scss @@ -39,8 +39,3 @@ @include Option("userChrome.tab.crashed") { @import "crashed_tab"; } - -/*= Counter for Tab ==========================================================*/ -@include Option("userChrome.tab.counter") { - @import "counter"; -} diff --git a/user.js b/user.js index 4401261..5c0525a 100644 --- a/user.js +++ b/user.js @@ -107,6 +107,9 @@ user_pref("userChrome.rounding.square_tab", false); // user_pref("userChrome.centered.urlbar", true); // user_pref("userChrome.centered.bookmarkbar", true); +// user_pref("userChrome.counter.tab", true); +// user_pref("userChrome.counter.bookmark_menu", true); + // user_pref("userChrome.rounding.square_button", true); // user_pref("userChrome.rounding.square_panel", true); // user_pref("userChrome.rounding.square_panelitem", true); @@ -146,7 +149,6 @@ user_pref("userChrome.rounding.square_tab", false); // user_pref("userChrome.tab.close_button_at_pinned.background", true); // user_pref("userChrome.tab.close_button_at_hover.always", true); // Need close_button_at_hover // user_pref("userChrome.tab.sound_show_label", true); // Need remove sound_hide_label -// user_pref("userChrome.tab.counter", true); // user_pref("userChrome.panel.remove_strip", true); // user_pref("userChrome.panel.full_width_separator", true);