2009-11-07 [colin] 3.7.3cvs12
authorColin Leroy <colin@colino.net>
Sat, 7 Nov 2009 17:42:56 +0000 (17:42 +0000)
committerColin Leroy <colin@colino.net>
Sat, 7 Nov 2009 17:42:56 +0000 (17:42 +0000)
* src/gtk/prefswindow.c
Fix bug 2041, "add autonomical scrolled windows to prefs pages"
Patch by Pawel

ChangeLog
PATCHSETS
configure.ac
src/gtk/prefswindow.c

index 241900e..c8203fe 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-11-07 [colin]     3.7.3cvs12
+
+       * src/gtk/prefswindow.c
+               Fix bug 2041, "add autonomical scrolled windows to prefs pages"
+               Patch by Pawel
+
 2009-11-07 [colin]     3.7.3cvs11
 
        * src/gtk/spell_entry.c
index 3d87fe7..a880302 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.274.2.303 -r 1.274.2.304 src/mainwindow.c;  ) > 3.7.3cvs9.patchset
 ( cvs diff -u -r 1.213.2.194 -r 1.213.2.195 src/folder.c;  ) > 3.7.3cvs10.patchset
 ( cvs diff -u -r 1.1.2.8 -r 1.1.2.9 src/gtk/spell_entry.c;  ) > 3.7.3cvs11.patchset
+( cvs diff -u -r 1.12.2.53 -r 1.12.2.54 src/gtk/prefswindow.c;  ) > 3.7.3cvs12.patchset
index b11d915..e94b150 100644 (file)
@@ -12,7 +12,7 @@ MINOR_VERSION=7
 MICRO_VERSION=3
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=11
+EXTRA_VERSION=12
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index c5d6d10..d1758ac 100644 (file)
@@ -50,7 +50,6 @@ struct _PrefsWindow
        GtkWidget *vbox;
        GtkWidget *paned;
        GtkWidget *scrolledwindow1;
-       GtkWidget *scrolledwindow2;
        GtkWidget *tree_view;
        GtkWidget *table2;
        GtkWidget *pagelabel;
@@ -289,7 +288,30 @@ static gint prefswindow_tree_sort_by_weight(GtkTreeModel *model,
        return f1 < f2 ? -1 : (f1 > f2 ?  1 : 
              (i1 < i2 ?  1 : (i1 > i2 ? -1 : 0)));
 }
