mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-26 11:16:55 +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.
|
||||
|
@ -243,11 +243,7 @@ void GuiPainter::image(int x, int y, int w, int h, graphics::Image const & i,
|
||||
|
||||
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