HIG patch for the log out dialog



Here's a patch that makes the log out dialog more HIG compliant.
Has gnome-session been branched yet, or will I file a bug report and
wait?

iain
-- 
Index: logout.c
===================================================================
RCS file: /cvs/gnome/gnome-session/gnome-session/logout.c,v
retrieving revision 1.44
diff -U2 -r1.44 logout.c
--- logout.c	15 Oct 2002 06:05:01 -0000	1.44
+++ logout.c	16 Feb 2003 14:35:49 -0000
@@ -214,4 +214,20 @@
 }
 
+static GtkWidget *
+make_title_label (const char *text)
+{
+  GtkWidget *label;
+  char *full;
+
+  full = g_strdup_printf ("<span weight=\"bold\">%s</span>", text);
+  label = gtk_label_new (full);
+  g_free (full);
+
+  gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+  gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
+
+  return label;
+}
+
 static gboolean
 display_gui (void)
@@ -291,4 +307,5 @@
   gtk_window_set_policy (GTK_WINDOW (box), FALSE, FALSE, TRUE);
 
+  gtk_container_set_border_width (GTK_CONTAINER (box), 6);
   gtk_container_set_border_width (
 		GTK_CONTAINER (GTK_DIALOG (box)->vbox), GNOME_PAD);
@@ -312,16 +329,21 @@
       access (halt_command[0], X_OK) == 0)
     {
-      GtkWidget *frame;
-      GtkWidget *action_vbox;
+      GtkWidget *title, *spacer;
+      GtkWidget *action_vbox, *hbox;
       GtkWidget *r;
-
-      frame = gtk_frame_new (_("Action"));
+      
+      title = make_title_label (_("Action"));
       gtk_box_pack_start (GTK_BOX (GTK_DIALOG (box)->vbox),
-			  frame,
-			  FALSE, TRUE, GNOME_PAD_SMALL);
+			  title, FALSE, FALSE, GNOME_PAD_SMALL);
 
-      action_vbox = gtk_vbox_new (FALSE, 0);
-      gtk_container_add (GTK_CONTAINER (frame), action_vbox);
+      hbox = gtk_hbox_new (FALSE, 6);
+      gtk_box_pack_start (GTK_BOX (GTK_DIALOG (box)->vbox), hbox, TRUE, TRUE, 0);
 
+      spacer = gtk_label_new ("    ");
+      gtk_box_pack_start (GTK_BOX (hbox), spacer, FALSE, FALSE, 0);
+
+      action_vbox = gtk_vbox_new (FALSE, 0);
+      gtk_box_pack_start (GTK_BOX (hbox), action_vbox, TRUE, TRUE, 0);
+      
       r = gtk_radio_button_new_with_mnemonic (NULL, _("_Log Out"));
       gtk_box_pack_start (GTK_BOX (action_vbox), r, FALSE, FALSE, 0);


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