]> granicus.if.org Git - handbrake/commitdiff
LinGui: merge: fix a scrolling issue in presets pane
authorjstebbins <jstebbins.hb@gmail.com>
Tue, 18 Aug 2015 20:36:33 +0000 (20:36 +0000)
committerjstebbins <jstebbins.hb@gmail.com>
Tue, 18 Aug 2015 20:36:33 +0000 (20:36 +0000)
Expanding a folder was causing the pane to scroll back to the currently
selected preset.

git-svn-id: svn://svn.handbrake.fr/HandBrake/branches/0.10.x@7404 b64f7644-9d1e-0410-96f1-a4d463321fa5

gtk/src/ghb.ui
gtk/src/presets.c

index 2a3d97647fc67901f25caf22fe6108bf05caad82..f741f90b06165295e7c2f140878bb12b1ac8d7fc 100644 (file)
@@ -1562,7 +1562,6 @@ This allows a player to initiate playback before downloading the entire file.</p
                 <property name="shadow_type">none</property>
                 <property name="margin-right">6</property>
                 <property name="margin-bottom">6</property>
-                <signal name="size-allocate" handler="presets_frame_size_allocate_cb" swapped="no"/>
                 <child>
                   <object class="GtkScrolledWindow" id="presets_scroll">
                     <property name="visible">True</property>
index 6d3b099e72a0d99ea87ae49335d8cc933a368e8a..0a6d3dbc70a66d487b620f1318ec3551ea72440b 100644 (file)
@@ -1082,6 +1082,8 @@ ghb_select_preset2(
             if (gtk_tree_model_get_iter_first(store, &iter))
                 gtk_tree_selection_select_iter (selection, &iter);
         }
+        // Make the selection visible in scroll window if it is not.
+        gtk_tree_view_scroll_to_cell(treeview, path, NULL, FALSE, 0, 0);
         gtk_tree_path_free(path);
     }
 }
@@ -4251,26 +4253,6 @@ ghb_clear_presets_selection(signal_user_data_t *ud)
     ghb_settings_set_boolean(ud->settings, "preset_modified", TRUE);
 }
 
-G_MODULE_EXPORT void
-presets_frame_size_allocate_cb(GtkWidget *widget, GtkAllocation *allocation, signal_user_data_t *ud)
-{
-    GtkTreeView *treeview;
-    GtkTreeSelection *selection;
-    GtkTreeModel *store;
-    GtkTreeIter iter;
-
-    treeview = GTK_TREE_VIEW(GHB_WIDGET(ud->builder, "presets_list"));
-    selection = gtk_tree_view_get_selection(treeview);
-    if (gtk_tree_selection_get_selected(selection, &store, &iter))
-    {
-        GtkTreePath *path;
-        path = gtk_tree_model_get_path (store, &iter);
-        // Make the parent visible in scroll window if it is not.
-        gtk_tree_view_scroll_to_cell (treeview, path, NULL, FALSE, 0, 0);
-        gtk_tree_path_free(path);
-    }
-}
-
 G_MODULE_EXPORT void
 presets_default_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud)
 {