[evolution] remove select-on-focus hack, and replace with new skip-a-parent chaining hack; sub-set this only for
- From: Michael Meeks <michael src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution] remove select-on-focus hack, and replace with new skip-a-parent chaining hack; sub-set this only for
- Date: Wed, 11 Aug 2010 14:13:21 +0000 (UTC)
commit 9c072559904fb7a7807b3755f760b312d06f23b4
Author: Michael Meeks <michael meeks novell com>
Date: Wed Aug 11 15:10:01 2010 +0100
remove select-on-focus hack, and replace with new skip-a-parent
chaining hack; sub-set this only for when we have a hint visible
ie. fix alt-c + type-new-search
widgets/misc/e-hinted-entry.c | 27 +++++++--------------------
1 files changed, 7 insertions(+), 20 deletions(-)
---
diff --git a/widgets/misc/e-hinted-entry.c b/widgets/misc/e-hinted-entry.c
index 934c65a..355d9bf 100644
--- a/widgets/misc/e-hinted-entry.c
+++ b/widgets/misc/e-hinted-entry.c
@@ -126,29 +126,16 @@ hinted_entry_finalize (GObject *object)
static void
hinted_entry_grab_focus (GtkWidget *widget)
{
- EHintedEntryPrivate *priv;
- GtkSettings *settings;
- const gchar *property_name;
- gboolean select_on_focus;
-
- priv = E_HINTED_ENTRY_GET_PRIVATE (widget);
-
- /* We don't want hints to be selected so we must temporarily
- * override the "gtk-entry-select-on-focus" setting. */
+ GtkWidgetClass *chain_class;
- settings = gtk_widget_get_settings (widget);
- property_name = "gtk-entry-select-on-focus";
-
- g_object_get (settings, property_name, &select_on_focus, NULL);
-
- if (priv->hint_shown)
- g_object_set (settings, property_name, FALSE, NULL);
+ /* We don't want hints to be selected so we chain to
+ * the GtkEntry parent if we have a hint set */
+ chain_class = parent_class;
+ if (e_hinted_entry_get_hint_shown (E_HINTED_ENTRY (widget)))
+ chain_class = g_type_class_peek_parent (chain_class);
/* Chain up to parent's grab_focus() method. */
- GTK_WIDGET_CLASS (parent_class)->grab_focus (widget);
-
- if (priv->hint_shown)
- g_object_set (settings, property_name, select_on_focus, NULL);
+ GTK_WIDGET_CLASS (chain_class)->grab_focus (widget);
}
static gboolean
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]