r1953 - in trunk/src/target/OM-2007/applications/openmoko-contacts: . src
thomas at sita.openmoko.org
thomas at sita.openmoko.org
Mon May 14 12:44:23 CEST 2007
Author: thomas
Date: 2007-05-14 12:44:21 +0200 (Mon, 14 May 2007)
New Revision: 1953
Modified:
trunk/src/target/OM-2007/applications/openmoko-contacts/ChangeLog
trunk/src/target/OM-2007/applications/openmoko-contacts/src/contacts-contact-pane.c
Log:
Patch by: Neil J Patel <njp at o-hand.com>
* src/contacts-contact-pane.c: (field_focus_in), (field_focus_out),
(make_widget): Remove frames from entry boxes when not focused in edit mode
Modified: trunk/src/target/OM-2007/applications/openmoko-contacts/ChangeLog
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-contacts/ChangeLog 2007-05-13 23:32:35 UTC (rev 1952)
+++ trunk/src/target/OM-2007/applications/openmoko-contacts/ChangeLog 2007-05-14 10:44:21 UTC (rev 1953)
@@ -1,3 +1,10 @@
+2007-05-14 Thomas Wood <thomas at openedhand.com>
+
+ Patch by: Neil J Patel <njp at o-hand.com>
+
+ * src/contacts-contact-pane.c: (field_focus_in), (field_focus_out),
+ (make_widget): Remove frames from entry boxes when not focused in edit mode
+
2007-05-01 Thomas Wood <thomas at openedhand.com>
* src/contacts-callbacks-ebook.c: (contacts_added_cb):
Modified: trunk/src/target/OM-2007/applications/openmoko-contacts/src/contacts-contact-pane.c
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-contacts/src/contacts-contact-pane.c 2007-05-13 23:32:35 UTC (rev 1952)
+++ trunk/src/target/OM-2007/applications/openmoko-contacts/src/contacts-contact-pane.c 2007-05-14 10:44:21 UTC (rev 1953)
@@ -256,7 +256,13 @@
gtk_widget_modify_text (GTK_WIDGET (entry), GTK_STATE_NORMAL, &gray);
gtk_entry_set_text (GTK_ENTRY (entry), "");
+
}
+
+ /* Restore the frame & set the base colour to normal */
+ gtk_entry_set_has_frame (GTK_ENTRY (entry), TRUE);
+ gtk_widget_modify_base (entry, GTK_STATE_NORMAL, NULL);
+
return FALSE;
}
@@ -266,9 +272,20 @@
static gboolean
field_focus_out (GtkWidget *entry, GdkEventFocus *event, FieldInfo *info)
{
+ GtkWidget *parent = NULL;
+
if (!strcmp (gtk_entry_get_text (GTK_ENTRY (entry)), "")) {
field_set_blank (GTK_ENTRY (entry), info);
}
+
+ /* Remove the frame & set the base colour to the background of the parent */
+ gtk_entry_set_has_frame (GTK_ENTRY (entry), FALSE);
+
+ parent = gtk_widget_get_parent (entry);
+ if (parent)
+ gtk_widget_modify_base (entry,
+ GTK_STATE_NORMAL,
+ &(parent->style->bg[GTK_STATE_NORMAL]));
return FALSE;
}
@@ -638,6 +655,13 @@
if (pane->priv->editable) {
value = gtk_entry_new ();
+ /* Make the entry "transparent" by setting the base colour to that of
+ the parent, and removing the frame */
+ gtk_entry_set_has_frame (GTK_ENTRY (value), FALSE);
+ gtk_widget_modify_base (value,
+ GTK_STATE_NORMAL,
+ &(GTK_WIDGET (pane)->style->bg[GTK_STATE_NORMAL]));
+
if (attr_value)
gtk_entry_set_text (GTK_ENTRY (value), attr_value);
else
More information about the commitlog
mailing list