From e9987ce4005173f81f177b3151208e5f749e7f7c Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 7 Feb 2012 11:11:34 -0600 Subject: Adding flags into the build to make sure we know if we're GTK3 or not --- configure.ac | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/configure.ac b/configure.ac index 3e5fa97..a34450c 100644 --- a/configure.ac +++ b/configure.ac @@ -51,6 +51,7 @@ AS_IF([test "x$with_gtk" = x3], ], [AC_MSG_FAILURE([Value for --with-indicator-gtk was neither 2 nor 3])] ) + AC_SUBST(APPLET_CFLAGS) AC_SUBST(APPLET_LIBS) @@ -77,6 +78,11 @@ AS_IF([test "x$with_gtk" = x3], AC_SUBST(SESSIONERVICE_CFLAGS) AC_SUBST(SESSIONERVICE_LIBS) +AM_CONDITIONAL([USE_GTK3], [test "x$with_gtk" = "x3"]) +AS_IF([test "x$with_gtk" = x3], [ + AC_DEFINE(HAVE_GTK3, 1, [whether gtk3 is available]) + ]) + ########################### # GTK Logout Helper ########################### -- cgit v1.2.3 From 0d10a8e683b76a3bdb245c0f068027a757be12d4 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 7 Feb 2012 11:11:52 -0600 Subject: If we have GTK3 use the new gtk_box_new() function not the deprecated one --- src/user-widget.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/user-widget.c b/src/user-widget.c index 937a9eb..88ac11c 100644 --- a/src/user-widget.c +++ b/src/user-widget.c @@ -136,7 +136,11 @@ user_widget_init (UserWidget *self) gtk_misc_set_padding (GTK_MISC(priv->user_image),0, 4.0); priv->user_name = gtk_label_new (""); +#if HAVE_GTK3 + priv->container = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); +#else priv->container = gtk_hbox_new (FALSE, 0); +#endif priv->tick_icon = gtk_image_new_from_icon_name ("account-logged-in", GTK_ICON_SIZE_MENU); gtk_misc_set_alignment(GTK_MISC(priv->tick_icon), 1.0, 0.5); -- cgit v1.2.3