From ab2d48a19aa3ede0fc053a099ccaf4038ec05d28 Mon Sep 17 00:00:00 2001 From: Sai Kurogetsu Date: Fri, 8 Jun 2018 03:22:32 +0000 Subject: [PATCH] add support for elementary OS' CSD controls, issue #46 --- ui/csd-elementary.css | 54 +++++++++++++++++++++++++++++++++++++++++++ userChrome.css | 4 ++++ 2 files changed, 58 insertions(+) create mode 100644 ui/csd-elementary.css diff --git a/ui/csd-elementary.css b/ui/csd-elementary.css new file mode 100644 index 0000000..f79417f --- /dev/null +++ b/ui/csd-elementary.css @@ -0,0 +1,54 @@ +@namespace xul url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); + +/* Adjust empty space on the headerbar's sides */ +:root[tabsintitlebar]:not([inFullscreen]) #nav-bar { + margin-left: 43px !important; + margin-right: 43px !important; + padding-left: 7px !important; + padding-right: 7px !important; +} + +/* Remove window controls separator */ +:root[tabsintitlebar]:not([inFullscreen]) #nav-bar::after { + display: none; +} + +/* Remove the spacer pushing window controls to the right */ +:root[tabsintitlebar] #titlebar-spacer { + display: none; +} +:root[tabsintitlebar] #titlebar { + margin-left: -4px; +} +:root[tabsintitlebar] #titlebar-buttonbox { + padding-left: 4px; +} + +/* Expand window controls' container to the window's width */ +:root[tabsintitlebar] #titlebar-content, #titlebar-buttonbox-container { + display: block; +} +:root[tabsintitlebar] #titlebar-buttonbox { + display: flex; +} + +/* Don't let the title bar cover the headerbar */ +:root[tabsintitlebar] #nav-bar { + z-index: 1; +} + +/* Reorder titlebar buttons */ +:root[tabsintitlebar] #titlebar-min { + display: none; +} +:root[tabsintitlebar] #titlebar-buttonbox { + direction: rtl; +} +:root[tabsintitlebar] #titlebar-buttonbox * { + direction: initial; +} + +/* Move the close button to the left and the maximize button to the right */ +:root[tabsintitlebar] #titlebar-buttonbox { + justify-content: space-between; +} diff --git a/userChrome.css b/userChrome.css index 5b2c4fb..9905fbb 100644 --- a/userChrome.css +++ b/userChrome.css @@ -49,6 +49,10 @@ /*@import "ui/csd-2-buttons.css"; /**/ /* Window controls: 3 buttons */ /*@import "ui/csd-3-buttons.css"; /**/ +/* Window controls: elementary OS (close on the left, maximize on the right) + * Warning: this doesn't work with the manual CSD switch, you must use the + * experimental automatic CSD instead */ +/*@import "ui/csd-elementary.css"; /**/ /******************************************************************************* * Other features (optional)