[gtk+] GtkAssistant: Fix label alignment



commit 41dbd20d561c59ebfe64e26986d7c8641c35457a
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Sep 4 00:40:30 2011 -0400

    GtkAssistant: Fix label alignment
    
    Make page titles left-aligned again. Changing from misc alignment
    to GtkWidget::halign here was a mistake. We can't do that for labels
    in a size group, as long as labels still pay attention to misc
    alignment.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=658008

 gtk/gtkassistant.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkassistant.c b/gtk/gtkassistant.c
index 49ebe15..e95bf68 100644
--- a/gtk/gtkassistant.c
+++ b/gtk/gtkassistant.c
@@ -1610,12 +1610,15 @@ gtk_assistant_insert_page (GtkAssistant *assistant,
   page_info->regular_title = gtk_label_new (NULL);
   page_info->current_title = gtk_label_new (NULL);
 
-  gtk_widget_set_halign (page_info->regular_title, GTK_ALIGN_START);
-  gtk_widget_set_valign (page_info->regular_title, GTK_ALIGN_CENTER);
+  /* Note: we need to use misc alignment here as long as GtkLabel
+   * pays attention to it. GtkWiget::halign is ineffective, since
+   * all the labels are getting the same size anyway, due to the
+   * size group.
+   */
+  gtk_misc_set_alignment (GTK_MISC (page_info->regular_title), 0, 0.5);
   gtk_widget_show (page_info->regular_title);
 
-  gtk_widget_set_halign (page_info->current_title, GTK_ALIGN_START);
-  gtk_widget_set_valign (page_info->current_title, GTK_ALIGN_CENTER);
+  gtk_misc_set_alignment (GTK_MISC (page_info->current_title), 0, 0.5);
   gtk_widget_hide (page_info->current_title);
 
   context = gtk_widget_get_style_context (page_info->current_title);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]