tests: Fix testdialogtest

Fix deprecations in UI files, add a missing expand.
This commit is contained in:
Alexander Mikhaylenko 2020-05-11 03:36:02 +05:00
parent 9af4a420a3
commit 02b27775d8
3 changed files with 7 additions and 9 deletions

View File

@ -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>

View File

@ -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">

View File

@ -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);