[Xfce4-commits] <midori:master> Move up/ down key handling from the entry into MidoriLocationAction
Christian Dywan
noreply at xfce.org
Fri Jan 1 18:24:03 CET 2010
Updating branch refs/heads/master
to 8039785073aaac784ae1917db2a46e9cb86190cb (commit)
from 15658145b2860bad4a9df40bec753194a8288e7a (commit)
commit 8039785073aaac784ae1917db2a46e9cb86190cb
Author: Christian Dywan <christian at twotoasts.de>
Date: Fri Jan 1 18:23:15 2010 +0100
Move up/ down key handling from the entry into MidoriLocationAction
midori/midori-locationaction.c | 15 ++++++++++++-
midori/midori-locationentry.c | 44 ----------------------------------------
midori/midori-locationentry.h | 3 --
tests/properties.c | 2 -
4 files changed, 14 insertions(+), 50 deletions(-)
diff --git a/midori/midori-locationaction.c b/midori/midori-locationaction.c
index 4939b56..73fe6af 100644
--- a/midori/midori-locationaction.c
+++ b/midori/midori-locationaction.c
@@ -542,7 +542,7 @@ midori_location_action_create_tool_item (GtkAction* action)
alignment = gtk_alignment_new (0.0f, 0.5f, 1.0f, 0.1f);
gtk_widget_show (alignment);
gtk_container_add (GTK_CONTAINER (toolitem), alignment);
- location_entry = midori_location_entry_new ();
+ location_entry = g_object_new (MIDORI_TYPE_LOCATION_ENTRY, NULL);
gtk_widget_show (location_entry);
gtk_container_add (GTK_CONTAINER (alignment), location_entry);
@@ -581,6 +581,19 @@ midori_location_action_key_press_event_cb (GtkEntry* entry,
g_signal_emit (action, signals[RESET_URI], 0);
return TRUE;
}
+ case GDK_Down:
+ case GDK_Up:
+ {
+ GtkWidget* parent = gtk_widget_get_parent (GTK_WIDGET (entry));
+ if (!katze_object_get_boolean (parent, "popup-shown"))
+ gtk_combo_box_popup (GTK_COMBO_BOX (parent));
+ return TRUE;
+ }
+ case GDK_Page_Up:
+ case GDK_Page_Down:
+ {
+ return TRUE;
+ }
}
return FALSE;
}
diff --git a/midori/midori-locationentry.c b/midori/midori-locationentry.c
index cb42c67..5dc5a42 100644
--- a/midori/midori-locationentry.c
+++ b/midori/midori-locationentry.c
@@ -30,11 +30,6 @@ struct _MidoriLocationEntryClass
G_DEFINE_TYPE (MidoriLocationEntry,
midori_location_entry, GTK_TYPE_COMBO_BOX_ENTRY)
-static gboolean
-entry_key_press_event (GtkWidget* widget,
- GdkEventKey* event,
- MidoriLocationEntry* location_entry);
-
static void
midori_location_entry_class_init (MidoriLocationEntryClass* class)
{
@@ -393,8 +388,6 @@ midori_location_entry_init (MidoriLocationEntry* location_entry)
gtk_icon_entry_set_icon_highlight (GTK_ICON_ENTRY (entry),
GTK_ICON_ENTRY_SECONDARY, TRUE);
#endif
- g_signal_connect_after (entry, "key-press-event",
- G_CALLBACK (entry_key_press_event), location_entry);
#if !GTK_CHECK_VERSION (2, 16, 0)
g_signal_connect_after (entry, "expose-event",
G_CALLBACK (entry_expose_event), location_entry);
@@ -402,40 +395,3 @@ midori_location_entry_init (MidoriLocationEntry* location_entry)
gtk_widget_show (entry);
gtk_container_add (GTK_CONTAINER (location_entry), entry);
}
-
-static gboolean
-entry_key_press_event (GtkWidget* widget,
- GdkEventKey* event,
- MidoriLocationEntry* location_entry)
-{
- switch (event->keyval)
- {
- case GDK_Down:
- case GDK_Up:
- {
- if (!katze_object_get_boolean (location_entry, "popup-shown"))
- gtk_combo_box_popup (GTK_COMBO_BOX (location_entry));
- return TRUE;
- }
- case GDK_Page_Up:
- case GDK_Page_Down:
- {
- return TRUE;
- }
- }
-
- return FALSE;
-}
-
-/**
- * midori_location_entry_new:
- *
- * Creates a new #MidoriLocationEntry.
- *
- * Return value: a new #MidoriLocationEntry
- **/
-GtkWidget*
-midori_location_entry_new (void)
-{
- return g_object_new (MIDORI_TYPE_LOCATION_ENTRY, NULL);
-}
diff --git a/midori/midori-locationentry.h b/midori/midori-locationentry.h
index 7a2317f..8841f54 100644
--- a/midori/midori-locationentry.h
+++ b/midori/midori-locationentry.h
@@ -29,9 +29,6 @@ typedef struct _MidoriLocationEntryClass MidoriLocationEntryClass;
GType
midori_location_entry_get_type (void);
-GtkWidget*
-midori_location_entry_new (void);
-
void
midori_location_entry_set_progress (MidoriLocationEntry* location_entry,
gdouble progress);
diff --git a/tests/properties.c b/tests/properties.c
index 239717c..93bf222 100644
--- a/tests/properties.c
+++ b/tests/properties.c
@@ -205,8 +205,6 @@ main (int argc,
(gconstpointer)MIDORI_TYPE_EXTENSION, properties_type_test);
g_test_add_data_func ("/properties/location-action",
(gconstpointer)MIDORI_TYPE_LOCATION_ACTION, properties_type_test);
- g_test_add_data_func ("/properties/location-entry",
- (gconstpointer)MIDORI_TYPE_LOCATION_ENTRY, properties_type_test);
g_test_add_data_func ("/properties/panel",
(gconstpointer)MIDORI_TYPE_PANEL, properties_type_test);
g_test_add_data_func ("/properties/preferences",
More information about the Xfce4-commits
mailing list