Skip to content

Commit

Permalink
Fix: General fixes to make the UI take less space
Browse files Browse the repository at this point in the history
  • Loading branch information
lainsce committed Feb 14, 2024
1 parent 28bea04 commit 954ec5b
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 23 deletions.
4 changes: 3 additions & 1 deletion src/resources/style-dark.css
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# dummy
.custom-headerbar {
box-shadow: inset 0 2px 1px 0 alpha(white, .15);
}
45 changes: 28 additions & 17 deletions src/resources/style.css
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
vte-terminal { padding: 6px 6px 6px 6px; }
vte-terminal { padding: 4px 4px 4px 4px; }

.custom-headerbar {
background: @surface_bg_color;
box-shadow: none;
box-shadow: inset 0 2px 0 1px alpha(white, .5);
}

.disclosure-button button {
border-radius: 999px;
background: none;
margin: 0;
}
.disclosure-button button:hover {
background: alpha(@accent_color, 0.08);
Expand All @@ -25,15 +26,25 @@ vte-terminal { padding: 6px 6px 6px 6px; }
padding: 0;
}
.disclosure-button:hover {
background: alpha(@accent_color, 0.08);
background: @accent_bg_color;
color: @accent_fg_color;
}
.disclosure-button:active {
background: @accent_bg_color;
color: @accent_fg_color;
}
.disclosure-button .toggle,
.disclosure-button.image-button {
padding: 6px;
padding: 4px;
}
.disclosure-button .toggle {
box-shadow: none;
}
.disclosure-button:hover .toggle {
background: none;
}
.disclosure-button:active .toggle {
background: none;
}

.accelerator-main-window.with-borders:not(.fullscreen):not(.maximized):not(.tiled-left):not(.tiled-right) {
Expand All @@ -50,38 +61,38 @@ vte-terminal { padding: 6px 6px 6px 6px; }

.custom-headerbar:backdrop windowhandle { filter: none; }

.custom-headerbar:backdrop > * { filter: opacity(0.5); }
.custom-headerbar:backdrop * { filter: opacity(0.95); }

tab {
border-radius: 0;
border: none;
margin-top: 0;
margin-bottom: -2px;
margin-top: 2px;
margin-bottom: -4px;
min-width: 200px;
min-height: 45px;
}

tab label {
margin-left: 16px;
margin-right: 16px;
min-height: 32px;
}

.transparent {
background: transparent;
}

.tab-child {
margin: 4px 0 0;
border-radius: 12px 12px 0 0;
margin: 0;
border-radius: 4px 4px 0 0;
}

.tab-child.active {
background: @surface_container_bg_color;
}

.tab-child label {
padding: 0;
margin: 0;
padding: 0 6px;
margin: -4px 0;
}

.tab-child button {
margin: -4px 6px 0 0;
border-radius: 999px;
}

.accelerator-main-window.with-borders tab:selected,
Expand Down
16 changes: 11 additions & 5 deletions src/widgets/HeaderBar.vala
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public abstract class Terminal.BaseHeaderBar : Gtk.Box {
halign = Gtk.Align.END,
};
menu_button.add_css_class ("disclosure-button");
menu_button.get_popover ().has_arrow = false;

Settings.get_default ().schema.bind (
"show-menu-button",
Expand Down Expand Up @@ -85,8 +86,7 @@ public class Terminal.HeaderBar : BaseHeaderBar {
public HeaderBar (Window window) {
base (window);

var hb = new Gtk.HeaderBar ();
hb.show_title_buttons = false;
var hb = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0);
hb.halign = Gtk.Align.FILL;
hb.hexpand = true;

Expand All @@ -102,7 +102,9 @@ public class Terminal.HeaderBar : BaseHeaderBar {
this.unfullscreen_button.add_css_class ("disclosure-button");

this.left_controls = new Gtk.WindowControls (Gtk.PackType.START);
left_controls.valign = Gtk.Align.START;
this.right_controls = new Gtk.WindowControls (Gtk.PackType.END);
right_controls.valign = Gtk.Align.START;

this.left_controls.bind_property ("empty", this.left_controls, "visible", GLib.BindingFlags.SYNC_CREATE | GLib.BindingFlags.INVERT_BOOLEAN, null, null);
this.right_controls.bind_property ("empty", this.right_controls, "visible", GLib.BindingFlags.SYNC_CREATE | GLib.BindingFlags.INVERT_BOOLEAN, null, null);
Expand All @@ -122,9 +124,13 @@ public class Terminal.HeaderBar : BaseHeaderBar {
layout.append (button_box);
layout.append (this.right_controls);

hb.set_title_widget (layout);
this.append (hb);
hb.add_css_class ("flat");
hb.append (layout);

var wc = new Gtk.WindowHandle ();
wc.hexpand = true;
wc.set_child (hb);

this.append (wc);
this.add_css_class ("custom-headerbar");

this.connect_signals ();
Expand Down

0 comments on commit 954ec5b

Please sign in to comment.