Bug 148188 - hardcoded white background despite accesibility colors
Summary: hardcoded white background despite accesibility colors
Status: RESOLVED FIXED
Alias: None
Product: kpdf
Classification: Unmaintained
Component: general (show other bugs)
Version: unspecified
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: Albert Astals Cid
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-25 09:21 UTC by domel
Modified: 2007-07-25 11:02 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description domel 2007-07-25 09:21:01 UTC
Version:            (using KDE KDE 3.5.7)
Installed from:    Debian testing/unstable Packages
OS:                Linux

KPDF has hardcoded white background while loading pages or thumbnails. I have my system set up (in Control Center) to use white fonts on dark background, and accordingly, I have enabled Kpdf's Accesibility (invert colors) settings. This seems to do what is expected, except for very aggressive white flashes I get in my eyes while quickly scrolling throug a document (e.g. using pagedown key). A page is displayed white while it is being rendered. I consider this a bug, as 1) it does not (fully) conform to the system settings 2) it causes very high strain for eyes otherwise used to dark environment. The same goes for thumbnails background, but is less critical.
Comment 1 Pino Toscano 2007-07-25 11:02:41 UTC
SVN commit 692291 by pino:

Take into account the accessibility settings when drawing an empty page waiting for the real page to be rendered.

BUG: 148188


 M  +18 -5     pagepainter.cpp  


--- branches/KDE/3.5/kdegraphics/kpdf/ui/pagepainter.cpp #692290:692291
@@ -49,11 +49,24 @@
     // if have no pixmap, draw blank page with gray cross and exit
     if ( !pixmap )
     {
-        if ( KpdfSettings::changeColors() &&
-             KpdfSettings::renderMode() == KpdfSettings::EnumRenderMode::Paper )
-            destPainter->fillRect( limits, KpdfSettings::paperColor() );
-        else
-            destPainter->fillRect( limits, Qt::white );
+        QColor color = Qt::white;
+        if ( KpdfSettings::changeColors() )
+        {
+            switch ( KpdfSettings::renderMode() )
+            {
+                case KpdfSettings::EnumRenderMode::Inverted:
+                    color = Qt::black;
+                    break;
+                case KpdfSettings::EnumRenderMode::Paper:
+                    color = KpdfSettings::paperColor();
+                    break;
+                case KpdfSettings::EnumRenderMode::Recolor:
+                    color = KpdfSettings::recolorBackground();
+                    break;
+                default: ;
+            }
+        }
+        destPainter->fillRect( limits, color );
 
         // draw a cross (to  that the pixmap as not yet been loaded)
         // helps a lot on pages that take much to render