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;
|
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.
|
* Use Color:background if the string is no valid color.
|
||||||
* This ensures compatibility with LyX 1.4.0 that had the symbolic
|
* This ensures compatibility with LyX 1.4.0 that had the symbolic
|
||||||
* color "none" that was displayed as Color:background.
|
* 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);
|
fillRectangle(x, y, w, h, Color_graphicsbg);
|
||||||
|
|
||||||
QImage image = qlimage.image();
|
QImage image = qlimage.image();
|
||||||
|
|
||||||
QPalette palette = QPalette();
|
if (revert_in_darkmode && guiApp && guiApp->colorCache().isDarkMode())
|
||||||
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())
|
|
||||||
// FIXME this is only a cheap approximation
|
// FIXME this is only a cheap approximation
|
||||||
// Ideally, replace colors as in GuiApplication::prepareForDarkmode()
|
// Ideally, replace colors as in GuiApplication::prepareForDarkmode()
|
||||||
image.invertPixels();
|
image.invertPixels();
|
||||||
|
Loading…
Reference in New Issue
Block a user