summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlberts Muktupāvels <alberts.muktupavels@gmail.com>2014-11-24 15:10:51 +0200
committerAlberts Muktupāvels <alberts.muktupavels@gmail.com>2014-11-24 15:10:51 +0200
commit7a5c50ce334f69105f484719c5d3be7cd0de55ad (patch)
tree4bb62e92d5785f5620454a0782e8584f1a36a53e
parentafc34d3227e467f5c19f8682d72add5fff15fa50 (diff)
downloadmetacity-7a5c50ce334f69105f484719c5d3be7cd0de55ad.tar.gz
don't use deprecated GtkMisc
-rw-r--r--configure.ac2
-rw-r--r--src/ui/menu.c2
-rw-r--r--src/ui/metaaccellabel.c14
3 files changed, 12 insertions, 6 deletions
diff --git a/configure.ac b/configure.ac
index 5568004b..5587f0c3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -109,7 +109,7 @@ fi
changequote([,])dnl
GTK_API_VERSION=3.0
-GTK_MIN_VERSION=3.12.0
+GTK_MIN_VERSION=3.15.2
GIO_MIN_VERSION=2.25.10
CANBERRA_GTK=libcanberra-gtk3
diff --git a/src/ui/menu.c b/src/ui/menu.c
index 0aace54c..11471a42 100644
--- a/src/ui/menu.c
+++ b/src/ui/menu.c
@@ -295,7 +295,7 @@ menu_item_new (MenuItem *menuitem, int workspace_id)
meta_core_get_menu_accelerator (menuitem->op, workspace_id, &key, &mods);
accel_label = meta_accel_label_new_with_mnemonic (i18n_label);
- gtk_misc_set_alignment (GTK_MISC (accel_label), 0.0, 0.5);
+ gtk_label_set_xalign (GTK_LABEL (accel_label), 0.0);
gtk_container_add (GTK_CONTAINER (mi), accel_label);
gtk_widget_show (accel_label);
diff --git a/src/ui/metaaccellabel.c b/src/ui/metaaccellabel.c
index 8751e7a9..48f562e7 100644
--- a/src/ui/metaaccellabel.c
+++ b/src/ui/metaaccellabel.c
@@ -239,7 +239,6 @@ meta_accel_label_draw (GtkWidget *widget,
cairo_t *cr)
{
MetaAccelLabel *accel_label = META_ACCEL_LABEL (widget);
- GtkMisc *misc = GTK_MISC (accel_label);
GtkTextDirection direction;
int ac_width;
GtkAllocation allocation;
@@ -258,10 +257,11 @@ meta_accel_label_draw (GtkWidget *widget,
PangoLayout *accel_layout;
GtkLabel *label = GTK_LABEL (widget);
gint x, y, xpad, ypad;
- gfloat xalign, yalign;
+ gint margin_start, margin_end, margin_top, margin_bottom;
+ gfloat yalign;
label_layout = gtk_label_get_layout (GTK_LABEL (accel_label));
- gtk_misc_get_alignment (misc, &xalign, &yalign);
+ yalign = gtk_label_get_yalign (GTK_LABEL (accel_label));
cairo_save (cr);
@@ -288,7 +288,13 @@ meta_accel_label_draw (GtkWidget *widget,
cairo_restore (cr);
- gtk_misc_get_padding (misc, &xpad, &ypad);
+ margin_start = gtk_widget_get_margin_start (widget);
+ margin_end = gtk_widget_get_margin_end (widget);
+ margin_top = gtk_widget_get_margin_top (widget);
+ margin_bottom = gtk_widget_get_margin_bottom (widget);
+
+ xpad = margin_start + margin_end;
+ ypad = margin_top + margin_bottom;
if (direction == GTK_TEXT_DIR_RTL)
x = xpad;