Commit c17914bc authored by Cyril Rossi's avatar Cyril Rossi
Browse files

KCM KWinTabbox on defaultsIndicatorsVisibleChanged do not update unmanagedWidgetDefaultState

BUG: 419014
parent 18af4032
......@@ -81,12 +81,12 @@ KWinTabBoxConfig::KWinTabBoxConfig(QWidget* parent, const QVariantList& args)
addConfig(m_data->tabBoxConfig(), m_primaryTabBoxUi);
addConfig(m_data->tabBoxAlternativeConfig(), m_alternativeTabBoxUi);
connect(this, &KWinTabBoxConfig::defaultsIndicatorsVisibleChanged, this, &KWinTabBoxConfig::updateUnmanagedState);
initLayoutLists();
connect(this, &KWinTabBoxConfig::defaultsIndicatorsVisibleChanged, this, &KWinTabBoxConfig::updateDefaultIndicator);
createConnections(m_primaryTabBoxUi);
createConnections(m_alternativeTabBoxUi);
initLayoutLists();
// check focus policy - we don't offer configs for unreasonable focus policies
KConfigGroup config(m_config, "Windows");
QString policy = config.readEntry("FocusPolicy", "ClickToFocus");
......@@ -240,6 +240,15 @@ void KWinTabBoxConfig::updateUnmanagedState()
isDefault &= updateUnmanagedIsDefault(m_alternativeTabBoxUi, m_data->tabBoxAlternativeConfig());
unmanagedWidgetDefaultState(isDefault);
updateDefaultIndicator();
}
void KWinTabBoxConfig::updateDefaultIndicator()
{
const bool visible = defaultsIndicatorsVisible();
updateUiDefaultIndicator(visible, m_primaryTabBoxUi, m_data->tabBoxConfig());
updateUiDefaultIndicator(visible, m_alternativeTabBoxUi, m_data->tabBoxAlternativeConfig());
}
bool KWinTabBoxConfig::updateUnmanagedIsNeedSave(const KWinTabBoxConfigForm *form, const TabBoxSettings *config)
......@@ -259,16 +268,6 @@ bool KWinTabBoxConfig::updateUnmanagedIsNeedSave(const KWinTabBoxConfigForm *for
bool KWinTabBoxConfig::updateUnmanagedIsDefault(KWinTabBoxConfigForm *form, const TabBoxSettings *config)
{
const bool visible = defaultsIndicatorsVisible();
form->setFilterScreenDefaultIndicatorVisible(visible && form->filterScreen() != config->defaultMultiScreenModeValue());
form->setFilterDesktopDefaultIndicatorVisible(visible && form->filterDesktop() != config->defaultDesktopModeValue());
form->setFilterActivitiesDefaultIndicatorVisible(visible && form->filterActivities() != config->defaultActivitiesModeValue());
form->setFilterMinimizationDefaultIndicatorVisible(visible && form->filterMinimization() != config->defaultMinimizedModeValue());
form->setApplicationModeDefaultIndicatorVisible(visible && form->applicationMode() != config->defaultApplicationsModeValue());
form->setShowDesktopModeDefaultIndicatorVisible(visible && form->showDesktopMode() != config->defaultShowDesktopModeValue());
form->setSwitchingModeDefaultIndicatorVisible(visible && form->switchingMode() != config->defaultSwitchingModeValue());
form->setLayoutNameDefaultIndicatorVisible(visible && form->layoutName() != config->defaultLayoutNameValue());
bool isDefault = true;
isDefault &= form->filterScreen() == config->defaultMultiScreenModeValue();
isDefault &= form->filterDesktop() == config->defaultDesktopModeValue();
......@@ -282,6 +281,18 @@ bool KWinTabBoxConfig::updateUnmanagedIsDefault(KWinTabBoxConfigForm *form, cons
return isDefault;
}
void KWinTabBoxConfig::updateUiDefaultIndicator(bool visible, KWinTabBoxConfigForm *form, const TabBoxSettings *config)
{
form->setFilterScreenDefaultIndicatorVisible(visible && form->filterScreen() != config->defaultMultiScreenModeValue());
form->setFilterDesktopDefaultIndicatorVisible(visible && form->filterDesktop() != config->defaultDesktopModeValue());
form->setFilterActivitiesDefaultIndicatorVisible(visible && form->filterActivities() != config->defaultActivitiesModeValue());
form->setFilterMinimizationDefaultIndicatorVisible(visible && form->filterMinimization() != config->defaultMinimizedModeValue());
form->setApplicationModeDefaultIndicatorVisible(visible && form->applicationMode() != config->defaultApplicationsModeValue());
form->setShowDesktopModeDefaultIndicatorVisible(visible && form->showDesktopMode() != config->defaultShowDesktopModeValue());
form->setSwitchingModeDefaultIndicatorVisible(visible && form->switchingMode() != config->defaultSwitchingModeValue());
form->setLayoutNameDefaultIndicatorVisible(visible && form->layoutName() != config->defaultLayoutNameValue());
}
void KWinTabBoxConfig::load()
{
KCModule::load();
......
......@@ -41,6 +41,7 @@ public Q_SLOTS:
private Q_SLOTS:
void updateUnmanagedState();
void updateDefaultIndicator();
void configureEffectClicked();
void slotGHNS();
......@@ -53,6 +54,7 @@ private:
void createConnections(KWinTabBoxConfigForm *form);
bool updateUnmanagedIsNeedSave(const KWinTabBoxConfigForm *form, const TabBox::TabBoxSettings *config);
bool updateUnmanagedIsDefault(KWinTabBoxConfigForm *form, const TabBox::TabBoxSettings *config);
void updateUiDefaultIndicator(bool visible, KWinTabBoxConfigForm *form, const TabBox::TabBoxSettings *config);
private:
KWinTabBoxConfigForm *m_primaryTabBoxUi = nullptr;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment