Bug 253022 - Too scarce contrast in Dolphin resources bar.
Summary: Too scarce contrast in Dolphin resources bar.
Status: RESOLVED FIXED
Alias: None
Product: kfile
Classification: Applications
Component: kfileplacesview (show other bugs)
Version: unspecified
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
: 254452 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-10-02 14:24 UTC by Diego
Modified: 2010-11-12 14:15 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.5.3


Attachments
Image showing the text color is too light. (5.20 KB, image/png)
2010-10-02 14:24 UTC, Diego
Details
Kopete scarce contrast example. (7.26 KB, image/png)
2010-10-10 21:02 UTC, Diego
Details
Selection bug in Desktop Settings (122.59 KB, image/png)
2010-11-12 10:07 UTC, Nikita Churaev
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Diego 2010-10-02 14:24:27 UTC
Created attachment 52164 [details]
Image showing the text color is too light.

Version:           unspecified (using KDE 4.5.1) 
OS:                Linux

The selected item in the "Places" panel has too scarce contrast, the white text is not really readable. This is the default Oxygen color set.

Reproducible: Always

Steps to Reproduce:
Open Dolphin and look at the default text color of the selected item

Actual Results:  
The text is barely readable.

Expected Results:  
The text is clearly readable.
Comment 1 Hugo Pereira Da Costa 2010-10-02 19:30:13 UTC
I agree with the observation, but I'm not sure what's the best way to fix. 

- Change the "selected text" color to black in the default kde oxygen palette ?
(I personally do that in my kde version)

- reduce the "selection" gradient (that would be programatically) by making the top color closer to the bottom ? 

- change the "selection" color to something darker ? 

Nuno: any advice ?
Comment 2 Diego 2010-10-03 12:07:02 UTC
(In reply to comment #1)
> I agree with the observation, but I'm not sure what's the best way to fix. 
> 
> - Change the "selected text" color to black in the default kde oxygen palette ?
> (I personally do that in my kde version)
> 
> - reduce the "selection" gradient (that would be programatically) by making the
> top color closer to the bottom ? 
> 
> - change the "selection" color to something darker ? 
> 
> Nuno: any advice ?

I'm not Nuno, but I'll tell my opinion. :)

Take a look at a selected folder in Dolphin: the folder name color changes from black to white too when you select a folder (same for files). In this case the text is readable because the background is darker than the selection in the "Places" panel.
I'd keep text color the same between the two "selected" cases, and I'd adapt the selection background accordingly (darker for the panel).
How does it look like with the same background color in the two cases? Wasn't it that way some time ago?
http://www.kde.org/announcements/4.1/screenshots/dolphin-tagging.png
Comment 3 Hugo Pereira Da Costa 2010-10-04 18:41:56 UTC
As far as I know, the same color(s) are used for the main view and the side panels.
But there are different color settings depending on whether the widget is active, focused, inactive, hovered, etc. And the color combination does not work in some cases.
See: e.g. http://simplest-image-hosting.net/png-0-factory10
This works. 
But only because the side panel has focus.
Note how the main view color is lighter, cause it does not have focus.
If you click on the main view, the focus move, the panel loses it, and the color gets lighter, which is the issue you refer to.
At least thats my understanding.
Comment 4 Diego 2010-10-10 20:58:56 UTC
The more I use the 4.5 series, the more I find this problem quite serious. It happens also in other apps, and it can make text really unreadable.

I'd go for using black text in 4.5.3 and on, until you find a more proper solution for the 4.6 series.
Comment 5 Diego 2010-10-10 21:02:31 UTC
Created attachment 52397 [details]
Kopete scarce contrast example.

This is an example of how much unreadable the text can get with default settings.
Comment 6 Hugo Pereira Da Costa 2010-10-11 02:57:00 UTC
... yes. Agreed. Unreadable. 

Sorry for the trouble. We will work on finding away (hopefully before kde4.6).
It might be 'use white for selected text color' in the default palette, though that would not be too satisfactory ...
Comment 7 Hugo Pereira Da Costa 2010-10-12 23:55:12 UTC
ok. I have some investigation for you to do !
First question is simple:
Can you reproduce this poor contrast in for instance "systemsettings" ? 
Or in konversation ? 

My observation here is that for the applications above (and many more), the text foreground is white only when 
- item is selected 
- _and_ window is active
In all other cases (hover, or inactive window) the text color turns to black, and there is not contrast issue. 

Is this also your observation ? Or can you trigger some cases where the poor contrast is also visible in systemsettings ? 

(I guess at that point you might have some idea what I am heading to, but lets see your observation first).
Comment 8 Diego 2010-10-14 13:41:34 UTC
(In reply to comment #7)
> ok. I have some investigation for you to do !

I'll get to my home PC this weekend, please wait for a couple of days.
Comment 9 Hugo Pereira Da Costa 2010-10-14 16:30:35 UTC
On Thursday, October 14, 2010 05:41:36 am Diego wrote:
> https://bugs.kde.org/show_bug.cgi?id=253022
> 
> 
> 
> 
> 
> --- Comment #8 from Diego <panda84 inwind it>  2010-10-14 13:41:34 ---
> (In reply to comment #7)
> 
> > ok. I have some investigation for you to do !
> 
> I'll get to my home PC this weekend, please wait for a couple of days.
Sure. I'm not closing the report anyway. Keep me posted :)
Comment 10 Diego 2010-10-15 22:01:28 UTC
(In reply to comment #7)
> ok. I have some investigation for you to do !
> First question is simple:
> Can you reproduce this poor contrast in for instance "systemsettings" ? 
> Or in konversation ? 
> 
> My observation here is that for the applications above (and many more), the
> text foreground is white only when 
> - item is selected 
> - _and_ window is active
> In all other cases (hover, or inactive window) the text color turns to black,
> and there is not contrast issue. 
> 
> Is this also your observation ? Or can you trigger some cases where the poor
> contrast is also visible in systemsettings ? 
> 
> (I guess at that point you might have some idea what I am heading to, but lets
> see your observation first).

I can confirm all your observations, and I cannot reproduce in systemsettings. I think you got the point! :)

P.S.: thank you for your hard work!
Comment 11 Hugo Pereira Da Costa 2010-10-15 22:15:06 UTC
All right. So I think its not an oxygen bug, but a dolphin bug (and kopete). 
Possibly a kdelibs/kdeui bug. Will reassign.
Comment 12 Christoph Feck 2010-10-16 02:11:08 UTC
The bug is not only in KFilePlacesView, but in many other views that have custom item delegates that render selected items. The issue is that Qt does not set the colorGroup of the option.palette, so you have to use the following code to get the colorGroup manually:

    QPalette::ColorGroup cg = QPalette::Active;
    if (!(option.state & QStyle::State_Enabled)) {
        cg = QPalette::Disabled;
    } else if (!(option.state & QStyle::State_Active)) {
        cg = QPalette::Inactive;
    }

Then you can do a call like

    if (option.state & QStyle::State_Selected) {
        painter->setPen(option.palette.color(cg, QPalette::HighlightedText);
    }

to set the correct text color for selected items.

The following commit will fix it for KFilePlacesView and KFileItemDelegate.
Comment 13 Christoph Feck 2010-10-16 02:18:11 UTC
SVN commit 1186358 by cfeck:

Use correct colorGroup for item text (backport r1186357)

BUG: 253022
FIXED-IN: 4.5.3


 M  +7 -1      kfile/kfileplacesview.cpp  
 M  +9 -2      kio/kio/kfileitemdelegate.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1186358
Comment 14 Diego 2010-10-16 11:22:10 UTC
*** Bug 254309 has been marked as a duplicate of this bug. ***
Comment 15 Christoph Feck 2010-10-18 03:04:45 UTC
*** Bug 254452 has been marked as a duplicate of this bug. ***
Comment 16 Nikita Churaev 2010-11-12 10:07:04 UTC
Created attachment 53353 [details]
Selection bug in Desktop Settings
Comment 17 Nikita Churaev 2010-11-12 10:07:33 UTC
This bug is still present in Desktop Settings wallpaper selection menu
Comment 18 Nikita Churaev 2010-11-12 10:37:35 UTC
Also still present in Kopete
Comment 19 Diego 2010-11-12 14:15:03 UTC
(In reply to comment #18)
> Also still present in Kopete

For Kopete see bug #254309 , for the desktop settings wallpaper selection please file a separate bug (put a reference to this bug so that developers already have an hint on how to fix the problem), thanks.