Bug 58161 - UI: White Paragraph style invisible in Styles Drop-Down
Summary: UI: White Paragraph style invisible in Styles Drop-Down
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.0.0.0.alpha0+ Master
Hardware: All All
: medium normal
Assignee: Juergen Funk (CIB)
URL:
Whiteboard: target:4.4.0
Keywords: difficultyBeginner, easyHack, skillCpp, topicUI
Depends on:
Blocks: Writer-Styles-Paragraph-Combobox
  Show dependency treegraph
 
Reported: 2012-12-11 20:41 UTC by Samuel Mehrbrodt (allotropia)
Modified: 2018-04-10 09:41 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Samuel Mehrbrodt (allotropia) 2012-12-11 20:41:19 UTC
When creating a paragraph style with a white font and without a background color, the Style is invisible in the Styles Drop-Down Combobox.

Reproduce: 
1. Create a paragraph style with a white text color.
2. Use the style in the document
3. It's invisible in the Styles Drop-Down

What's the best way to do in that case?
Comment 1 Stefan Knorr (astron) 2012-12-12 10:08:13 UTC
Confirming on 4.1.0.0.alpha0+ (Build ID: f00b77c856067b77a6dc5c2d90cc1205d87de03), Linux.

Possible solutions:

* displaying white font colour as black (removes some of the advantages of the
  drop-down and might confuse people when they actually apply the style)
* making sure the transparent background is visible – e.g. using a chequerboard
  pattern (would look pretty ugly on the majority of styles [i.e. those using
  black fonts])

..?

(Adding Kendy to CC, and setting severity minor => normal)
Comment 2 Jan Holesovsky 2014-03-24 11:07:59 UTC
Astron: So what about to use gray background or some hatches or anything in case the font color is white? :-)  Just for those entries with white font, and no background coolor...

Either way, this is an Easy Hack.  The code to get the font color is here:

http://cgit.freedesktop.org/libreoffice/core/tree/svx/source/tbxctrls/tbcontrl.cxx#n652

You want to update the code introduced here:

http://cgit.freedesktop.org/libreoffice/core/commit/?id=d44914633ac1b52691cf7c33d1dea2115df6e109

to do the hatching / checkboard / anything in case the font color is the same as the background color.
Comment 3 Juergen Funk (CIB) 2014-09-24 11:26:22 UTC
I fix the bug (windows), testing under Linux and then will commit.

But i not sure what is meaning with
   You want to update the code introduced here:

    http://cgit.freedesktop.org/libreoffice/core/commit/?id=d44914633ac1b52691cf7c33d1dea2115df6e109

can commit normal, or must be with --amend to this patch?
Comment 4 Samuel Mehrbrodt (allotropia) 2014-09-24 11:28:21 UTC
(In reply to comment #3)
> can commit normal, or must be with --amend to this patch?

No, we don't change commits that have been pushed to master. Just create a new commit and push to gerrit.
Comment 5 Juergen Funk (CIB) 2014-09-30 13:36:43 UTC
Fixed: https://gerrit.libreoffice.org/#/c/11716/


Use the Color-Class-function "IsDark" and "IsBright" for decision to make a change of the font-color with DecreaseContrast or DecreaseLuminance.
Only in the Styles Drop-Down
 
The main problem was under Linux i have use the function "GetDisplayBackground()" this works under windows when i have change the background, but under Linux i get a grey color not white. 
I have made a lot of test with a testprogram and the color-test made in Word (was easier for testing), i think in the most cases it works.
Tested with colors R=G=B:
0		Change with DecreaseContrast (diffcult to see)
32		Change with DecreaseContrast (diffcult to see)
64		Change with DecreaseContrast
128		Change with DecreaseLuminance
160		Change with DecreaseContrast (diffcult to see)
192		Change with DecreaseContrast
255		Change with DecreaseContrast
Under Windows with swriter i have test with 0, 128, 192, 255  
 
Other question why is the Drop-Down-Box so small, i think it should be dynamically resize of the content -> other Bug?
Comment 6 Commit Notification 2014-09-30 14:10:08 UTC
Juergen Funk committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=bda9193e7bb7c1315e79b904bff3c42abd81159f

Fix fdo#58161 UI: White Paragraph style invisible in Styles Drop-Down



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 7 Robinson Tryon (qubit) 2015-12-15 23:22:58 UTC
Migrating Whiteboard tags to Keywords: (EasyHack DifficultyEasy SkillCpp TopicUI )
[NinjaEdit]
Comment 8 Björn Michaelsen 2016-02-05 11:10:48 UTC
difficultyEasy -> difficultyBeginner. The former never really existed and only makes the EasyHack not appear on the wiki.