mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-03 08:28:25 +00:00
#12451 Adjust color cache on change of dark/light mode
This commit is contained in:
parent
d44c63e2c6
commit
d9b9307d14
@ -2322,6 +2322,12 @@ void GuiApplication::onLocaleChanged()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void GuiApplication::onPaletteChanged()
|
||||||
|
{
|
||||||
|
colorCache().setPalette(palette());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void GuiApplication::handleKeyFunc(FuncCode action)
|
void GuiApplication::handleKeyFunc(FuncCode action)
|
||||||
{
|
{
|
||||||
char_type c = 0;
|
char_type c = 0;
|
||||||
@ -2977,6 +2983,11 @@ bool GuiApplication::event(QEvent * e)
|
|||||||
e->accept();
|
e->accept();
|
||||||
return true;
|
return true;
|
||||||
#endif
|
#endif
|
||||||
|
case QEvent::ApplicationPaletteChange: {
|
||||||
|
// runtime switch from/to dark mode
|
||||||
|
onPaletteChanged();
|
||||||
|
return QApplication::event(e);
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
return QApplication::event(e);
|
return QApplication::event(e);
|
||||||
}
|
}
|
||||||
|
@ -230,6 +230,8 @@ private Q_SLOTS:
|
|||||||
///
|
///
|
||||||
void onLocaleChanged();
|
void onLocaleChanged();
|
||||||
///
|
///
|
||||||
|
void onPaletteChanged();
|
||||||
|
///
|
||||||
void slotProcessFuncRequestQueue() { processFuncRequestQueue(); }
|
void slotProcessFuncRequestQueue() { processFuncRequestQueue(); }
|
||||||
///
|
///
|
||||||
#if (QT_VERSION >= 0x050100)
|
#if (QT_VERSION >= 0x050100)
|
||||||
|
Loading…
Reference in New Issue
Block a user