[gnome-control-center] mouse: Reset test area to the bottom at every try



commit 3d7e215024afd4b94c86a2328f6f07d71fbd9302
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Sep 26 18:34:49 2012 +0200

    mouse: Reset test area to the bottom at every try
    
    This prevents window resizes from making the first visit to the
    mouse test area one that doesn't scroll all the way to the bottom.
    
    1. Open System Settings
    2. Open a panel that's smaller than the mouse one (eg. Background)
    3. Back to overview
    4. Open Mouse panel, click on test button
    
    https://bugzilla.gnome.org/show_bug.cgi?id=684817

 panels/mouse/cc-mouse-panel.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/panels/mouse/cc-mouse-panel.c b/panels/mouse/cc-mouse-panel.c
index 710b44e..129f90a 100644
--- a/panels/mouse/cc-mouse-panel.c
+++ b/panels/mouse/cc-mouse-panel.c
@@ -132,10 +132,18 @@ shell_test_button_toggle_event (GtkToggleButton *button, CcMousePanel *panel)
   GtkNotebook *notebook = GTK_NOTEBOOK (panel->priv->widget);
   gint page_num;
 
-  if (gtk_toggle_button_get_active (button))
+  if (gtk_toggle_button_get_active (button)) {
+    GtkBuilder *dialog = panel->priv->builder;
+    GtkAdjustment *adjustment;
+
     page_num = CC_MOUSE_PAGE_TEST;
-  else
+
+    adjustment = GTK_ADJUSTMENT (WID ("scrolled_window_adjustment"));
+    gtk_adjustment_set_value (adjustment,
+                              gtk_adjustment_get_upper (adjustment));
+  } else {
     page_num = CC_MOUSE_PAGE_PREFS;
+  }
 
   gtk_notebook_set_current_page (notebook, page_num);
 }



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