[dia/dia-next: 26/59] Use alternatives to GtkMisc
- From: Zander <zbrown src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dia/dia-next: 26/59] Use alternatives to GtkMisc
- Date: Wed, 9 Jan 2019 18:36:29 +0000 (UTC)
commit 7abd5d65e52f70eace810ba68881879b53435baa
Author: Zander Brown <zbrown gnome org>
Date: Tue Dec 25 01:56:58 2018 +0000
Use alternatives to GtkMisc
app/dia-props.c | 12 ++++++++----
app/diapagelayout.c | 7 ++++++-
app/toolbox.c | 5 +++--
lib/propdialogs.c | 3 ++-
lib/widgets.c | 8 ++++++--
objects/UML/class_dialog.c | 3 ++-
objects/UML/class_operations_dialog.c | 6 ++++--
7 files changed, 31 insertions(+), 13 deletions(-)
---
diff --git a/app/dia-props.c b/app/dia-props.c
index 08387b6b..320a7875 100644
--- a/app/dia-props.c
+++ b/app/dia-props.c
@@ -180,7 +180,8 @@ create_diagram_properties_dialog(Diagram *dia)
gtk_widget_show(hex_check);
label = gtk_label_new(_("Hex grid size"));
- gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
+ gtk_label_set_xalign (GTK_LABEL (label), 0.0);
+ gtk_label_set_yalign (GTK_LABEL (label), 0.5);
gtk_grid_attach (GTK_GRID (table), label, 0, 5, 1, 1);
gtk_widget_show (label);
@@ -203,7 +204,8 @@ create_diagram_properties_dialog(Diagram *dia)
gtk_grid_set_column_spacing (GTK_GRID (table), 2);
label = gtk_label_new(_("Background"));
- gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
+ gtk_label_set_xalign (GTK_LABEL (label), 0.0);
+ gtk_label_set_yalign (GTK_LABEL (label), 0.5);
gtk_grid_attach (GTK_GRID (table), label, 0, 0, 1, 1);
gtk_widget_show(label);
@@ -213,7 +215,8 @@ create_diagram_properties_dialog(Diagram *dia)
gtk_widget_show (bg_colour);
label = gtk_label_new(_("Grid Lines"));
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_label_set_xalign (GTK_LABEL (label), 0.0);
+ gtk_label_set_yalign (GTK_LABEL (label), 0.5);
gtk_grid_attach (GTK_GRID (table), label, 0, 1, 1, 1);
gtk_widget_show (label);
@@ -223,7 +226,8 @@ create_diagram_properties_dialog(Diagram *dia)
gtk_widget_show (grid_colour);
label = gtk_label_new(_("Page Breaks"));
- gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
+ gtk_label_set_xalign (GTK_LABEL (label), 0.0);
+ gtk_label_set_yalign (GTK_LABEL (label), 0.5);
gtk_grid_attach (GTK_GRID (table), label, 0, 2, 1, 1);
gtk_widget_show (label);
diff --git a/app/diapagelayout.c b/app/diapagelayout.c
index 40d74a31..56e767e8 100644
--- a/app/diapagelayout.c
+++ b/app/diapagelayout.c
@@ -318,7 +318,12 @@ dia_page_layout_init(DiaPageLayout *self)
gtk_widget_show (self->fitw);
wid = gtk_label_new (_("by"));
- gtk_misc_set_padding (GTK_MISC (wid), 5, 0);
+ g_object_set (G_OBJECT (wid),
+ "margin-start", 5,
+ "margin-end", 5,
+ "margin-top", 0,
+ "margin-bottom", 0,
+ NULL);
gtk_widget_set_vexpand (wid, TRUE);
gtk_grid_attach (GTK_GRID (table), wid, 2, 1, 1, 1);
gtk_widget_show (wid);
diff --git a/app/toolbox.c b/app/toolbox.c
index 3c3a986c..61a86941 100644
--- a/app/toolbox.c
+++ b/app/toolbox.c
@@ -747,8 +747,9 @@ create_tools(GtkWidget *parent)
image = create_widget_from_xpm_or_gdkp(tool_data[i].icon_data, button, &pixbuf);
}
- /* GTKBUG:? padding changes */
- gtk_misc_set_padding(GTK_MISC(image), 2, 2);
+ g_object_set (G_OBJECT (image),
+ "margin", 2,
+ NULL);
gtk_container_add (GTK_CONTAINER (button), image);
diff --git a/lib/propdialogs.c b/lib/propdialogs.c
index d81168e6..35de9948 100644
--- a/lib/propdialogs.c
+++ b/lib/propdialogs.c
@@ -274,7 +274,8 @@ prop_dialog_add_property(PropDialog *dialog, Property *prop)
label = gtk_label_new("");
else
label = gtk_label_new(_(prop->descr->description));
- gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
+ gtk_label_set_xalign (GTK_LABEL (label), 0.0);
+ gtk_label_set_yalign (GTK_LABEL (label), 0.5);
prop_dialog_add_widget(dialog, label, widget);
}
diff --git a/lib/widgets.c b/lib/widgets.c
index 6bc93c4c..938f016e 100644
--- a/lib/widgets.c
+++ b/lib/widgets.c
@@ -749,8 +749,12 @@ dia_toggle_button_new(GtkWidget *on_widget, GtkWidget *off_widget)
gtk_widget_show(images->off);
/* Make border as small as possible */
- gtk_misc_set_padding(GTK_MISC(images->on), 0, 0);
- gtk_misc_set_padding(GTK_MISC(images->off), 0, 0);
+ g_object_set (G_OBJECT (images->on),
+ "margin", 0,
+ NULL);
+ g_object_set (G_OBJECT (images->off),
+ "margin", 0,
+ NULL);
gtk_widget_set_can_focus (GTK_WIDGET (button), FALSE);
gtk_widget_set_can_default (GTK_WIDGET (button), FALSE);
diff --git a/objects/UML/class_dialog.c b/objects/UML/class_dialog.c
index f6b744f4..9bcf8561 100644
--- a/objects/UML/class_dialog.c
+++ b/objects/UML/class_dialog.c
@@ -357,7 +357,8 @@ class_create_page(GtkNotebook *notebook, UMLClass *umlclass)
prop_dialog->comment = GTK_TEXT_VIEW(entry);
gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (entry), GTK_WRAP_WORD);
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_label_set_xalign (GTK_LABEL (label), 0.0);
+ gtk_label_set_yalign (GTK_LABEL (label), 0.5);
gtk_grid_attach (GTK_GRID (table), label, 0, 2, 1, 1);
gtk_container_add (GTK_CONTAINER (scrolledwindow), entry);
diff --git a/objects/UML/class_operations_dialog.c b/objects/UML/class_operations_dialog.c
index 888bc719..5e01630c 100644
--- a/objects/UML/class_operations_dialog.c
+++ b/objects/UML/class_operations_dialog.c
@@ -1032,7 +1032,8 @@ operations_parameters_data_create_vbox (UMLClass *umlclass)
G_CALLBACK (operations_update_event), umlclass);
g_signal_connect (G_OBJECT (entry), "activate",
G_CALLBACK (operations_update), umlclass);
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_label_set_xalign (GTK_LABEL (label), 0.0);
+ gtk_label_set_yalign (GTK_LABEL (label), 0.5);
gtk_label_set_xalign (GTK_LABEL (label), 0.0);
gtk_label_set_yalign (GTK_LABEL (label), 0.5);
@@ -1078,7 +1079,8 @@ operations_parameters_data_create_vbox (UMLClass *umlclass)
GtkWidget * align;
align = gtk_alignment_new (0.0, 0.5, 0.0, 0.0);
gtk_container_add (GTK_CONTAINER (align), omenu);
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_label_set_xalign (GTK_LABEL (label), 0.0);
+ gtk_label_set_yalign (GTK_LABEL (label), 0.5);
gtk_grid_attach (GTK_GRID (table), label, 2, 0, 1, 1);
gtk_grid_attach (GTK_GRID (table), align, 3, 0, 1, 1);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]