[gnome-control-center/wip/cdavis/date-and-time-polish: 3/5] cc-datetime-panel: Move activation handling to rows




commit c93c91e1f36368fe2d743a18d96d6f9dba03278a
Author: Christopher Davis <christopherdavis gnome org>
Date:   Fri Dec 31 00:04:18 2021 -0800

    cc-datetime-panel: Move activation handling to rows

 panels/datetime/cc-datetime-panel.c  | 7 ++-----
 panels/datetime/cc-datetime-panel.ui | 5 ++---
 2 files changed, 4 insertions(+), 8 deletions(-)
---
diff --git a/panels/datetime/cc-datetime-panel.c b/panels/datetime/cc-datetime-panel.c
index 62c49a7c5..bfc739c88 100644
--- a/panels/datetime/cc-datetime-panel.c
+++ b/panels/datetime/cc-datetime-panel.c
@@ -812,13 +812,10 @@ bind_switch_to_row (CcDateTimePanel *self,
 }
 
 static void
-list_box_row_activated (GtkListBox      *listbox,
-                        GtkListBoxRow   *row,
-                        CcDateTimePanel *self)
+list_box_row_activated (CcDateTimePanel *self,
+                        GtkListBoxRow   *row)
 
 {
-  gtk_list_box_select_row (listbox, NULL);
-
   if (row == GTK_LIST_BOX_ROW (self->datetime_button))
     {
       run_dialog (self, self->datetime_dialog);
diff --git a/panels/datetime/cc-datetime-panel.ui b/panels/datetime/cc-datetime-panel.ui
index 3a9f29f54..30115348b 100644
--- a/panels/datetime/cc-datetime-panel.ui
+++ b/panels/datetime/cc-datetime-panel.ui
@@ -315,7 +315,6 @@
                 <child>
                   <object class="GtkListBox" id="listbox2">
                     <property name="selection_mode">none</property>
-                    <signal name="row-activated" handler="list_box_row_activated" object="CcDateTimePanel" 
swapped="no"/>
                     <style>
                       <class name="boxed-list"/>
                     </style>
@@ -337,6 +336,7 @@
                         <property name="title" translatable="yes">Date &amp;amp; _Time</property>
                         <property name="use_underline">True</property>
                         <property name="activatable">True</property>
+                        <signal name="activated" handler="list_box_row_activated" swapped="yes"/>
                         <child>
                           <object class="GtkLabel" id="datetime_label">
                             <property name="xalign">0</property>
@@ -350,7 +350,6 @@
                 <child>
                   <object class="GtkListBox" id="listbox1">
                     <property name="selection_mode">none</property>
-                    <signal name="row-activated" handler="list_box_row_activated" object="CcDateTimePanel" 
swapped="no"/>
                     <style>
                       <class name="boxed-list"/>
                     </style>
@@ -372,6 +371,7 @@
                         <property name="title" translatable="yes">Time Z_one</property>
                         <property name="use_underline">True</property>
                         <property name="activatable">True</property>
+                        <signal name="activated" handler="list_box_row_activated" swapped="yes"/>
                         <child>
                           <object class="GtkLabel" id="timezone_label">
                             <property name="ellipsize">end</property>
@@ -386,7 +386,6 @@
                 <child>
                   <object class="GtkListBox" id="listbox3">
                     <property name="selection_mode">none</property>
-                    <signal name="row-activated" handler="list_box_row_activated" object="CcDateTimePanel" 
swapped="no"/>
                     <style>
                       <class name="boxed-list"/>
                     </style>


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