Show that the app busy when switching a style.

This commit is contained in:
Roman Telezhynskyi 2023-08-13 17:02:27 +03:00
parent 7f332548c2
commit fef65aeeca
4 changed files with 10 additions and 0 deletions

View File

@ -121,6 +121,7 @@ auto PuzzlePreferencesConfigurationPage::Apply() -> QStringList
auto themeMode = static_cast<VThemeMode>(ui->comboBoxThemeMode->currentData().toInt()); auto themeMode = static_cast<VThemeMode>(ui->comboBoxThemeMode->currentData().toInt());
if (settings->GetThemeMode() != themeMode) if (settings->GetThemeMode() != themeMode)
{ {
QGuiApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0) #if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
if (themeMode == VThemeMode::System && VTheme::NativeDarkThemeAvailable()) if (themeMode == VThemeMode::System && VTheme::NativeDarkThemeAvailable())
{ {
@ -140,6 +141,7 @@ auto PuzzlePreferencesConfigurationPage::Apply() -> QStringList
settings->SetThemeMode(themeMode); settings->SetThemeMode(themeMode);
VTheme::Instance()->ResetThemeSettings(); VTheme::Instance()->ResetThemeSettings();
QGuiApplication::restoreOverrideCursor();
} }
if (settings->IsDontUseNativeDialog() != ui->checkBoxDontUseNativeDialog->isChecked()) if (settings->IsDontUseNativeDialog() != ui->checkBoxDontUseNativeDialog->isChecked())

View File

@ -125,6 +125,7 @@ auto TapePreferencesConfigurationPage::Apply() -> QStringList
auto themeMode = static_cast<VThemeMode>(ui->comboBoxThemeMode->currentData().toInt()); auto themeMode = static_cast<VThemeMode>(ui->comboBoxThemeMode->currentData().toInt());
if (settings->GetThemeMode() != themeMode) if (settings->GetThemeMode() != themeMode)
{ {
QGuiApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0) #if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
if (themeMode == VThemeMode::System && VTheme::NativeDarkThemeAvailable()) if (themeMode == VThemeMode::System && VTheme::NativeDarkThemeAvailable())
{ {
@ -144,6 +145,7 @@ auto TapePreferencesConfigurationPage::Apply() -> QStringList
settings->SetThemeMode(themeMode); settings->SetThemeMode(themeMode);
VTheme::Instance()->ResetThemeSettings(); VTheme::Instance()->ResetThemeSettings();
QGuiApplication::restoreOverrideCursor();
} }
if (settings->IsDontUseNativeDialog() != ui->checkBoxDontUseNativeDialog->isChecked()) if (settings->IsDontUseNativeDialog() != ui->checkBoxDontUseNativeDialog->isChecked())

View File

@ -199,6 +199,7 @@ auto PreferencesConfigurationPage::Apply() -> QStringList
auto themeMode = static_cast<VThemeMode>(ui->comboBoxThemeMode->currentData().toInt()); auto themeMode = static_cast<VThemeMode>(ui->comboBoxThemeMode->currentData().toInt());
if (settings->GetThemeMode() != themeMode) if (settings->GetThemeMode() != themeMode)
{ {
QGuiApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0) #if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
if (themeMode == VThemeMode::System && VTheme::NativeDarkThemeAvailable()) if (themeMode == VThemeMode::System && VTheme::NativeDarkThemeAvailable())
{ {
@ -218,6 +219,7 @@ auto PreferencesConfigurationPage::Apply() -> QStringList
settings->SetThemeMode(themeMode); settings->SetThemeMode(themeMode);
VTheme::Instance()->ResetThemeSettings(); VTheme::Instance()->ResetThemeSettings();
QGuiApplication::restoreOverrideCursor();
} }
if (settings->IsDontUseNativeDialog() != ui->checkBoxDontUseNativeDialog->isChecked()) if (settings->IsDontUseNativeDialog() != ui->checkBoxDontUseNativeDialog->isChecked())

View File

@ -604,6 +604,7 @@ VTheme::VTheme(QObject *parent)
} }
isProcessingColorSchemeChange = true; isProcessingColorSchemeChange = true;
QGuiApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
VCommonSettings *settings = VAbstractApplication::VApp()->Settings(); VCommonSettings *settings = VAbstractApplication::VApp()->Settings();
VThemeMode themeMode = settings->GetThemeMode(); VThemeMode themeMode = settings->GetThemeMode();
@ -624,6 +625,7 @@ VTheme::VTheme(QObject *parent)
} }
ResetThemeSettings(); ResetThemeSettings();
QGuiApplication::restoreOverrideCursor();
isProcessingColorSchemeChange = false; isProcessingColorSchemeChange = false;
}; };
@ -645,6 +647,7 @@ VTheme::VTheme(QObject *parent)
} }
isProcessingColorSchemeChange = true; isProcessingColorSchemeChange = true;
QGuiApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
bool darkTheme = IsInDarkTheme(); bool darkTheme = IsInDarkTheme();
if (m_darkTheme != darkTheme) if (m_darkTheme != darkTheme)
@ -653,6 +656,7 @@ VTheme::VTheme(QObject *parent)
ResetThemeSettings(); ResetThemeSettings();
} }
QGuiApplication::restoreOverrideCursor();
isProcessingColorSchemeChange = false; isProcessingColorSchemeChange = false;
}; };