[tracker] TrackerSearchBar: Force scroll to top-left on popup shown.



commit 9d6e505675ce9b98efbc782b6b0d90bb5a90b319
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue Mar 23 14:05:05 2010 +0100

    TrackerSearchBar: Force scroll to top-left on popup shown.
    
    Now the scrolled window in the results window scrolls to top-left
    (top-right in RTL environments) when popped up.

 src/tracker-search-bar/tracker-results-window.c |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/src/tracker-search-bar/tracker-results-window.c b/src/tracker-search-bar/tracker-results-window.c
index c04e564..546698b 100644
--- a/src/tracker-search-bar/tracker-results-window.c
+++ b/src/tracker-search-bar/tracker-results-window.c
@@ -1424,10 +1424,22 @@ tracker_results_window_new (GtkWidget   *parent,
 void
 tracker_results_window_popup (TrackerResultsWindow *window)
 {
-	g_return_if_fail (TRACKER_IS_RESULTS_WINDOW (window));
+        TrackerResultsWindowPrivate *priv;
+        GtkAdjustment *vadj, *hadj;
+
+        g_return_if_fail (TRACKER_IS_RESULTS_WINDOW (window));
+
+	priv = TRACKER_RESULTS_WINDOW_GET_PRIVATE (window);
 
 	gtk_widget_realize (GTK_WIDGET (window));
 	gtk_widget_show (GTK_WIDGET (window));
 
+        /* Force scroll to top-left */
+        vadj = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (priv->scrolled_window));
+        gtk_adjustment_set_value (vadj, vadj->lower);
+
+        hadj = gtk_scrolled_window_get_hadjustment (GTK_SCROLLED_WINDOW (priv->scrolled_window));
+        gtk_adjustment_set_value (hadj, hadj->lower);
+
         g_idle_add ((GSourceFunc) grab_popup_window, window);
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]