summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorCorentin Noël <corentin@elementary.io>2019-06-09 18:09:49 +0000
committerAlberto Fanjul <albertofanjul@gmail.com>2019-06-09 18:09:49 +0000
commit4c280cce032c760d03996018c34d69b0579d09fe (patch)
tree9484ed29cd67539564dca092b4a87b9a5cbc25fe /plugins
parent3235d479f4f26476958b6686f410ab18d6c3f260 (diff)
downloadglade-4c280cce032c760d03996018c34d69b0579d09fe.tar.gz
Replace some functions by Gtk 3.22 ones
And reduce the amount of deprecation warnings
Diffstat (limited to 'plugins')
-rw-r--r--plugins/gtk+/glade-attributes.c14
-rw-r--r--plugins/gtk+/glade-gtk-button.c2
-rw-r--r--plugins/gtk+/glade-icon-factory-editor.c44
3 files changed, 28 insertions, 32 deletions
diff --git a/plugins/gtk+/glade-attributes.c b/plugins/gtk+/glade-attributes.c
index e7ac3157..b508ac0d 100644
--- a/plugins/gtk+/glade-attributes.c
+++ b/plugins/gtk+/glade-attributes.c
@@ -435,7 +435,7 @@ type_from_attr_type (PangoAttrType type)
case PANGO_ATTR_UNDERLINE_COLOR:
case PANGO_ATTR_STRIKETHROUGH_COLOR:
/* boxed colours */
- return GDK_TYPE_COLOR;
+ return PANGO_TYPE_COLOR;
/* PangoAttrShape */
case PANGO_ATTR_SHAPE:
@@ -459,7 +459,7 @@ glade_gtk_string_from_attr (GladeAttribute *gattr)
gchar *ret = NULL;
gint ival;
gdouble fval;
- GdkColor *color;
+ PangoColor *color;
switch (gattr->type)
{
@@ -517,7 +517,7 @@ glade_gtk_string_from_attr (GladeAttribute *gattr)
case PANGO_ATTR_STRIKETHROUGH_COLOR:
/* boxed colours */
color = g_value_get_boxed (&(gattr->value));
- ret = gdk_color_to_string (color);
+ ret = pango_color_to_string (color);
break;
/* PangoAttrShape */
@@ -540,7 +540,7 @@ GladeAttribute *
glade_gtk_attribute_from_string (PangoAttrType type, const gchar *strval)
{
GladeAttribute *gattr;
- GdkColor color;
+ PangoColor color;
gattr = g_new0 (GladeAttribute, 1);
gattr->type = type;
@@ -597,9 +597,9 @@ glade_gtk_attribute_from_string (PangoAttrType type, const gchar *strval)
case PANGO_ATTR_UNDERLINE_COLOR:
case PANGO_ATTR_STRIKETHROUGH_COLOR:
/* boxed colours */
- if (gdk_color_parse (strval, &color))
+ if (pango_color_parse (&color, strval))
{
- g_value_init (&(gattr->value), GDK_TYPE_COLOR);
+ g_value_init (&(gattr->value), PANGO_TYPE_COLOR);
g_value_set_boxed (&(gattr->value), &color);
}
else
@@ -736,7 +736,7 @@ value_icon_activate (GtkCellRendererToggle *cell_renderer,
if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK)
{
gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (dialog), &color);
- /* Use GdkColor string format */
+ /* Use PangoColor string format */
if (((guint8)(color.red * 0xFF)) * 0x101 == (guint16)(color.red * 0xFFFF) &&
((guint8)(color.green * 0xFF)) * 0x101 == (guint16)(color.green * 0xFFFF) &&
((guint8)(color.blue * 0xFF)) * 0x101 == (guint16)(color.blue * 0xFFFF))
diff --git a/plugins/gtk+/glade-gtk-button.c b/plugins/gtk+/glade-gtk-button.c
index 3d846dfe..b4e87d16 100644
--- a/plugins/gtk+/glade-gtk-button.c
+++ b/plugins/gtk+/glade-gtk-button.c
@@ -45,7 +45,7 @@ glade_gtk_font_button_refresh_font_name (GtkFontButton *button,
if ((property = glade_widget_get_property (gbutton, "font-name")) != NULL)
glade_command_set_property (property,
- gtk_font_button_get_font_name (button));
+ gtk_font_chooser_get_font (GTK_FONT_CHOOSER (button)));
}
diff --git a/plugins/gtk+/glade-icon-factory-editor.c b/plugins/gtk+/glade-icon-factory-editor.c
index d5d67fe8..620426ea 100644
--- a/plugins/gtk+/glade-icon-factory-editor.c
+++ b/plugins/gtk+/glade-icon-factory-editor.c
@@ -126,7 +126,7 @@ glade_icon_factory_editor_new (GladeWidgetAdaptor *adaptor,
{
GladeIconFactoryEditor *factory_editor;
GladeEditorProperty *eprop;
- GtkWidget *label, *alignment, *frame, *vbox;
+ GtkWidget *label, *description_label, *vbox;
g_return_val_if_fail (GLADE_IS_WIDGET_ADAPTOR (adaptor), NULL);
g_return_val_if_fail (GLADE_IS_EDITABLE (embed), NULL);
@@ -134,37 +134,33 @@ glade_icon_factory_editor_new (GladeWidgetAdaptor *adaptor,
factory_editor = g_object_new (GLADE_TYPE_ICON_FACTORY_EDITOR, NULL);
factory_editor->embed = GTK_WIDGET (embed);
- /* Pack the parent on top... */
- gtk_box_pack_start (GTK_BOX (factory_editor), GTK_WIDGET (embed), FALSE,
- FALSE, 0);
-
/* Label item in frame label widget on top... */
eprop =
glade_widget_adaptor_create_eprop_by_name (adaptor, "sources", FALSE,
TRUE);
factory_editor->properties =
g_list_prepend (factory_editor->properties, eprop);
- frame = gtk_frame_new (NULL);
- gtk_frame_set_label_widget (GTK_FRAME (frame), glade_editor_property_get_item_label (eprop));
- gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_NONE);
- gtk_box_pack_start (GTK_BOX (factory_editor), frame, FALSE, FALSE, 12);
-
- /* Alignment/Vbox in frame... */
- alignment = gtk_alignment_new (0.5F, 0.5F, 1.0F, 1.0F);
- gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 6, 0, 12, 0);
- gtk_container_add (GTK_CONTAINER (frame), alignment);
- vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
- gtk_container_add (GTK_CONTAINER (alignment), vbox);
+
+ label = glade_editor_property_get_item_label (eprop);
/* Add descriptive label */
- label = gtk_label_new (_("First add a stock name in the entry below, "
- "then add and define sources for that icon "
- "in the treeview."));
- gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
- gtk_label_set_line_wrap_mode (GTK_LABEL (label), PANGO_WRAP_WORD);
- gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 8);
-
- gtk_box_pack_start (GTK_BOX (vbox), GTK_WIDGET (eprop), FALSE, FALSE, 8);
+ description_label = gtk_label_new (_("First add a stock name in the entry below, "
+ "then add and define sources for that icon "
+ "in the treeview."));
+ gtk_label_set_line_wrap (GTK_LABEL (description_label), TRUE);
+ gtk_label_set_line_wrap_mode (GTK_LABEL (description_label), PANGO_WRAP_WORD);
+
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
+ gtk_box_set_spacing (GTK_BOX (vbox), 6);
+
+ gtk_container_add (GTK_CONTAINER (vbox), label);
+ gtk_container_add (GTK_CONTAINER (vbox), description_label);
+ gtk_container_add (GTK_CONTAINER (vbox), GTK_WIDGET (eprop));
+ gtk_widget_set_margin_top (vbox, 6);
+
+ /* Pack the parent on top... */
+ gtk_container_add (GTK_CONTAINER (factory_editor), GTK_WIDGET (embed));
+ gtk_container_add (GTK_CONTAINER (factory_editor), vbox);
gtk_widget_show_all (GTK_WIDGET (factory_editor));