diff options
-rw-r--r-- | terminal.vala | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/terminal.vala b/terminal.vala index 42da259..58c77e9 100644 --- a/terminal.vala +++ b/terminal.vala @@ -42,6 +42,7 @@ class Terminal : Gtk.Overlay { string hyperlink_match; uint? infobar_timeout_id; double scroll_delta; + int base_width = -1; public Terminal(string[] args, Gtk.Container parent, Gtk.Window window) { Object(parent: parent, window: window); @@ -102,9 +103,17 @@ class Terminal : Gtk.Overlay { var char_width = (int)vte.get_char_width(); var char_height = (int)vte.get_char_height(); + + if (base_width == -1) { + int window_width; + window.get_size(out window_width, null); + + base_width = window_width - (80 * char_width); + } + var geometry = Gdk.Geometry() { + base_width = base_width, // This must be kept in sync with the padding size in terminal.css - base_width = 2 * 2, base_height = 2 * 2, min_width = char_width, min_height = char_height, |