action = _action_by_name (browser, "Location");
if (midori_view_get_load_status (view) == MIDORI_LOAD_COMMITTED)
- {
- if (browser->maximum_history_age)
- midori_location_action_add_uri (MIDORI_LOCATION_ACTION (action), uri);
- }
+ midori_location_action_add_uri (MIDORI_LOCATION_ACTION (action), uri);
if (widget == midori_browser_get_current_tab (browser))
{
MidoriBrowser* browser)
{
GtkAction* location_action = _action_by_name (browser, "Location");
- midori_location_action_clear (MIDORI_LOCATION_ACTION (location_action));
g_object_set (_action_by_name (browser, "RecentlyVisited"),
"array", NULL, NULL);
+ midori_location_action_clear (MIDORI_LOCATION_ACTION (location_action));
}
static void
G_OBJECT_CLASS (midori_location_action_parent_class)->finalize (object);
}
+static void
+midori_location_action_toggle_arrow_cb (GtkWidget* widget,
+ MidoriLocationAction* location_action)
+{
+ if (GTK_IS_BUTTON (widget))
+ {
+ gboolean show = location_action->history
+ && katze_array_get_nth_item (location_action->history, 0);
+ sokoke_widget_set_visible (widget, show);
+ gtk_widget_set_size_request (widget, show ? -1 : 1, show ? -1 : 1);
+ }
+}
+
+static void
+midori_location_action_toggle_arrow (MidoriLocationAction* location_action)
+{
+ GSList* proxies = gtk_action_get_proxies (GTK_ACTION (location_action));
+ for (; proxies != NULL; proxies = g_slist_next (proxies))
+ if (GTK_IS_TOOL_ITEM (proxies->data))
+ {
+ GtkWidget* entry = midori_location_action_entry_for_proxy (proxies->data);
+ gtk_container_forall (GTK_CONTAINER (entry),
+ (GtkCallback)midori_location_action_toggle_arrow_cb, location_action);
+ }
+}
+
static void
midori_location_action_set_property (GObject* object,
guint prop_id,
case PROP_HISTORY:
{
katze_assign (location_action->history, g_value_dup_object (value));
+
+ midori_location_action_toggle_arrow (location_action);
break;
}
default:
renderer, midori_location_entry_render_text_cb, child, NULL);
gtk_combo_box_set_active (GTK_COMBO_BOX (entry), -1);
+ gtk_container_forall (GTK_CONTAINER (entry),
+ (GtkCallback)midori_location_action_toggle_arrow_cb, action);
g_signal_connect (entry, "changed",
G_CALLBACK (midori_location_action_entry_changed_cb), action);
g_signal_connect (entry, "popup",
g_return_if_fail (uri != NULL);
katze_assign (location_action->uri, g_strdup (uri));
+
+ midori_location_action_toggle_arrow (location_action);
}
void
{
g_return_if_fail (MIDORI_IS_LOCATION_ACTION (location_action));
- /* Nothing to do */
+ midori_location_action_toggle_arrow (location_action);
}