search entry has clear button even when blank

Bug #934083 reported by gue5t gue5t
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Midori Web Browser
Fix Released
Undecided
Unassigned

Bug Description

The search entry in the locationbar gained a clear button (see <https://bugs.launchpad.net/midori/+bug/699954>), but the clear button should only be visible when the entry is non-empty. Right now in GTK2 the italicized search engine hint is enough to trigger the "non-empty" state and show the button; this should be handled for so that the clear button is only visible if real text is present to avoid confusion. Fixing this detail would make it better match the behavior of other entries in the browser, e.g. search widgets in pages and the findbar.

gue5t gue5t (gue5t)
description: updated
Revision history for this message
gue5t gue5t (gue5t) wrote :

This patch fixes the bug. It also changes ordering of function calls in gtk3-compat.c's default text implementation so that when the entry widget's text is set, callbacks can rely on the value of sokoke_has_default being correct for the new text value.

description: updated
tags: added: gtk2
Revision history for this message
Cris Dywan (kalikiana) wrote :

I'm afraid relying on that flag is not okay. The gtk3 compat code is supposed to mimic upstream.

But swapping set_object_data is the right direction. I went further to set the default text at the top of sokoke_entry_set_default_text. Additionally I implemented gtk_entry_get_placeholder_text so that the clear button callback can see if default text is being used.

Changed in midori:
status: New → Fix Committed
Cris Dywan (kalikiana)
Changed in midori:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.