mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-29 15:26:05 +00:00
Use isDarkMode() method
This commit is contained in:
parent
3259f3c73e
commit
29f98ab245
@ -63,7 +63,7 @@ public:
|
||||
///
|
||||
std::string const & color() const;
|
||||
/**
|
||||
* Set color from a string "#rrggbb".
|
||||
* Set color from a hexcolor string "#rrggbb" or a lyx color name.
|
||||
* Use Color:background if the string is no valid color.
|
||||
* This ensures compatibility with LyX 1.4.0 that had the symbolic
|
||||
* color "none" that was displayed as Color:background.
|
||||
|
@ -242,12 +242,8 @@ void GuiPainter::image(int x, int y, int w, int h, graphics::Image const & i,
|
||||
fillRectangle(x, y, w, h, Color_graphicsbg);
|
||||
|
||||
QImage image = qlimage.image();
|
||||
|
||||
QPalette palette = QPalette();
|
||||
QColor text_color = palette.color(QPalette::Active, QPalette::WindowText);
|
||||
QColor bg_color = palette.color(QPalette::Active, QPalette::Window);
|
||||
// guess whether we are in dark mode
|
||||
if (revert_in_darkmode && text_color.black() < bg_color.black())
|
||||
|
||||
if (revert_in_darkmode && guiApp && guiApp->colorCache().isDarkMode())
|
||||
// FIXME this is only a cheap approximation
|
||||
// Ideally, replace colors as in GuiApplication::prepareForDarkmode()
|
||||
image.invertPixels();
|
||||
|
Loading…
Reference in New Issue
Block a user