Skip to content

Commit

Permalink
add option to always hide titlebars
Browse files Browse the repository at this point in the history
fixes issue #122
  • Loading branch information
jonian committed Oct 3, 2019
1 parent b7a3120 commit 35282b4
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 3 deletions.
7 changes: 6 additions & 1 deletion unite@hardpixel.eu/modules/windowDecoration.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down
Binary file modified unite@hardpixel.eu/schemas/gschemas.compiled
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<value value="1" nick="tiled" />
<value value="2" nick="maximized" />
<value value="3" nick="both" />
<value value="4" nick="always" />
</enum>

<enum id="org.gnome.shell.extensions.unite.showTitle">
Expand Down
3 changes: 1 addition & 2 deletions unite@hardpixel.eu/settings.ui
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,6 @@
<property name="position">5</property>
</packing>
</child>

<child>
<object class="GtkBox" id="restrict_to_primary_screen_section">
<property name="visible">True</property>
Expand Down Expand Up @@ -292,7 +291,6 @@
<property name="position">6</property>
</packing>
</child>

<child>
<object class="GtkBox" id="desktop_name_text_section">
<property name="visible">True</property>
Expand Down Expand Up @@ -405,6 +403,7 @@
<item id="1" translatable="yes">Tiled</item>
<item id="2" translatable="yes">Maximized</item>
<item id="3" translatable="yes">Both</item>
<item id="4" translatable="yes">Always</item>
</items>
</object>
<packing>
Expand Down
23 changes: 23 additions & 0 deletions unite@hardpixel.eu/styles/buttons-left-always.css
Original file line number Diff line number Diff line change
@@ -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;
}
15 changes: 15 additions & 0 deletions unite@hardpixel.eu/styles/buttons-right-always.css
Original file line number Diff line number Diff line change
@@ -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;
}

0 comments on commit 35282b4

Please # to comment.