[gnome-db] Gray Bar with theme background and login-dialog label stuff



Hi all,

	In the login dialog the labels are selectable, and the GrayBar have a
plain gray background, with this patch the text in the labels can't be
selected and the background come from the gtk theme.

What do you think about it?


regards, apg.

Index: libgnomedb/gnome-db-gray-bar.c
===================================================================
RCS file: /cvs/gnome/libgnomedb/libgnomedb/gnome-db-gray-bar.c,v
retrieving revision 1.11
diff -u -r1.11 gnome-db-gray-bar.c
--- libgnomedb/gnome-db-gray-bar.c	16 Aug 2003 19:57:17 -0000	1.11
+++ libgnomedb/gnome-db-gray-bar.c	19 Sep 2003 12:16:55 -0000
@@ -152,21 +152,15 @@
 gnome_db_gray_bar_style_set (GtkWidget *w, GtkStyle *previous_style)
 {
 	static int in_style_set = 0;
-	GtkRcStyle *rc_style;
+	GtkStyle   *style;
 
 	if (in_style_set > 0)
                 return;
 
         in_style_set ++;
 
-	rc_style = gtk_rc_style_new ();
-	rc_style->color_flags[GTK_STATE_NORMAL] |= GTK_RC_BG;
-	rc_style->bg[GTK_STATE_NORMAL].red   = 0x8000;
-        rc_style->bg[GTK_STATE_NORMAL].green = 0x8000;
-        rc_style->bg[GTK_STATE_NORMAL].blue  = 0x8000;
-
-	gtk_widget_modify_style (w, rc_style);
-        gtk_rc_style_unref (rc_style);
+	style = gtk_rc_get_style (GTK_WIDGET (w));
+	gtk_widget_modify_bg (GTK_WIDGET (w), GTK_STATE_NORMAL, &style->bg[GTK_STATE_ACTIVE]);
 
 	in_style_set --;
 
Index: libgnomedb/gnome-db-login-dialog.c
===================================================================
RCS file: /cvs/gnome/libgnomedb/libgnomedb/gnome-db-login-dialog.c,v
retrieving revision 1.23
diff -u -r1.23 gnome-db-login-dialog.c
--- libgnomedb/gnome-db-login-dialog.c	4 Jul 2003 14:52:28 -0000	1.23
+++ libgnomedb/gnome-db-login-dialog.c	19 Sep 2003 12:16:55 -0000
@@ -121,6 +121,7 @@
 					     "to a data source"));
 	gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
         gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
+	gtk_label_set_selectable (GTK_LABEL (label), FALSE);
 	gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0);
 	gtk_box_pack_start (GTK_BOX (vbox), label, TRUE, TRUE, 0);
 
Index: libgnomedb/gnome-db-login.c
===================================================================
RCS file: /cvs/gnome/libgnomedb/libgnomedb/gnome-db-login.c,v
retrieving revision 1.21
diff -u -r1.21 gnome-db-login.c
--- libgnomedb/gnome-db-login.c	5 Jul 2003 21:40:43 -0000	1.21
+++ libgnomedb/gnome-db-login.c	19 Sep 2003 12:16:57 -0000
@@ -251,6 +251,7 @@
 
 	label = gnome_db_new_label_widget (_("Data Source:"));
         gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
+	gtk_label_set_selectable (GTK_LABEL (label), FALSE);
         gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
 	gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1, GTK_FILL, GTK_FILL, 0, 0);
 	login->priv->dsn_entry = gnome_db_data_source_selector_new (dsn);
@@ -267,6 +268,7 @@
 
 	label = gnome_db_new_label_widget (_("Username:"));
         gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
+	gtk_label_set_selectable (GTK_LABEL (label), FALSE);
         gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
 	gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2, GTK_FILL, GTK_FILL, 0, 0);
 	login->priv->username_entry = gnome_db_new_entry_widget (0, TRUE);
@@ -275,6 +277,7 @@
 
 	label = gnome_db_new_label_widget (_("Password:"));
         gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
+	gtk_label_set_selectable (GTK_LABEL (label), FALSE);
         gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
 	gtk_table_attach (GTK_TABLE (table), label, 0, 1, 2, 3, GTK_FILL, GTK_FILL, 0, 0);
 	login->priv->password_entry = gnome_db_new_entry_widget (0, TRUE);

Attachment: signature.asc
Description: Esta parte del mensaje =?ISO-8859-1?Q?est=E1?= firmada digitalmente



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