From 65cf4ab1f232e747f28718cb42b5162379d11390 Mon Sep 17 00:00:00 2001 From: MrOtherGuy Date: Thu, 23 Jul 2020 09:20:38 +0300 Subject: [PATCH] Add vertical_popup_menubar.css --- chrome/vertical_popup_menubar.css | 51 +++++++++++++++++++++++++++++++ html_resources/tagmap.json | 3 +- tags.csv | 1 + 3 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 chrome/vertical_popup_menubar.css diff --git a/chrome/vertical_popup_menubar.css b/chrome/vertical_popup_menubar.css new file mode 100644 index 0000000..30fdf91 --- /dev/null +++ b/chrome/vertical_popup_menubar.css @@ -0,0 +1,51 @@ +/* Source file https://github.com/MrOtherGuy/firefox-csshacks/tree/master/chrome/vertical_popup_menubar.css made available under Mozilla Public License v. 2.0 +See the above repository for updates as well as full license text. */ + +/* Makes menubar-items (File, Edit etc.) appear vertically as popup + * When menubar is enabled, only the first item will be visible and it will use an icon instead of text. + * When menubar is disabled and you hit Alt to show it, then the menubar items will appear in the corner as overlay. + * Does NOT support toolbar buttons/items in menubar when in disabled mode. + */ + +#toolbar-menubar{ + --uc-menubaritem-height: 28px; + --uc-menubaritem-width: 40px; +} + +menubar > menu{visibility: collapse; transition: visibility 0ms linear 0.1s} +menubar:hover > menu, +#toolbar-menubar[autohide="true"]:not([inactive]) > #menubar-items > menubar > menu{visibility: visible} + +#menubar-items{ + display: block; + position: fixed; + z-index: 10; + background-color: var(--lwt-accent-color); + inset-inline-start: 0; +} +menubar{ -moz-box-orient: vertical; } +menubar > menu { padding: 3px } + +menubar > menu > menupopup{ margin: calc(0px - var(--uc-menubaritem-height)) 0 0 var(--uc-menubaritem-width) } +#toolbar-menubar[autohide="true"][inactive] > #menubar-items{ max-height: 0px; overflow: -moz-hidden-unscrollable } + + +#toolbar-menubar[autohide="true"]:not([inactive]){ margin-bottom: -32px } + +#toolbar-menubar > .titlebar-buttonbox-container + :-moz-any(toolbarbutton,toolbaritem){ margin-inline-start: var(--uc-menubaritem-width) } + +#file-menu{ + fill: currentColor; + visibility: visible; + height: var(--uc-menubaritem-height); + width: var(--uc-menubaritem-width); + -moz-context-properties: fill; + padding: 3px !important; + background-repeat: no-repeat; + background-position: center; +} +menubar:not(:hover) > #file-menu{ background-image: url("chrome://devtools/skin/images/tool-storage.svg"); } + +#file-menu > .menubar-text{ visibility: collapse } +menubar:hover > #file-menu > .menubar-text{ visibility: visible } + diff --git a/html_resources/tagmap.json b/html_resources/tagmap.json index 33b57fe..e6090e0 100644 --- a/html_resources/tagmap.json +++ b/html_resources/tagmap.json @@ -97,5 +97,6 @@ "vertical_context_navigation.css":["navigation","menu","popup"], "vertical_context_navigation_v2.css":["navigation","menu","popup"], "vertical_menubar.css":["menubar","hack"], -"window_control_placeholder_support.css":["window-control","patch"] +"window_control_placeholder_support.css":["window-control","patch"], +"vertical_popup_menubar.css":["menubar","menu","toolbars","popup"] } diff --git a/tags.csv b/tags.csv index 4fc9197..2a6d946 100644 --- a/tags.csv +++ b/tags.csv @@ -97,3 +97,4 @@ vertical_context_navigation.css,navigation,menu,popup vertical_context_navigation_v2.css,navigation,menu,popup vertical_menubar.css,menubar,hack window_control_placeholder_support.css,window-control,patch +vertical_popup_menubar.css,menubar,menu,toolbars,popup