[gtk/wip/exalm/test: 12/37] tests: Fix testdialogtest



commit 02b27775d8c8d461db07cc0c6d95ed3f70c9ff14
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Mon May 11 03:36:02 2020 +0500

    tests: Fix testdialogtest
    
    Fix deprecations in UI files, add a missing expand.

 tests/dialog.ui    | 9 +++------
 tests/mydialog2.ui | 2 +-
 tests/testdialog.c | 5 +++--
 3 files changed, 7 insertions(+), 9 deletions(-)
---
diff --git a/tests/dialog.ui b/tests/dialog.ui
index d2dab24f8c..67f2ef9d24 100644
--- a/tests/dialog.ui
+++ b/tests/dialog.ui
@@ -13,7 +13,6 @@
   <object class="GtkDialog" id="dialog">
     <property name="modal">1</property>
     <property name="destroy_with_parent">1</property>
-    <property name="type_hint">dialog</property>
     <property name="default_width">500</property>
     <property name="use_header_bar">1</property>
     <property name="title" translatable="yes">Join Chat Room</property>
@@ -44,14 +43,13 @@
           <object class="GtkButton" id="confirm_button">
             <property name="label" translatable="yes">_Join</property>
             <property name="can_focus">1</property>
-            <property name="has_default">1</property>
             <property name="receives_default">1</property>
             <property name="use_underline">1</property>
           </object>
         </child>
       </object>
     </child>
-    <child internal-child="vbox">
+    <child internal-child="content_area">
       <object class="GtkBox" id="dialog-vbox1">
         <property name="orientation">vertical</property>
         <property name="spacing">2</property>
@@ -61,11 +59,10 @@
             <child>
               <object class="GtkStackPage">
                 <property name="name">main</property>
-                <property name="position">0</property>
                 <property name="child">
                   <object class="GtkGrid" id="grid1">
-                    <property name="margin_left">24</property>
-                    <property name="margin_right">24</property>
+                    <property name="margin_start">24</property>
+                    <property name="margin_end">24</property>
                     <property name="margin_top">24</property>
                     <property name="margin_bottom">24</property>
                     <property name="row_spacing">12</property>
diff --git a/tests/mydialog2.ui b/tests/mydialog2.ui
index aa1f990358..d9bd63ae40 100644
--- a/tests/mydialog2.ui
+++ b/tests/mydialog2.ui
@@ -1,6 +1,6 @@
 <interface>
   <template class="MyDialog2" parent="GtkDialog">
-    <child internal-child="vbox">
+    <child internal-child="content_area">
       <object class="GtkBox">
         <child>
           <object class="GtkLabel" id="content">
diff --git a/tests/testdialog.c b/tests/testdialog.c
index 57b99a8690..bc9b2af188 100644
--- a/tests/testdialog.c
+++ b/tests/testdialog.c
@@ -99,6 +99,8 @@ add_content (GtkWidget *dialog)
   gtk_widget_set_margin_end (label, 50);
   gtk_widget_set_margin_top (label, 50);
   gtk_widget_set_margin_bottom (label, 50);
+  gtk_widget_set_hexpand (label, TRUE);
+  gtk_widget_set_vexpand (label, TRUE);
   gtk_widget_show (label);
 
   gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), label);
@@ -183,8 +185,7 @@ show_dialog_with_header_buttons2 (GtkWindow *parent)
   GtkBuilder *builder;
   GtkWidget *dialog;
 
-  builder = gtk_builder_new ();
-  gtk_builder_add_from_file (builder, "dialog.ui", NULL);
+  builder = gtk_builder_new_from_file ("dialog.ui");
   dialog = (GtkWidget *)gtk_builder_get_object (builder, "dialog");
   g_object_unref (builder);
 


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