[metacity] don't use deprecated GtkMisc
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [metacity] don't use deprecated GtkMisc
- Date: Mon, 24 Nov 2014 18:15:44 +0000 (UTC)
commit 7a5c50ce334f69105f484719c5d3be7cd0de55ad
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Mon Nov 24 15:10:51 2014 +0200
don't use deprecated GtkMisc
configure.ac | 2 +-
src/ui/menu.c | 2 +-
src/ui/metaaccellabel.c | 14 ++++++++++----
3 files changed, 12 insertions(+), 6 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 5568004..5587f0c 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 0aace54..11471a4 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 8751e7a..48f562e 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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]