}
case QEvent::ApplicationPaletteChange: {
- // runtime switch from/to dark mode
+ // runtime switch from/to dark mode (Mac OS)
+ // We need to update metrics here to avoid a crash (#12786)
+ theBufferList().changed(true);
refillToolbars();
return QMainWindow::event(e);
}
return QMainWindow::event(e);
}
+ case QEvent::StyleChange: {
+ // This might be a change from dark to light mode (Linux)
+ // We need to update metrics here to avoid a crash (#12786)
+ theBufferList().changed(true);
+ return QMainWindow::event(e);
+ }
+
default:
return QMainWindow::event(e);
}