-                                 
+
+static void prefswindow_build_page(PrefsWindow *prefswindow, PrefsPage *page)
+{
+       GtkWidget *scrolledwin, *tmp;
+
+       if (!page->page_open) {
+               scrolledwin = gtk_scrolled_window_new(NULL, NULL);
+               gtk_widget_show(scrolledwin);
+               gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledwin),
+                       GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+               
+               page->create_widget(page, GTK_WINDOW(prefswindow->window), prefswindow->data);
+               gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scrolledwin),
+                                       page->widget);
+
+               gtk_container_add(GTK_CONTAINER(prefswindow->notebook), scrolledwin);
+               tmp = gtk_bin_get_child(GTK_BIN(scrolledwin));
+               gtk_viewport_set_shadow_type(GTK_VIEWPORT(tmp), GTK_SHADOW_NONE);
+               
+               page->widget    = scrolledwin;
+               page->page_open = TRUE;
+       }
+}
+
 static void prefswindow_build_all_pages(PrefsWindow *prefswindow, GSList *prefs_pages)
 {
        GSList *cur;
@@ -298,11 +320,7 @@ static void prefswindow_build_all_pages(PrefsWindow *prefswindow, GSList *prefs_
        for (cur = prefs_pages; cur != NULL; cur = g_slist_next(cur)) {
                PrefsPage *page = (PrefsPage *) cur->data;
 
-               if (!page->page_open) {
-                       page->create_widget(page, GTK_WINDOW(prefswindow->window), prefswindow->data);
-                       gtk_container_add(GTK_CONTAINER(prefswindow->notebook), page->widget);
-                       page->page_open = TRUE;
-               }
+               prefswindow_build_page(prefswindow, page);
        }
        prefs_pages = g_slist_reverse(prefs_pages);
 }
@@ -422,7 +440,6 @@ void prefswindow_open_full(const gchar *title, GSList *prefs_pages,
        gint y = gdk_screen_height();
        static GdkGeometry geometry;
        GtkAdjustment *adj;
-       GtkWidget *tmp;
 
        prefswindow = g_new0(PrefsWindow, 1);
 
@@ -487,21 +504,13 @@ void prefswindow_open_full(const gchar *title, GSList *prefs_pages,
        gtk_misc_set_alignment(GTK_MISC(prefswindow->pagelabel), 0, 0.0);
        gtk_container_add(GTK_CONTAINER(prefswindow->labelframe), prefswindow->pagelabel);
 
-       prefswindow->scrolledwindow2 = gtk_scrolled_window_new(NULL, NULL);
-       gtk_widget_show(prefswindow->scrolledwindow2);
-       gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(prefswindow->scrolledwindow2),
-                       GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
-
        prefswindow->notebook = gtk_notebook_new();
        gtk_widget_show(prefswindow->notebook);
        gtk_notebook_set_scrollable(GTK_NOTEBOOK(prefswindow->notebook), TRUE);
        gtk_notebook_set_show_tabs(GTK_NOTEBOOK(prefswindow->notebook), FALSE);
        gtk_notebook_set_show_border(GTK_NOTEBOOK(prefswindow->notebook), FALSE);
-       gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(prefswindow->scrolledwindow2),
-                                       prefswindow->notebook);
-       tmp = gtk_bin_get_child(GTK_BIN(prefswindow->scrolledwindow2));
-       gtk_viewport_set_shadow_type(GTK_VIEWPORT(tmp), GTK_SHADOW_NONE);
-       gtk_table_attach(GTK_TABLE(prefswindow->table2), prefswindow->scrolledwindow2,
+
+       gtk_table_attach(GTK_TABLE(prefswindow->table2), prefswindow->notebook,
                        0, 1, 1, 2, GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND, 0, 4);
 
        prefswindow->empty_page = gtk_label_new("");
@@ -530,7 +539,6 @@ void prefswindow_open_full(const gchar *title, GSList *prefs_pages,
        gtk_widget_show_all(prefswindow->confirm_area);
        gtk_widget_show(prefswindow->vbox);
        gtk_widget_show(prefswindow->scrolledwindow1);
-       gtk_widget_show(prefswindow->scrolledwindow2);
 
        gtk_box_pack_start(GTK_BOX(prefswindow->vbox), prefswindow->confirm_area, FALSE, FALSE, 0);
 
@@ -592,14 +600,6 @@ void prefswindow_open_full(const gchar *title, GSList *prefs_pages,
                        GTK_SCROLLED_WINDOW(prefswindow->scrolledwindow1));
        gtk_adjustment_set_value(adj, adj->lower);
        gtk_adjustment_changed(adj);
-       adj = gtk_scrolled_window_get_vadjustment(
-                       GTK_SCROLLED_WINDOW(prefswindow->scrolledwindow2));
-       gtk_adjustment_set_value(adj, adj->lower);
-       gtk_adjustment_changed(adj);
-       adj = gtk_scrolled_window_get_hadjustment(
-                       GTK_SCROLLED_WINDOW(prefswindow->scrolledwindow2));
-       gtk_adjustment_set_value(adj, adj->lower);
-       gtk_adjustment_changed(adj);
 }
 
 void prefswindow_open(const gchar *title, GSList *prefs_pages, gpointer data,
@@ -712,11 +712,7 @@ static gboolean prefswindow_row_selected(GtkTreeSelection *selector,
                return TRUE;
        }
 
-       if (!page->page_open) {
-               page->create_widget(page, GTK_WINDOW(prefswindow->window), prefswindow->data);
-               gtk_container_add(GTK_CONTAINER(prefswindow->notebook), page->widget);
-               page->page_open = TRUE;
-       }
+       prefswindow_build_page(prefswindow, page);
 
        i = 0;
        while (page->path[i + 1] != 0)
@@ -731,11 +727,11 @@ static gboolean prefswindow_row_selected(GtkTreeSelection *selector,
                                      pagenum);
 
        adj = gtk_scrolled_window_get_vadjustment(
-                       GTK_SCROLLED_WINDOW(prefswindow->scrolledwindow2));
+                       GTK_SCROLLED_WINDOW(page->widget));
        gtk_adjustment_set_value(adj, adj->lower);
        gtk_adjustment_changed(adj);
        adj = gtk_scrolled_window_get_hadjustment(
-                       GTK_SCROLLED_WINDOW(prefswindow->scrolledwindow2));
+                       GTK_SCROLLED_WINDOW(page->widget));
        gtk_adjustment_set_value(adj, adj->lower);
        gtk_adjustment_changed(adj);