# HG changeset patch
# Node ID 1ebd15de6634
# Parent  f7ab1c72380f
diff --git a/pidgin/prefs/pidginawayprefs.c b/pidgin/prefs/pidginawayprefs.c
--- a/pidgin/prefs/pidginawayprefs.c
+++ b/pidgin/prefs/pidginawayprefs.c
@@ -34,12 +34,11 @@ struct _PidginAwayPrefs {
 
 	PidginPrefCombo idle_reporting;
 	GtkWidget *mins_before_away;
-	GtkWidget *idle_hbox;
+	GtkWidget *idle_row;
 	GtkWidget *away_when_idle;
 	PidginPrefCombo auto_reply;
 	GtkWidget *startup_current_status;
-	GtkWidget *startup_hbox;
-	GtkWidget *startup_label;
+	GtkWidget *startup_row;
 };
 
 G_DEFINE_TYPE(PidginAwayPrefs, pidgin_away_prefs, ADW_TYPE_PREFERENCES_PAGE)
@@ -81,15 +80,13 @@ pidgin_away_prefs_class_init(PidginAwayP
 	gtk_widget_class_bind_template_child(widget_class, PidginAwayPrefs,
 	                                     away_when_idle);
 	gtk_widget_class_bind_template_child(widget_class, PidginAwayPrefs,
-	                                     idle_hbox);
+	                                     idle_row);
 	gtk_widget_class_bind_template_child(widget_class, PidginAwayPrefs,
 	                                     auto_reply.combo);
 	gtk_widget_class_bind_template_child(widget_class, PidginAwayPrefs,
 	                                     startup_current_status);
 	gtk_widget_class_bind_template_child(widget_class, PidginAwayPrefs,
-	                                     startup_hbox);
-	gtk_widget_class_bind_template_child(widget_class, PidginAwayPrefs,
-	                                     startup_label);
+	                                     startup_row);
 }
 
 static void
