diff options
author | Matthias Clasen <mclasen@redhat.com> | 2014-05-23 05:56:52 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2014-05-24 00:48:12 -0400 |
commit | aabc356b80fab025d460f61b6c08743b2c10e20d (patch) | |
tree | f7ad279678f6247a25881e5e0b806ed0130e3233 /gtk/deprecated | |
parent | 1008e1541450a17d3a140cd50f086c4df167ec49 (diff) | |
download | gtk+-aabc356b80fab025d460f61b6c08743b2c10e20d.tar.gz |
GtkMisc: Keep gtk_misc_set_alignment working
Now that labels and images no longer use x/yalign in their code,
we need to make gtk_misc_set_alignment set the h/valign for these
widgets, to keep it stumbling along until its final demise.
https://bugzilla.gnome.org/show_bug.cgi?id=730613
Diffstat (limited to 'gtk/deprecated')
-rw-r--r-- | gtk/deprecated/gtkmisc.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/gtk/deprecated/gtkmisc.c b/gtk/deprecated/gtkmisc.c index 303b5e77a1..ff4db12a68 100644 --- a/gtk/deprecated/gtkmisc.c +++ b/gtk/deprecated/gtkmisc.c @@ -27,6 +27,8 @@ #include "gtkmisc.h" #include "gtkintl.h" #include "gtkprivate.h" +#include "gtkimage.h" +#include "gtklabel.h" G_GNUC_BEGIN_IGNORE_DEPRECATIONS @@ -232,6 +234,28 @@ gtk_misc_set_alignment (GtkMisc *misc, priv = misc->priv; + if (GTK_IS_LABEL (misc) || GTK_IS_IMAGE (misc)) + { + GtkAlign halign, valign; + + if (xalign < 0.4) + halign = GTK_ALIGN_START; + else if (xalign > 0.6) + halign = GTK_ALIGN_END; + else + halign = GTK_ALIGN_CENTER; + + if (yalign < 0.4) + valign = GTK_ALIGN_START; + else if (yalign > 0.6) + valign = GTK_ALIGN_END; + else + valign = GTK_ALIGN_CENTER; + + gtk_widget_set_halign (GTK_WIDGET (misc), halign); + gtk_widget_set_valign (GTK_WIDGET (misc), valign); + } + if (xalign < 0.0) xalign = 0.0; else if (xalign > 1.0) |