Bug 487081 - Dark theme, Print Preview shows empty, prints white text on white background.
Summary: Dark theme, Print Preview shows empty, prints white text on white background.
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: kwrite (show other bugs)
Version: 24.02.2
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
: 488046 490734 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-05-16 03:52 UTC by Sin Jeong-hun
Modified: 2024-09-13 18:35 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Wrote "Hello" and printed it to a PDF file. (5.47 KB, application/pdf)
2024-05-16 03:52 UTC, Sin Jeong-hun
Details
Recorded video demonstrating the issue (1.02 MB, video/webm)
2024-06-08 18:00 UTC, fox
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sin Jeong-hun 2024-05-16 03:52:37 UTC
Created attachment 169521 [details]
Wrote "Hello" and printed it to a PDF file.

SUMMARY

When Plasma is using dark theme, selecting File -> Print/Export -> Print Preview seems to change the theme of the editor view to "Printing". The editor shows black text on white background, but the preview dialogue itself is using white text on white background; I see nothing. 

I clicked the print button and chose PDF. The PDF looked empty. When I tried text selection tool, it seemed that I could select something. I copied it and pasted it into a text editor, and the text was there. So, the PDF is using white text on white background.

Isn't it a bug that invoking the print preview changes the editor's theme? I have to change it back, which is cumbersome. The preview is showing in a separate pop-up window, so I am not sure if it is necessary to change the editor's theme. At least shouldn't KWrite change editor's theme back when the preview window is closed?

Also it seems that on a monitor with fractional scaling, the window size of print preview is very small and I have to resize it every time.

Both Kate/KWrite seem to do exactly the same thing.


STEPS TO REPRODUCE
1.  Set dark mode for Plasma, and a dark theme for the editor
2.  Print Preview
3. Print to PDF 

OBSERVED RESULT
White text on paper

EXPECTED RESULT
Black text on paper

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: Arch Linux, Wayland
(available in About System)
KDE Plasma Version: 6.0.4
KDE Frameworks Version: 6.2.0
Qt Version: 6.7.0

ADDITIONAL INFORMATION
Attaching the printed PDF page. It has "Hello" on it.
Comment 1 fox 2024-06-08 17:56:58 UTC
*** Bug 488046 has been marked as a duplicate of this bug. ***
Comment 2 fox 2024-06-08 18:00:48 UTC
Created attachment 170276 [details]
Recorded video demonstrating the issue

Kate 24.05.0
Wayland
Plasma 6.0.5
Frameworks 6.2.0
Qt 6.7.1
Kernel Version: 6.9.3-3-cachyos (64-bit)
Artix Linux, runit init
Comment 3 Paul Worrall 2024-07-24 07:23:10 UTC
*** Bug 490734 has been marked as a duplicate of this bug. ***
Comment 4 Christoph Cullmann 2024-09-13 18:35:44 UTC
Git commit 786fc1c139e56d9e143b1a9a707e28527f1eafd1 by Christoph Cullmann.
Committed on 13/09/2024 at 18:35.
Pushed by cullmann into branch 'master'.

ensure modify the renderer that is used for printing

instead of altering the renderer of the view we do want to
print
Related: bug 465526, bug 488605, bug 483550

M  +7    -7    src/printing/printpainter.cpp

https://invent.kde.org/frameworks/ktexteditor/-/commit/786fc1c139e56d9e143b1a9a707e28527f1eafd1