@@ -106,13 +103,16 @@ pidgin_away_prefs_init(PidginAwayPrefs *
 	pidgin_prefs_bind_spin_button("/purple/away/mins_before_away",
 			prefs->mins_before_away);
 
-	pidgin_prefs_bind_checkbox("/purple/away/away_when_idle",
-			prefs->away_when_idle);
+	pidgin_prefs_bind_switch("/purple/away/away_when_idle",
+	                         prefs->away_when_idle);
 
 	/* TODO: Show something useful if we don't have any saved statuses. */
 	menu = pidgin_status_menu(purple_savedstatus_get_idleaway(),
 	                          G_CALLBACK(set_idle_away));
-	gtk_box_append(GTK_BOX(prefs->idle_hbox), menu);
+	gtk_widget_set_valign(menu, GTK_ALIGN_CENTER);
+	adw_action_row_add_suffix(ADW_ACTION_ROW(prefs->idle_row), menu);
+	adw_action_row_set_activatable_widget(ADW_ACTION_ROW(prefs->idle_row),
+	                                      menu);
 
 	g_object_bind_property(prefs->away_when_idle, "active",
 			menu, "sensitive",
@@ -124,18 +124,19 @@ pidgin_away_prefs_init(PidginAwayPrefs *
 	pidgin_prefs_bind_dropdown(&prefs->auto_reply);
 
 	/* Signon status stuff */
-	pidgin_prefs_bind_checkbox("/purple/savedstatus/startup_current_status",
-			prefs->startup_current_status);
+	pidgin_prefs_bind_switch("/purple/savedstatus/startup_current_status",
+	                         prefs->startup_current_status);
 
 	/* TODO: Show something useful if we don't have any saved statuses. */
 	menu = pidgin_status_menu(purple_savedstatus_get_startup(),
 	                          G_CALLBACK(set_startupstatus));
-	gtk_box_append(GTK_BOX(prefs->startup_hbox), menu);
-	gtk_label_set_mnemonic_widget(GTK_LABEL(prefs->startup_label), menu);
-	pidgin_set_accessible_label(menu, GTK_LABEL(prefs->startup_label));
+	gtk_widget_set_valign(menu, GTK_ALIGN_CENTER);
+	adw_action_row_add_suffix(ADW_ACTION_ROW(prefs->startup_row), menu);
+	adw_action_row_set_activatable_widget(ADW_ACTION_ROW(prefs->startup_row),
+	                                      menu);
 	g_object_bind_property(prefs->startup_current_status, "active",
-			prefs->startup_hbox, "sensitive",
-			G_BINDING_SYNC_CREATE|G_BINDING_INVERT_BOOLEAN);
+	                       prefs->startup_row, "sensitive",
+	                       G_BINDING_SYNC_CREATE|G_BINDING_INVERT_BOOLEAN);
 }
 
 /******************************************************************************
diff --git a/pidgin/resources/Prefs/away.ui b/pidgin/resources/Prefs/away.ui
--- a/pidgin/resources/Prefs/away.ui
+++ b/pidgin/resources/Prefs/away.ui
@@ -79,67 +79,48 @@ along with this program; if not, see <ht
       <object class="AdwPreferencesGroup">
         <property name="title" translatable="1">Idle</property>
         <child>
-          <object class="GtkBox">
-            <property name="margin-start">12</property>
-            <property name="orientation">vertical</property>
-            <property name="spacing">6</property>
+          <object class="AdwActionRow">
+            <property name="activatable-widget">idle_reporting.combo</property>
+            <property name="title" translatable="1">_Report idle time</property>
+            <property name="use-underline">1</property>
             <child>
-              <object class="GtkBox">
-                <property name="spacing">6</property>
+              <object class="GtkComboBox" id="idle_reporting.combo">
+                <property name="model">idle_reporting.store</property>
+                <property name="valign">center</property>
                 <child>
-                  <object class="GtkLabel" id="label12">
-                    <property name="label" translatable="1">_Report idle time:</property>
-                    <property name="use-underline">1</property>
-                    <property name="mnemonic-widget">idle_reporting.combo</property>
-                    <property name="xalign">0</property>
-                  </object>
-                </child>
-                <child>
-                  <object class="GtkComboBox" id="idle_reporting.combo">
-                    <property name="model">idle_reporting.store</property>
-                    <child>
-                      <object class="GtkCellRendererText"/>
-                      <attributes>
-                        <attribute name="text">0</attribute>
-                      </attributes>
-                    </child>
-                  </object>
+                  <object class="GtkCellRendererText"/>
+                  <attributes>
+                    <attribute name="text">0</attribute>
+                  </attributes>
                 </child>
               </object>
             </child>
+          </object>
+        </child>
+        <child>
+          <object class="AdwActionRow">
+            <property name="activatable-widget">mins_before_away</property>
+            <property name="title" translatable="1">_Minutes before becoming idle</property>
+            <property name="use-underline">1</property>
             <child>
-              <object class="GtkBox">
-                <property name="spacing">6</property>
-                <child>
-                  <object class="GtkLabel" id="label13">
-                    <property name="label" translatable="1">_Minutes before becoming idle:</property>
-                    <property name="use-underline">1</property>
-                    <property name="mnemonic-widget">mins_before_away</property>
-                    <property name="xalign">0</property>
-                  </object>
-                </child>
-                <child>
-                  <object class="GtkSpinButton" id="mins_before_away">
-                    <property name="focusable">1</property>
-                    <property name="adjustment">mins_before_adjustment</property>
-                    <property name="numeric">1</property>
-                  </object>
-                </child>
+              <object class="GtkSpinButton" id="mins_before_away">
+                <property name="focusable">1</property>
+                <property name="adjustment">mins_before_adjustment</property>
+                <property name="numeric">1</property>
+                <property name="valign">center</property>
               </object>
             </child>
-            <child>
-              <object class="GtkBox" id="idle_hbox">
-                <property name="spacing">6</property>
-                <child>
-                  <object class="GtkCheckButton" id="away_when_idle">
-                    <property name="label" translatable="1">Change to this status when _idle:</property>
-                    <property name="focusable">1</property>
-                    <property name="use-underline">1</property>
-                  </object>
-                </child>
-                <child>
-                  <placeholder/>
-                </child>
+          </object>
+        </child>
+        <child>
+          <object class="AdwActionRow" id="idle_row">
+            <property name="activatable-widget">away_when_idle</property>
+            <property name="title" translatable="1">Change to this status when _idle</property>
+            <property name="use-underline">1</property>
+            <child type="prefix">
+              <object class="GtkSwitch" id="away_when_idle">
+                <property name="focusable">1</property>
+                <property name="valign">center</property>
               </object>
             </child>
           </object>
@@ -150,30 +131,19 @@ along with this program; if not, see <ht
       <object class="AdwPreferencesGroup">
         <property name="title" translatable="1">Away</property>
         <child>
-          <object class="GtkBox">
-            <property name="margin-start">12</property>
-            <property name="orientation">vertical</property>
+          <object class="AdwActionRow">
+            <property name="activatable-widget">auto_reply.combo</property>
+            <property name="title" translatable="1">_Auto-reply</property>
+            <property name="use-underline">1</property>
             <child>
-              <object class="GtkBox">
-                <property name="spacing">6</property>
+              <object class="GtkComboBox" id="auto_reply.combo">
+                <property name="model">auto_reply.store</property>
+                <property name="valign">center</property>
                 <child>
-                  <object class="GtkLabel" id="label14">
-                    <property name="label" translatable="1">_Auto-reply:</property>
-                    <property name="use-underline">1</property>
-                    <property name="mnemonic-widget">auto_reply.combo</property>
-                    <property name="xalign">0</property>
-                  </object>
-                </child>
-                <child>
-                  <object class="GtkComboBox" id="auto_reply.combo">
-                    <property name="model">auto_reply.store</property>
-                    <child>
-                      <object class="GtkCellRendererText"/>
-                      <attributes>
-                        <attribute name="text">0</attribute>
-                      </attributes>
-                    </child>
-                  </object>
+                  <object class="GtkCellRendererText"/>
+                  <attributes>
+                    <attribute name="text">0</attribute>
+                  </attributes>
                 </child>
               </object>
             </child>
@@ -185,45 +155,25 @@ along with this program; if not, see <ht
       <object class="AdwPreferencesGroup">
         <property name="title" translatable="1">Status at Startup</property>
         <child>
-          <object class="GtkBox">
-            <property name="margin-start">12</property>
-            <property name="orientation">vertical</property>
-            <property name="spacing">6</property>
+          <object class="AdwActionRow">
+            <property name="activatable-widget">startup_current_status</property>
+            <property name="title" translatable="1">Use status from last _exit at startup</property>
+            <property name="use-underline">1</property>
             <child>
-              <object class="GtkCheckButton" id="startup_current_status">
-                <property name="label" translatable="1">Use status from last _exit at startup</property>
+              <object class="GtkSwitch" id="startup_current_status">
                 <property name="focusable">1</property>
-                <property name="use-underline">1</property>
+                <property name="valign">center</property>
               </object>
             </child>
-            <child>
-              <object class="GtkBox" id="startup_hbox">
-                <property name="spacing">6</property>
-                <child>
-                  <object class="GtkLabel" id="startup_label">
-                    <property name="label" translatable="1">Status to a_pply at startup:</property>
-                    <property name="use-underline">1</property>
-                    <property name="xalign">0</property>
-                  </object>
-                </child>
-                <child>
-                  <placeholder/>
-                </child>
-              </object>
-            </child>
+          </object>
+        </child>
+        <child>
+          <object class="AdwActionRow" id="startup_row">
+            <property name="title" translatable="1">Status to a_pply at startup</property>
+            <property name="use-underline">1</property>
           </object>
         </child>
       </object>
     </child>
   </template>
-  <object class="GtkSizeGroup" id="sg">
-    <widgets>
-      <widget name="label12"/>
-      <widget name="label13"/>
-      <widget name="away_when_idle"/>
-      <widget name="label14"/>
-      <widget name="startup_current_status"/>
-      <widget name="startup_label"/>
-    </widgets>
-  </object>
 </interface>
