]> git.lyx.org Git - lyx.git/commitdiff
Remove alpha component of system colors
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 22 Jul 2024 18:36:20 +0000 (20:36 +0200)
committerRichard Kimberly Heck <rikiheck@lyx.org>
Mon, 22 Jul 2024 19:55:46 +0000 (15:55 -0400)
When using system colors it may happen (on windows 11 in particular)
that the background color is actually translucid. This is not
something we are prepared to handle and it creates ghosts on screen.

The fix is easy: the alpha channel of the colors is set to 255.

Fixes bug #13084.

(cherry picked from commit 095bb18331f8eb4653691a64520d89d4a2d60fc4)

src/frontends/qt/ColorCache.cpp
status.24x

index 1c3d68e548ac0a96fd771e303d7f50b0c8e8ca63..2566b750257dfa6697d216c714dc24f07cc13a71 100644 (file)
@@ -86,7 +86,9 @@ QColor ColorCache::get(Color const & color, bool syscolors) const
                QPalette::ColorRole const cr = role(color.baseColor);
                if (syscolors && cr != QPalette::NoRole) {
                        static QColor const white = Qt::white;
-                       QColor const c = pal_.brush(QPalette::Active, cr).color();
+                       QColor c = pal_.brush(QPalette::Active, cr).color();
+                       // Change to fully opaque color
+                       c.setAlpha(255);
                        if (cr == QPalette::Base && c == white)
                                return lcolors_[color.baseColor];
                        else
index 7e4886fea369c259b98c06cc946ab9e42039b1ba..72f4335f6052ec5a91dbe3dc8ceb94173a139cf0 100644 (file)
@@ -67,6 +67,8 @@ What's new
 - Enable OK/Apply button in tabular dialog when "Additional Space" combo has
   been set to different value.
 
+- Fix ghost image on Windows with system colors (bug 13084).
+
 
 * INTERNALS