From: Daniel Carl Date: Sat, 25 Oct 2014 00:31:52 +0000 (+0200) Subject: Fixed window resize by to long text in inputbox. X-Git-Url: https://git.owens.tech/assets/static/git.owens.tech/assets/static/git.owens.tech/git?a=commitdiff_plain;h=451ba581558e61762b0bdee98df68838927a45f0;p=vimb.git Fixed window resize by to long text in inputbox. The GTK3 text view grows with it's content and forces the whole main window to increase. To fix this, the text view is put into a scrolled window. This might be a hack, because we do not use the scrolled window itself, but this restores the behaviour of the plain text view of GTK2. --- diff --git a/src/main.c b/src/main.c index d0ab663..1a0fb0d 100644 --- a/src/main.c +++ b/src/main.c @@ -819,7 +819,17 @@ static void init_core(void) gtk_box_pack_start(gui->box, scroll, true, true, 0); gtk_box_pack_start(gui->box, gui->eventbox, false, false, 0); + +#ifdef HAS_GTK3 + /* use a scrolled window to hide overflowing text in inputbox like GTK2 */ + GtkWidget *inputscroll = gtk_scrolled_window_new(NULL, NULL); + gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(inputscroll), GTK_POLICY_AUTOMATIC, GTK_POLICY_NEVER); + gtk_container_add(GTK_CONTAINER(inputscroll), gui->input); + + gtk_box_pack_end(gui->box, inputscroll, false, false, 0); +#else gtk_box_pack_end(gui->box, gui->input, false, false, 0); +#endif /* init some state variable */ vb.state.enable_register = false;