[gnome-control-center] universal-access: Use links to settings



commit 16454c97a6154df1688c32fcf504d560f2558a81
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Sep 16 14:36:34 2011 +0100

    universal-access: Use links to settings
    
    Rather than buttons.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=659248

 panels/universal-access/cc-ua-panel.c |   36 +++++++++++++++++++-------------
 panels/universal-access/uap.ui        |   31 +++++++++++++++++-----------
 2 files changed, 40 insertions(+), 27 deletions(-)
---
diff --git a/panels/universal-access/cc-ua-panel.c b/panels/universal-access/cc-ua-panel.c
index aa81b08..5c232b6 100644
--- a/panels/universal-access/cc-ua-panel.c
+++ b/panels/universal-access/cc-ua-panel.c
@@ -573,14 +573,16 @@ visual_bell_type_toggle_cb (GtkWidget *button,
     gconf_client_set_string (panel->priv->client, key, "fullscreen", NULL);
 }
 
-static void
-hearing_sound_preferences_clicked (GtkButton *button,
-                                   CcUaPanel *panel)
+static gboolean
+hearing_sound_preferences_clicked (GtkButton  *button,
+                                   CcUaPanel  *panel)
 {
   CcShell *shell;
 
   shell = cc_panel_get_shell (CC_PANEL (panel));
   cc_shell_set_active_panel_from_id (shell, "sound", NULL, NULL);
+
+  return TRUE;
 }
 
 static void
@@ -621,20 +623,22 @@ cc_ua_panel_init_hearing (CcUaPanel *self)
   g_signal_connect (WID (priv->builder, "hearing_test_flash_button"),
                     "clicked", G_CALLBACK (gdk_beep), NULL);
 
-  g_signal_connect (WID (priv->builder, "hearing_sound_preferences_button"),
-                    "clicked",
+  g_signal_connect (WID (priv->builder, "hearing_sound_preferences_link"),
+                    "activate-link",
                     G_CALLBACK (hearing_sound_preferences_clicked), self);
 }
 
 /* typing/keyboard section */
-static void
-typing_keyboard_preferences_clicked (GtkButton *button,
-                                     CcUaPanel *panel)
+static gboolean
+typing_keyboard_preferences_clicked (GtkButton  *button,
+                                     CcUaPanel  *panel)
 {
   CcShell *shell;
 
   shell = cc_panel_get_shell (CC_PANEL (panel));
   cc_shell_set_active_panel_from_id (shell, "keyboard", NULL, NULL);
+
+  return TRUE;
 }
 
 static void
@@ -691,20 +695,22 @@ cc_ua_panel_init_keyboard (CcUaPanel *self)
   w = WID (priv->builder, "typing_bounce_keys_beep_rejected_checkbutton");
   g_settings_bind (priv->kb_settings, "bouncekeys-beep-reject", w, "active", G_SETTINGS_BIND_NO_SENSITIVITY);
 
-  g_signal_connect (WID (priv->builder, "typing_keyboard_preferences_button"),
-                    "clicked",
+  g_signal_connect (WID (priv->builder, "typing_keyboard_preferences_link"),
+                    "activate-link",
                     G_CALLBACK (typing_keyboard_preferences_clicked), self);
 }
 
 /* mouse/pointing & clicking section */
-static void
-pointing_mouse_preferences_clicked_cb (GtkButton *button,
-                                       CcUaPanel *panel)
+static gboolean
+pointing_mouse_preferences_clicked_cb (GtkButton  *button,
+                                       CcUaPanel  *panel)
 {
   CcShell *shell;
 
   shell = cc_panel_get_shell (CC_PANEL (panel));
   cc_shell_set_active_panel_from_id (shell, "mouse", NULL, NULL);
+
+  return TRUE;
 }
 
 static void
@@ -741,8 +747,8 @@ cc_ua_panel_init_mouse (CcUaPanel *self)
                    G_SETTINGS_BIND_DEFAULT);
 
   /* mouse preferences button */
-  g_signal_connect (WID (priv->builder, "pointing_mouse_preferences_button"),
-                    "clicked",
+  g_signal_connect (WID (priv->builder, "pointing_mouse_preferences_link"),
+                    "activate-link",
                     G_CALLBACK (pointing_mouse_preferences_clicked_cb), self);
 }
 
diff --git a/panels/universal-access/uap.ui b/panels/universal-access/uap.ui
index 2ef9346..0e9c525 100644
--- a/panels/universal-access/uap.ui
+++ b/panels/universal-access/uap.ui
@@ -1136,18 +1136,21 @@
                 <child>
                   <object class="GtkHBox" id="hbox5">
                     <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="halign">end</property>
                     <child>
-                      <object class="GtkButton" id="hearing_sound_preferences_button">
-                        <property name="label" translatable="yes">_Sound Settings</property>
-                        <property name="use_underline">True</property>
+                      <object class="GtkLinkButton" id="hearing_sound_preferences_link">
+                        <property name="label" translatable="yes">Sound Settings</property>
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="receives_default">True</property>
+                        <property name="has_tooltip">True</property>
+                        <property name="use_action_appearance">False</property>
+                        <property name="relief">none</property>
                       </object>
                       <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="pack_type">end</property>
+                        <property name="expand">True</property>
+                        <property name="fill">True</property>
                         <property name="position">0</property>
                       </packing>
                     </child>
@@ -1981,12 +1984,14 @@
                       </packing>
                     </child>
                     <child>
-                      <object class="GtkButton" id="typing_keyboard_preferences_button">
-                        <property name="label" translatable="yes">_Keyboard Settings</property>
-                        <property name="use_underline">True</property>
+                      <object class="GtkLinkButton" id="typing_keyboard_preferences_link">
+                        <property name="label" translatable="yes">Keyboard Settings</property>
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="receives_default">True</property>
+                        <property name="has_tooltip">True</property>
+                        <property name="use_action_appearance">False</property>
+                        <property name="relief">none</property>
                       </object>
                       <packing>
                         <property name="expand">False</property>
@@ -2734,12 +2739,14 @@
                   <object class="GtkHBox" id="hbox13">
                     <property name="visible">True</property>
                     <child>
-                      <object class="GtkButton" id="pointing_mouse_preferences_button">
-                        <property name="label" translatable="yes">_Mouse Settings</property>
-                        <property name="use_underline">True</property>
+                      <object class="GtkLinkButton" id="pointing_mouse_preferences_link">
+                        <property name="label" translatable="yes">Mouse Settings</property>
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="receives_default">True</property>
+                        <property name="has_tooltip">True</property>
+                        <property name="use_action_appearance">False</property>
+                        <property name="relief">none</property>
                       </object>
                       <packing>
                         <property name="expand">False</property>



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