# HG changeset patch
# Node ID ff6fa4458641
# Parent  4e1bf25f5575
diff --git a/pidgin/pidginstatuseditor.c b/pidgin/pidginstatuseditor.c
--- a/pidgin/pidginstatuseditor.c
+++ b/pidgin/pidginstatuseditor.c
@@ -47,10 +47,6 @@ struct _PidginStatusEditor {
 
 	GtkWidget *title;
 	GtkWidget *primitive;
-	GtkWidget *message;
-
-	GtkWidget *use;
-	GtkWidget *save;
 };
 
 G_DEFINE_TYPE(PidginStatusEditor, pidgin_status_editor, GTK_TYPE_DIALOG)
@@ -173,8 +169,10 @@ pidgin_status_editor_title_changed_cb(G_
 		gboolean duplicated = purple_savedstatus_find(title) != NULL;
 
 		if(duplicated) {
-			gtk_widget_set_sensitive(editor->use, FALSE);
-			gtk_widget_set_sensitive(editor->save, FALSE);
+			gtk_dialog_set_response_sensitive(GTK_DIALOG(editor),
+			                                  RESPONSE_USE, FALSE);
+			gtk_dialog_set_response_sensitive(GTK_DIALOG(editor),
+			                                  RESPONSE_SAVE, FALSE);
 
 			return;
 		}
@@ -182,8 +180,10 @@ pidgin_status_editor_title_changed_cb(G_
 
 	sensitive = !purple_strequal(title, "");
 
-	gtk_widget_set_sensitive(editor->use, sensitive);
-	gtk_widget_set_sensitive(editor->save, sensitive);
+	gtk_dialog_set_response_sensitive(GTK_DIALOG(editor), RESPONSE_USE,
+	                                  sensitive);
+	gtk_dialog_set_response_sensitive(GTK_DIALOG(editor), RESPONSE_SAVE,
+	                                  sensitive);
 }
 
 /******************************************************************************
@@ -266,13 +266,6 @@ pidgin_status_editor_class_init(PidginSt
 	                                     title);
 	gtk_widget_class_bind_template_child(widget_class, PidginStatusEditor,
 	                                     primitive);
-	gtk_widget_class_bind_template_child(widget_class, PidginStatusEditor,
-	                                     message);
-
-	gtk_widget_class_bind_template_child(widget_class, PidginStatusEditor,
-	                                     use);
-	gtk_widget_class_bind_template_child(widget_class, PidginStatusEditor,
-	                                     save);
 
 	gtk_widget_class_bind_template_callback(widget_class,
 	                                        pidgin_status_editor_response_cb);
diff --git a/pidgin/pidginstatusprimitivechooser.h b/pidgin/pidginstatusprimitivechooser.h
--- a/pidgin/pidginstatusprimitivechooser.h
+++ b/pidgin/pidginstatusprimitivechooser.h
@@ -38,7 +38,7 @@ G_BEGIN_DECLS
 /**
  * PidginStatusPrimitiveChooser:
  *
- * A [class@Gtk.ComboBox] for presenting [enum@Purple.StatusPrimitive]'s to a
+ * A [class@Adw.ComboRow] for presenting [enum@Purple.StatusPrimitive]'s to a
  * user.
  *
  * Since: 3.0.0
@@ -47,7 +47,7 @@ G_BEGIN_DECLS
 #define PIDGIN_TYPE_STATUS_PRIMITIVE_CHOOSER (pidgin_status_primitive_chooser_get_type())
 G_DECLARE_FINAL_TYPE(PidginStatusPrimitiveChooser,
                      pidgin_status_primitive_chooser, PIDGIN,
-                     STATUS_PRIMITIVE_CHOOSER, AdwBin)
+                     STATUS_PRIMITIVE_CHOOSER, AdwComboRow)
 
 /**
  * pidgin_status_primitive_chooser_new:
diff --git a/pidgin/pidginstatusprimitivechooser.c b/pidgin/pidginstatusprimitivechooser.c
--- a/pidgin/pidginstatusprimitivechooser.c
+++ b/pidgin/pidginstatusprimitivechooser.c
@@ -25,13 +25,11 @@
 #include <pidgin/pidginiconname.h>
 
 struct _PidginStatusPrimitiveChooser {
-	AdwBin parent;
-
-	GtkDropDown *chooser;
+	AdwComboRow parent;
 };
 
 G_DEFINE_TYPE(PidginStatusPrimitiveChooser, pidgin_status_primitive_chooser,
-              ADW_TYPE_BIN)
+              ADW_TYPE_COMBO_ROW)
 
 /******************************************************************************
  * Helpers
@@ -110,10 +108,6 @@ pidgin_status_primitive_chooser_class_in
 	gtk_widget_class_set_template_from_resource(
 	        widget_class, "/im/pidgin/Pidgin3/statusprimitivechooser.ui");
 
-	gtk_widget_class_bind_template_child(widget_class,
-	                                     PidginStatusPrimitiveChooser,
-	                                     chooser);
-
 	gtk_widget_class_bind_template_callback(widget_class,
 	                                        pidgin_status_primitive_chooser_icon_name_cb);
 	gtk_widget_class_bind_template_callback(widget_class,
@@ -136,7 +130,7 @@ pidgin_status_primitive_chooser_get_sele
 	g_return_val_if_fail(PIDGIN_IS_STATUS_PRIMITIVE_CHOOSER(chooser),
 	                     PURPLE_STATUS_UNSET);
 
-	selected = gtk_drop_down_get_selected_item(chooser->chooser);
+	selected = adw_combo_row_get_selected_item(ADW_COMBO_ROW(chooser));
 	value = gtk_string_object_get_string(selected);
 
 	return pidgin_status_primitive_chooser_primitive_from_string(value);
@@ -147,23 +141,22 @@ pidgin_status_primitive_chooser_set_sele
                                              PurpleStatusPrimitive primitive)
 {
 	GListModel *model = NULL;
+	GtkStringList *list = NULL;
 
 	g_return_if_fail(PIDGIN_IS_STATUS_PRIMITIVE_CHOOSER(chooser));
 
-	model = gtk_drop_down_get_model(chooser->chooser);
+	model = adw_combo_row_get_model(ADW_COMBO_ROW(chooser));
+	list = GTK_STRING_LIST(model);
 	for(guint i = 0; i < g_list_model_get_n_items(model); i++) {
 		PurpleStatusPrimitive candidate = PURPLE_STATUS_UNSET;
-		GtkStringObject *str = NULL;
 		const char *value = NULL;
 
-		str = g_list_model_get_item(model, i);
-		value = gtk_string_object_get_string(str);
-
+		value = gtk_string_list_get_string(list, i);
 		candidate = pidgin_status_primitive_chooser_primitive_from_string(value);
-		g_clear_object(&str);
 
 		if(primitive == candidate) {
-			gtk_drop_down_set_selected(chooser->chooser, i);
+			adw_combo_row_set_selected(ADW_COMBO_ROW(chooser), i);
+			break;
 		}
 	}
 }
diff --git a/pidgin/resources/Status/editor.ui b/pidgin/resources/Status/editor.ui
--- a/pidgin/resources/Status/editor.ui
+++ b/pidgin/resources/Status/editor.ui
@@ -27,87 +27,59 @@ along with this library; if not, see <ht
   <template class="PidginStatusEditor" parent="GtkDialog">
     <property name="title" translatable="1">Status</property>
     <property name="destroy-with-parent">1</property>
+    <property name="resizable">0</property>
     <signal name="response" handler="pidgin_status_editor_response_cb" swapped="no"/>
     <child internal-child="content_area">
       <object class="GtkBox">
         <property name="orientation">vertical</property>
-        <property name="spacing">2</property>
         <child>
-          <object class="GtkBox">
-            <property name="vexpand">1</property>
-            <property name="orientation">vertical</property>
+          <object class="AdwPreferencesGroup">
+            <property name="margin-start">24</property>
+            <property name="margin-end">24</property>
+            <property name="margin-top">24</property>
+            <property name="margin-bottom">24</property>
             <child>
-              <object class="GtkBox">
-                <property name="vexpand">1</property>
-                <child>
-                  <object class="GtkLabel" id="label1">
-                    <property name="label" translatable="1">_Title:</property>
-                    <property name="use-underline">1</property>
-                    <property name="xalign">0</property>
-                    <property name="yalign">0</property>
-                    <property name="mnemonic-widget">title</property>
-                  </object>
-                </child>
-                <child>
-                  <object class="GtkEntry" id="title">
-                    <property name="hexpand">1</property>
-                    <property name="focusable">1</property>
-                    <signal name="changed" handler="pidgin_status_editor_title_changed_cb" object="PidginStatusEditor" swapped="no"/>
-                  </object>
-                </child>
+              <object class="AdwEntryRow" id="title">
+                <property name="title" translatable="1">_Title</property>
+                <property name="use-underline">1</property>
+                <signal name="changed" handler="pidgin_status_editor_title_changed_cb"/>
+              </object>
+            </child>
+            <child>
+              <object class="PidginStatusPrimitiveChooser" id="primitive">
+                <property name="title" translatable="1">St_atus</property>
+                <property name="use-underline">1</property>
               </object>
             </child>
             <child>
-              <object class="GtkBox">
-                <property name="vexpand">1</property>
-                <child>
-                  <object class="GtkLabel" id="label2">
-                    <property name="label" translatable="1">St_atus:</property>
-                    <property name="use-underline">1</property>
-                    <property name="xalign">0</property>
-                    <property name="yalign">0</property>
-                    <property name="mnemonic-widget">primitive</property>
-                  </object>
-                </child>
+              <object class="AdwPreferencesRow">
+                <property name="focusable">0</property>
                 <child>
-                  <object class="PidginStatusPrimitiveChooser" id="primitive">
-                    <property name="hexpand">1</property>
-                  </object>
-                </child>
-              </object>
-            </child>
-            <child>
-              <object class="GtkBox">
-                <property name="vexpand">1</property>
-                <child>
-                  <object class="GtkLabel" id="label3">
-                    <property name="label" translatable="1">_Message:</property>
-                    <property name="use-underline">1</property>
-                    <property name="xalign">0</property>
-                    <property name="yalign">0</property>
-                    <property name="mnemonic-widget">message</property>
-                  </object>
-                </child>
-                <child>
-                  <object class="TalkatuEditor">
-                    <property name="hexpand">1</property>
+                  <object class="GtkBox">
                     <property name="orientation">vertical</property>
-                    <property name="vexpand">1</property>
-                    <child internal-child="send_button">
-                      <object class="GtkButton">
-                        <property name="visible">0</property>
+                    <child>
+                      <object class="GtkLabel">
+                        <property name="css-classes">subtitle</property>
+                        <property name="label" translatable="1">_Message</property>
+                        <property name="mnemonic-widget">message</property>
+                        <property name="margin-start">12</property>
+                        <property name="margin-end">12</property>
+                        <property name="xalign">0</property>
+                        <property name="use-underline">1</property>
                       </object>
                     </child>
-                    <child internal-child="toolbar">
-                      <object class="TalkatuToolbar"/>
-                    </child>
-                    <child internal-child="input">
-                      <object class="TalkatuInput" id="message">
-                        <property name="buffer">buffer</property>
+                    <child>
+                      <object class="TalkatuEditor" id="editor">
                         <property name="hexpand">1</property>
-                        <property name="vexpand">1</property>
-                        <property name="width-request">450</property>
-                        <property name="wrap-mode">word</property>
+                        <property name="show-send-button">0</property>
+                        <child internal-child="input">
+                          <object class="TalkatuInput" id="message">
+                            <property name="buffer">buffer</property>
+                            <property name="hexpand">1</property>
+                            <property name="width-request">450</property>
+                            <property name="wrap-mode">word</property>
+                          </object>
+                        </child>
                       </object>
                     </child>
                   </object>
@@ -150,13 +122,6 @@ along with this library; if not, see <ht
       <action-widget response="1">save</action-widget>
     </action-widgets>
   </template>
-  <object class="GtkSizeGroup">
-    <widgets>
-      <widget name="label1"/>
-      <widget name="label2"/>
-      <widget name="label3"/>
-    </widgets>
-  </object>
   <object class="TalkatuBuffer" id="buffer">
     <property name="action-group">
       <object class="TalkatuActionGroup">
diff --git a/pidgin/resources/statusprimitivechooser.ui b/pidgin/resources/statusprimitivechooser.ui
--- a/pidgin/resources/statusprimitivechooser.ui
+++ b/pidgin/resources/statusprimitivechooser.ui
@@ -24,12 +24,10 @@ along with this program; if not, see <ht
   <!-- interface-name Pidgin -->
   <!-- interface-description Internet Messenger -->
   <!-- interface-copyright Pidgin Developers <devel@pidgin.im> -->
-  <template class="PidginStatusPrimitiveChooser" parent="AdwBin">
-    <property name="child">
-      <object class="GtkDropDown" id="chooser">
-        <property name="factory">
-          <object class="GtkBuilderListItemFactory">
-            <property name="bytes">
+  <template class="PidginStatusPrimitiveChooser" parent="AdwComboRow">
+    <property name="factory">
+      <object class="GtkBuilderListItemFactory">
+        <property name="bytes">
 <![CDATA[
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
@@ -62,21 +60,19 @@ along with this program; if not, see <ht
   </template>
 </interface>
 ]]>
-            </property>
-          </object>
         </property>
-        <property name="model">
-          <object class="GtkStringList">
-            <items>
-              <item>offline</item>
-              <item>available</item>
-              <item>unavailable</item>
-              <item>invisible</item>
-              <item>away</item>
-              <item>extended-away</item>
-            </items>
-          </object>
-        </property>
+      </object>
+    </property>
+    <property name="model">
+      <object class="GtkStringList">
+        <items>
+          <item>offline</item>
+          <item>available</item>
+          <item>unavailable</item>
+          <item>invisible</item>
+          <item>away</item>
+          <item>extended-away</item>
+        </items>
       </object>
     </property>
   </template>
