From e67e7f19253fdbb4c6f98dbe6fdf3715237dd75b Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Wed, 20 Sep 2017 16:40:33 -0400 Subject: src/tab-chrome.c: Better organize tab history scrolled windows code --- diff --git a/src/tab-chrome.c b/src/tab-chrome.c index cdaa51c..0e12da5 100644 --- a/src/tab-chrome.c +++ b/src/tab-chrome.c @@ -128,8 +128,9 @@ back_forward_box_button_press_cb(GtkWidget *widget, GdkEvent *event, GtkTextIter text_iter; gchar *str; GtkTextTag *text_tag; + GtkWidget *list_scrolled_window; + GtkWidget *text_scrolled_window; GtkWidget *stack; - GtkWidget *scrolled_window; GtkWidget *toggle_button; GtkWidget *box; @@ -200,22 +201,28 @@ back_forward_box_button_press_cb(GtkWidget *widget, GdkEvent *event, ++chrome->back_items; } - /* Set up the stack. */ - stack = gtk_stack_new(); - scrolled_window = gtk_scrolled_window_new(NULL, NULL); - gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled_window), + /* Set up the list scrolled window. */ + list_scrolled_window = gtk_scrolled_window_new(NULL, NULL); + gtk_scrolled_window_set_policy( + GTK_SCROLLED_WINDOW(list_scrolled_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); /* gtk_scrolled_window_set_propagate_natural_width( - GTK_SCROLLED_WINDOW(scrolled_window), TRUE); */ - gtk_container_add(GTK_CONTAINER(scrolled_window), list_box); - gtk_stack_add_named(GTK_STACK(stack), scrolled_window, "list"); - scrolled_window = gtk_scrolled_window_new(NULL, NULL); - gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled_window), + GTK_SCROLLED_WINDOW(list_scrolled_window), TRUE); */ + gtk_container_add(GTK_CONTAINER(list_scrolled_window), list_box); + + /* Set up the text scrolled window. */ + text_scrolled_window = gtk_scrolled_window_new(NULL, NULL); + gtk_scrolled_window_set_policy( + GTK_SCROLLED_WINDOW(text_scrolled_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); /* gtk_scrolled_window_set_propagate_natural_width( - GTK_SCROLLED_WINDOW(scrolled_window), TRUE); */ - gtk_container_add(GTK_CONTAINER(scrolled_window), text_view); - gtk_stack_add_named(GTK_STACK(stack), scrolled_window, "text"); + GTK_SCROLLED_WINDOW(text_scrolled_window), TRUE); */ + gtk_container_add(GTK_CONTAINER(text_scrolled_window), text_view); + + /* Set up the stack. */ + stack = gtk_stack_new(); + gtk_stack_add_named(GTK_STACK(stack), list_scrolled_window, "list"); + gtk_stack_add_named(GTK_STACK(stack), text_scrolled_window, "text"); /* Set up the toggle button. */ toggle_button = gtk_toggle_button_new(); -- cgit v0.9.1