Bug 183861 - "clear location bar" button missing
Summary: "clear location bar" button missing
Status: CONFIRMED
Alias: None
Product: konqueror
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Unspecified
: NOR wishlist
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-10 00:26 UTC by Oswald Buddenhagen
Modified: 2012-12-31 19:20 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
screenshot (2.71 KB, image/png)
2009-02-10 00:53 UTC, Oswald Buddenhagen
Details
Setting m_opacity to -1 to enforce showing the button (776 bytes, patch)
2012-12-31 12:17 UTC, Thomas Fischer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Oswald Buddenhagen 2009-02-10 00:26:49 UTC
Version:            (using Devel)
Installed from:    Compiled sources

the default konq location toolbar is missing the X> "clear location toolbar" button, which mildly sucks.

it certainly does not help that one cannot get rid of its label once it is added - i suppose that's the reason why it is not there in the first place. architectural limitation?

fwiw, the "Tips & Tricks" section of the welcome page references that button, which makes its absence even weirder. btw, the page seems to use the wrong icon. whatever.
Comment 1 David Faure 2009-02-10 00:31:07 UTC
The button was removed because it's built into the lineedit nowadays, you see the little black icon at the right of your lineedit, right? ;)

IMHO this is only a "docu" bug in the Tips & Tricks page.
Comment 2 Oswald Buddenhagen 2009-02-10 00:53:06 UTC
Created attachment 31172 [details]
screenshot

actually, i don't - do you?
Comment 3 David Faure 2009-02-10 00:55:54 UTC
Yes I do - http://www.davidfaure.fr/tmp/clearbutton.png
Comment 4 David Faure 2009-02-10 00:58:05 UTC
This comes from setClearButtonShown(true) in KonqComboLineEdit::KonqComboLineEdit.

If this doesn't work, I suggest to look into KLineEdit. Are you using the default KDE style? Maybe the hacks there don't work with some widget styles or with Qt-4.5.

Oh --- and you need to first type something in the lineedit otherwise there is nothing to clear and the clear button disappears :-)
Comment 5 Oswald Buddenhagen 2009-02-10 01:45:23 UTC
i already had both the idea with styles and with the need to enter something first ...

ok, got it. sneaky one: when the toolbar button is enabled, the built-in one is disabled. however, that affects only newly opened windows, so i didn't notice it when playing with the toolbar config. and of course i had enabled the toolbar one in the first place because initially i didn't think of having to type something first and from a kde3 user perspective "it just wasn't there".

so ... for one, the button for the toolbar should be eliminated. as it, it is useless anyway, and it adds to the confusion.

second, i *think* that the disappearing delete button is bad usability (changing ui and such). and it's not like space needs to be saved when the line edit is empty anyway ... so it should be just disabled (designer's property editor has something similar, though for a different purpose).
Comment 6 Germain Garand 2009-02-10 15:59:24 UTC
> ok, got it. sneaky one: when the toolbar button is enabled, the built-in one
> is disabled. however, that affects only newly opened windows, so i didn't
> notice

hmm, I think I wrote this code and I'm pretty sure I made it update lively when you apply your settings, precisely so that it wouldn't be confusing... 

[testing]

right, it seems there's a bug in klinedit that prevents it from updating the clear icon right away if some text is already written in the linedit... removing the text and writing some more makes the icon appear.

the logic looks fine on casual inspection though... gotta looks at that some more.

> so ... for one, the button for the toolbar should be eliminated. as it, it is
> useless anyway, and it adds to the confusion.

I beg to differ as someone who tried very hard to get used to the embedded clear button.

I had constant accessibility problems due to the target being much smaller (14x14) compared to the toolbar button (up to 48x48 - typically 22x22), and just next to the history dropdown button which kept poping on me in the most infuriating manner.

And to top it all, it puts your mouse at the far right in LTR, that is at the opposite point where your input cursor stands - quite disturbing and time consuming.

I think, at least for sloppy hands, the non-embedded clear button remains a killer feature.

> second, i *think* that the disappearing delete button is bad usability
> (changing ui and such). and it's not like space needs to be saved when the 
> line edit is empty anyway ... so it should be just disabled (designer's
> property editor has something similar, though for a different purpose).

couldn't agree more...

Comment 7 David Faure 2009-02-10 17:08:07 UTC
Maybe the clear button in klineedit could be made bigger?

Maybe it could optionally moved to the left side (since it's indeed common to have a very wide combobox in konqueror together with a very short URL, so the current position is quite far from the text)?

Cc'ing Aaron since he wrote the clear button in klineedit.
Comment 8 Angel Blue01 2009-03-06 19:14:10 UTC
I also do have the Cleat button in 4.2.0
Comment 9 Thomas Fischer 2012-12-31 12:16:27 UTC
> right, it seems there's a bug in klinedit that prevents it from
> updating the clear icon right away if some text is already
> written in the linedit... removing the text and writing some
> more makes the icon appear.

The button is still there. If you hover with the mouse, you'll get the tool tip and you can blindly click on it to clear the line edit.
The problem comes from the animation itself (see file klineedit_p.h, KLineEditButton::animateVisible). Initially, the animation's direction is Forward (can be either Forward or Backward). Now, when the button is to be shown, animateVisible(true) is called. In case it was hidden before (by a previous animateVisible(false) call), the direction is Backward and everything works. However, under certain circumstances as observed above, a button may be invisible and the animation direction is still Forward (default value for the QPropertyAnimation object). The function assumes that this is due to calling animateVisible(true) a second time while the animation is in progress and returns immediately (check for the two return statements in this function).
To enforce that the clear button gets properly shown during initialization, I propose some "dirty" marker so that KLineEditButton knows it was freshly initialized. The simplest idea I came up with and which seems to work is to initialize m_opacity with -1 instead of 0 in the constructor.
In animateVisible(bool), the if clause with the return-on-forward is modified to test if m_opacity is not equal -1. Don't worry about this invalid opacity value, the enforced animation will set it to a proper value between 0 and 255.

if (m_opacity != -1 && m_animation->direction() == QPropertyAnimation::Forward) {
    return;
}

This is exactly the same bug I encountered and as reported in bug 294954 (apart from the cast issue I just commented on). Feel free to use the test program attached to report 294954 to experiment on this bug report here.
Someone with permissions can set bug 294954 as duplicate or "depends on" of this bug report here.
Comment 10 Thomas Fischer 2012-12-31 12:17:29 UTC
Created attachment 76113 [details]
Setting m_opacity to -1 to enforce showing the button
Comment 11 Thomas Fischer 2012-12-31 19:20:24 UTC
I am suspecting that this bug report is a duplicate of bug report 268898, which means that this issue is fixed in 4.10 and HEAD.