[giggle] giggle-revision-view: gtk_misc_set_alignment
- From: Javier Jardón <jjardon src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [giggle] giggle-revision-view: gtk_misc_set_alignment
- Date: Sun, 12 Jun 2011 16:34:30 +0000 (UTC)
commit 23dfe658bb010a685bcf981e7d0c148253730a49
Author: Diego Celix <dcelix gmail com>
Date: Sat Jun 11 03:57:04 2011 +0200
giggle-revision-view: gtk_misc_set_alignment
Replacing the function gtk_misc_set_alignment () with
gtk_widget_set_halign () and gtk_widget_set_valign () in
src/giggle-revision-view.c
src/giggle-revision-view.c | 19 +++++++++++--------
1 files changed, 11 insertions(+), 8 deletions(-)
---
diff --git a/src/giggle-revision-view.c b/src/giggle-revision-view.c
index f8bfdaa..e56d5b9 100644
--- a/src/giggle-revision-view.c
+++ b/src/giggle-revision-view.c
@@ -111,15 +111,16 @@ giggle_revision_view_searchable_init (GiggleSearchableIface *iface)
static GtkWidget *
revision_view_create_label (const char *label,
- double xalign,
- double yalign)
+ GtkAlign xalign,
+ GtkAlign yalign)
{
GtkWidget *widget;
char *markup;
widget = gtk_label_new (NULL);
markup = g_markup_printf_escaped ("<b>%s</b>", label);
- gtk_misc_set_alignment (GTK_MISC (widget), xalign, yalign);
+ gtk_widget_set_halign (widget, xalign);
+ gtk_widget_set_valign (widget, yalign);
gtk_label_set_markup (GTK_LABEL (widget), markup);
g_free (markup);
@@ -135,7 +136,7 @@ revision_view_attach_info (GtkWidget *table,
{
GtkStyleContext *context;
int xpad = 6, ypad = 3;
- double yalign = 0.5;
+ GtkAlign yalign = GTK_ALIGN_CENTER;
GtkAttachOptions yattach = GTK_FILL;
int end = 2;
@@ -151,12 +152,12 @@ revision_view_attach_info (GtkWidget *table,
xpad = MAX (0, xpad - (border.left + border.right) / 2);
ypad = MAX (0, ypad - (border.top + border.bottom) / 2);
yattach |= GTK_EXPAND;
- yalign = 0.0;
+ yalign = GTK_ALIGN_START;
end = 3;
}
gtk_table_attach (GTK_TABLE (table),
- revision_view_create_label (label, 0.0, yalign),
+ revision_view_create_label (label, GTK_ALIGN_CENTER, yalign),
0, 1, row, row + 1, GTK_FILL, GTK_FILL, 6, 2);
gtk_table_attach (GTK_TABLE (table), info, 1, end, row, row + 1,
GTK_FILL | GTK_EXPAND, yattach, xpad, ypad);
@@ -172,7 +173,8 @@ revision_view_create_info (GtkWidget *table,
info = gtk_label_new (NULL);
gtk_label_set_ellipsize (GTK_LABEL (info), PANGO_ELLIPSIZE_END);
gtk_label_set_selectable (GTK_LABEL (info), TRUE);
- gtk_misc_set_alignment (GTK_MISC (info), 0.0, 0.5);
+ gtk_widget_set_halign (info, GTK_ALIGN_START);
+ gtk_widget_set_valign (info, GTK_ALIGN_CENTER);
revision_view_attach_info (table, label, info, row);
@@ -194,7 +196,8 @@ giggle_revision_view_init (GiggleRevisionView *view)
priv->table = gtk_table_new (5, 3, FALSE);
priv->avatar = giggle_avatar_image_new ();
- gtk_misc_set_alignment (GTK_MISC (priv->avatar), 0.5, 0.0);
+ gtk_widget_set_halign (priv->avatar, GTK_ALIGN_CENTER);
+ gtk_widget_set_valign (priv->avatar, GTK_ALIGN_START);
giggle_avatar_image_set_image_size (GIGGLE_AVATAR_IMAGE (priv->avatar), 80);
gtk_table_attach (GTK_TABLE (priv->table), priv->avatar,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]