Bug 138890 - weld::LabelType::Warning uses default white font color on yellow background on dark themes
Summary: weld::LabelType::Warning uses default white font color on yellow background o...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: An-Kh
URL:
Whiteboard: target:7.2.0
Keywords:
Depends on:
Blocks: UI-Theming
  Show dependency treegraph
 
Reported: 2020-12-14 10:49 UTC by Heiko Tietze
Modified: 2021-01-19 07:52 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Screenshot (34.78 KB, image/png)
2020-12-14 10:49 UTC, Heiko Tietze
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Heiko Tietze 2020-12-14 10:49:08 UTC
Created attachment 168144 [details]
Screenshot

Follow-up to bug 134779. Test with Table > Insert and col>63. 

Version: 7.2.0.0.alpha0+
Build ID: 07f7afec7832b0d45bef8d883eb3587d06c4673a
CPU threads: 8; OS: Linux 5.9; UI render: default; VCL: kf5
Locale: de-DE (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 1 Caolán McNamara 2020-12-15 14:56:47 UTC
SalInstanceEntry::set_message_type is probably what's needed to change here. Though what the solution should be is uncertain.
Comment 2 Heiko Tietze 2020-12-15 15:45:07 UTC
(In reply to Caolán McNamara from comment #1)
> SalInstanceEntry::set_message_type is probably what's needed to change here.
> Though what the solution should be is uncertain.

Even further at m_xEntry->SetControlForeground(); - it uses COL_TRANSPARENT.
Comment 3 An-Kh 2020-12-29 08:41:06 UTC
I can't reproduce it on Windows..
I went to Tools -> Options and chose a dark theme..
But I saw black text on yellow background in the InsertTable dialog box..
Comment 4 An-Kh 2020-12-30 08:05:39 UTC
Please tell if there is some other way to reproduce.. I might be missing something..
Comment 5 Heiko Tietze 2021-01-04 11:05:23 UTC
(In reply to An-Kh from comment #3)
> I went to Tools -> Options and chose a dark theme..

You need to make Windows dark. See https://www.howtogeek.com/222614/how-to-enable-windows-10s-hidden-dark-theme/ (just the first search result).
Comment 6 An-Kh 2021-01-07 09:33:31 UTC
Hi

Please have a look at the following patch :

https://gerrit.libreoffice.org/c/core/+/108929
Comment 7 Prince Singh Tomar 2021-01-07 11:03:45 UTC
Hi
you can also add in 
line 13243 of file vcl/unx/gtk3/gtk3gtkinst.cxx you can add :

set_text_foreground_color(COL_BLUE,true);

This will handle any other situation where text color is while anywhere this label is used, and if text color is defined like in your patch that defined color will be used.
Comment 8 An-Kh 2021-01-07 17:48:50 UTC
(In reply to Caolán McNamara from comment #1)
> SalInstanceEntry::set_message_type is probably what's needed to change here.
> Though what the solution should be is uncertain.

Hi

Currently, set_message_type(weld::EntryMessageType::Warning) is being used..
Could you please suggest something else instead of this..

Also, I was thinking that whenever in any code, if set_message_type(weld::EntryMessageType::Warning) is used, this problem will arise.. 

set_message_type(weld::EntryMessageType::Warning) mostly uses yellow background (as far as high contrast and low contrast are tested).. The problem is with the color of the text displayed on it.. I was thinking to universally change the color of the text displayed if this command is given.. Let me know your thoughts on it :)
Comment 9 Caolán McNamara 2021-01-15 16:24:44 UTC
(In reply to An-Kh from comment #8)
> (In reply to Caolán McNamara from comment #1)
> > SalInstanceEntry::set_message_type is probably what's needed to change here.
> > Though what the solution should be is uncertain.
> 
> Hi
> 
> Currently, set_message_type(weld::EntryMessageType::Warning) is being used..
> Could you please suggest something else instead of this.

I meant that SalInstanceEntry::set_message_type is the place to find to change to do what you want, which seems to be what you have now done. I didn't mean to suggest to change the call of set_message_type to call something else. Your submitted patch looks reasonable to me.
Comment 10 Commit Notification 2021-01-19 07:52:56 UTC
Anshu committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/474398937b5d53d5c7ab30a877f8b663e6963b02

tdf#138890 : weld::LabelType::Warning font color in dark themes

It will be available in 7.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.