When printing a document from the Print Preview window, the text is printed in light gray. Immediately printing the same document without closing or reloading, prints in black as it should.
The print preview is white background with light gray text. I'm using the Breeze Dark Schema in both Kate and the desktop.
I can confirm this behavior to a certain extent. I've also noticed that the Print Preview in Kate shows gray text on a white background. When you print it from there, I can confirm that it prints with gray text. When you print the document with the normal print dialog it's printed with black text on the white paper.
I think this may be caused by the usage of color schema in Kate. My default color schema is set to Breeze Dark but the normal print dialog shows that this schema is overridden with the "Printing" schema (under Options > Layout). This seems correct behavior as it causes the text to be printed correctly. But it seems like this schema isn't applied in the Print Preview. When you print from the Print Preview page, the print dialog doesn't show the Layout tab containing the color schema, as in the normal print dialog.
The problem here seems to be that the print dialog from the preview is intended to print exactly as shown in the Print Preview and limits the options to ensure that. But the color schema for printing isn't applied to this preview, and there is no option to change this.
Additionally, it seems like the Print Preview doesn't use the background color defined in the schema. This may be correct, since this background is defined as "Editor Background Colors" so they may only apply to the editor. However, the print dialog also has an option to print the background color (off by default) so it may still be able to print this background color. In this case, it may be good to show this in the print preview as well.
* Configure Kate to use "Breeze Dark" as default color schema (Editor Component > Fonts & Colors).
* Open the Print dialog (File > Print...), click on Options >> and go to the Layout tab. Make sure that the schema is set to "Printing"
* Write some text in the document and open the Print Preview
* The Print Preview shows the text in the color of the "Breeze Dark" color schema (instead of the "Printing" color schema defined for printing)
* Click the Print button from the Print Preview and click on Options >>. Confirm that there is no Layout tab containing an option for the color schema.
* Print the document and notice that it prints the text in gray.
This would be a bug in Qt upstream, as kate uses qprintpreviewdialog.
Please file a bug upstream at https://bugreports.qt.io
It would need a minimal test case to confirm the issue is in Qt. It could as well be a bug in Kate, treating colors differently on print preview and actual printing.
Fair enough, I'll see if I can reproduce it.
Thanks for the hint/nudge; turns out it's a bug in ktexteditor.
Git commit 28e59740d07070144ee677af2dcc14fd339e13cb by Dominik Haumann, on behalf of Ahmad Samir.
Committed on 05/02/2019 at 12:25.
Pushed by dhaumann into branch 'master'.
Set the color scheme to Printing for Print Preview
Otherwise the print preview dialog somehow gets the text color from the
current default color scheme; also the user can't change the color scheme
either from the print preview dialog or the "print" dialog launched from
the preview dialog.
- Change the default color scheme in kate to a dark one, e.g. Breeze dark
- Open the print preview dialog, note that the text color is the one used
in the breeze dark scheme, but the background color is still white
Apply the diff, now the print preview dialog should be using the Printing
color scheme as expected.
Reviewers: cullmann, #ktexteditor, dhaumann, mwolff
Reviewed By: #ktexteditor, dhaumann, mwolff
Subscribers: kwrite-devel, kde-frameworks-devel
Tags: #kate, #frameworks
Differential Revision: https://phabricator.kde.org/D18163
M +9 -0 src/printing/kateprinter.cpp
*** Bug 376270 has been marked as a duplicate of this bug. ***