From 35282b4b47dc6ee693be9d7aaf8a81c2eeff52a7 Mon Sep 17 00:00:00 2001 From: Jonian Guveli Date: Thu, 3 Oct 2019 12:34:28 +0300 Subject: [PATCH] add option to always hide titlebars fixes issue #122 --- .../modules/windowDecoration.js | 7 +++++- unite@hardpixel.eu/schemas/gschemas.compiled | Bin 1768 -> 1784 bytes ...g.gnome.shell.extensions.unite.gschema.xml | 1 + unite@hardpixel.eu/settings.ui | 3 +-- .../styles/buttons-left-always.css | 23 ++++++++++++++++++ .../styles/buttons-right-always.css | 15 ++++++++++++ 6 files changed, 46 insertions(+), 3 deletions(-) create mode 100644 unite@hardpixel.eu/styles/buttons-left-always.css create mode 100644 unite@hardpixel.eu/styles/buttons-right-always.css diff --git a/unite@hardpixel.eu/modules/windowDecoration.js b/unite@hardpixel.eu/modules/windowDecoration.js index 1eaf5c2..b2d3c59 100644 --- a/unite@hardpixel.eu/modules/windowDecoration.js +++ b/unite@hardpixel.eu/modules/windowDecoration.js @@ -177,7 +177,10 @@ var WindowDecoration = new GObject.Class({ if (!this._handleWindow(win)) return; - if (isMaximized(win, this._setting)) + let maxed = isMaximized(win, this._setting) + let always = this._setting == 'always' + + if (always || maxed) this._hideTitlebar(win); else this._showTitlebar(win); @@ -189,11 +192,13 @@ var WindowDecoration = new GObject.Class({ let filePath = `${Unite.path}/styles/buttons-${position}`; let maximized = `@import url('${filePath}.css');\n`; let tiled = `@import url('${filePath}-tiled.css');\n`; + let always = `@import url('${filePath}-always.css');\n`; switch (this._setting) { case 'both': styles = maximized + tiled; break; case 'maximized': styles = maximized; break; case 'tiled': styles = tiled; break; + case 'always': styles = always; break; } loadUserStyles(styles); diff --git a/unite@hardpixel.eu/schemas/gschemas.compiled b/unite@hardpixel.eu/schemas/gschemas.compiled index 932d7f882a980bb7c33ed0e2d02df69dc68120a3..8a5a8bb3577af99c5fe6620b443dd98495a4badf 100644 GIT binary patch delta 111 zcmaFC`-69a2k$2~1|aZZ_yVMVYz&>x=s6F_ismigW(JCb*a8e?3>$#-Rv?yc7s&&O qgV_8)@e@G$ED+1b*?NM+L2N;w_yZvQX|pYpJImx6R;kH-Y*7G(?HE=7 delta 107 zcmeyt`+|3Z2k#>`1|aZZcmkwfYz&>x=-CHkMe`PLGXupzYypNch6O-+DG*Dyi{ydC mL2Q1Y_zobw7l`HKY&}8ZAhsY-`~r}EwAq%)on`VAwiE#RA{J-> diff --git a/unite@hardpixel.eu/schemas/org.gnome.shell.extensions.unite.gschema.xml b/unite@hardpixel.eu/schemas/org.gnome.shell.extensions.unite.gschema.xml index 6a9a435..48a69ff 100644 --- a/unite@hardpixel.eu/schemas/org.gnome.shell.extensions.unite.gschema.xml +++ b/unite@hardpixel.eu/schemas/org.gnome.shell.extensions.unite.gschema.xml @@ -25,6 +25,7 @@ + diff --git a/unite@hardpixel.eu/settings.ui b/unite@hardpixel.eu/settings.ui index 233fcef..b37d563 100644 --- a/unite@hardpixel.eu/settings.ui +++ b/unite@hardpixel.eu/settings.ui @@ -252,7 +252,6 @@ 5 - True @@ -292,7 +291,6 @@ 6 - True @@ -405,6 +403,7 @@ Tiled Maximized Both + Always diff --git a/unite@hardpixel.eu/styles/buttons-left-always.css b/unite@hardpixel.eu/styles/buttons-left-always.css new file mode 100644 index 0000000..7a413aa --- /dev/null +++ b/unite@hardpixel.eu/styles/buttons-left-always.css @@ -0,0 +1,23 @@ +headerbar, +.titlebar { + padding-left: 0; +} + +.titlebar headerbar ~ headerbar { + padding-left: 6px; +} + +.titlebar .titlebar { + padding-left: 0; +} + +headerbar > box.left, +.titlebar > box.left { + margin: 0 0 0 -200px; + opacity: 0; +} + +.titlebar.default-decoration { + margin: -200px 0 0; + opacity: 0; +} diff --git a/unite@hardpixel.eu/styles/buttons-right-always.css b/unite@hardpixel.eu/styles/buttons-right-always.css new file mode 100644 index 0000000..0cb815a --- /dev/null +++ b/unite@hardpixel.eu/styles/buttons-right-always.css @@ -0,0 +1,15 @@ +headerbar, +.titlebar { + padding-right: 0; +} + +headerbar > box.right, +.titlebar > box.right { + margin: 0 -200px 0 0; + opacity: 0; +} + +.titlebar.default-decoration { + margin: -200px 0 0; + opacity: 0; +}