KCM KWinTabbox on defaultsIndicatorsVisibleChanged do not update unmanagedWidgetDefaultState
BUG: 419014
This commit is contained in:
parent
18af4032e4
commit
c17914bc66
2 changed files with 26 additions and 13 deletions
|
@ -81,12 +81,12 @@ KWinTabBoxConfig::KWinTabBoxConfig(QWidget* parent, const QVariantList& args)
|
||||||
addConfig(m_data->tabBoxConfig(), m_primaryTabBoxUi);
|
addConfig(m_data->tabBoxConfig(), m_primaryTabBoxUi);
|
||||||
addConfig(m_data->tabBoxAlternativeConfig(), m_alternativeTabBoxUi);
|
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_primaryTabBoxUi);
|
||||||
createConnections(m_alternativeTabBoxUi);
|
createConnections(m_alternativeTabBoxUi);
|
||||||
|
|
||||||
initLayoutLists();
|
|
||||||
|
|
||||||
// check focus policy - we don't offer configs for unreasonable focus policies
|
// check focus policy - we don't offer configs for unreasonable focus policies
|
||||||
KConfigGroup config(m_config, "Windows");
|
KConfigGroup config(m_config, "Windows");
|
||||||
QString policy = config.readEntry("FocusPolicy", "ClickToFocus");
|
QString policy = config.readEntry("FocusPolicy", "ClickToFocus");
|
||||||
|
@ -240,6 +240,15 @@ void KWinTabBoxConfig::updateUnmanagedState()
|
||||||
isDefault &= updateUnmanagedIsDefault(m_alternativeTabBoxUi, m_data->tabBoxAlternativeConfig());
|
isDefault &= updateUnmanagedIsDefault(m_alternativeTabBoxUi, m_data->tabBoxAlternativeConfig());
|
||||||
|
|
||||||
unmanagedWidgetDefaultState(isDefault);
|
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)
|
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)
|
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;
|
bool isDefault = true;
|
||||||
isDefault &= form->filterScreen() == config->defaultMultiScreenModeValue();
|
isDefault &= form->filterScreen() == config->defaultMultiScreenModeValue();
|
||||||
isDefault &= form->filterDesktop() == config->defaultDesktopModeValue();
|
isDefault &= form->filterDesktop() == config->defaultDesktopModeValue();
|
||||||
|
@ -282,6 +281,18 @@ bool KWinTabBoxConfig::updateUnmanagedIsDefault(KWinTabBoxConfigForm *form, cons
|
||||||
return isDefault;
|
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()
|
void KWinTabBoxConfig::load()
|
||||||
{
|
{
|
||||||
KCModule::load();
|
KCModule::load();
|
||||||
|
|
|
@ -41,6 +41,7 @@ public Q_SLOTS:
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void updateUnmanagedState();
|
void updateUnmanagedState();
|
||||||
|
void updateDefaultIndicator();
|
||||||
void configureEffectClicked();
|
void configureEffectClicked();
|
||||||
void slotGHNS();
|
void slotGHNS();
|
||||||
|
|
||||||
|
@ -53,6 +54,7 @@ private:
|
||||||
void createConnections(KWinTabBoxConfigForm *form);
|
void createConnections(KWinTabBoxConfigForm *form);
|
||||||
bool updateUnmanagedIsNeedSave(const KWinTabBoxConfigForm *form, const TabBox::TabBoxSettings *config);
|
bool updateUnmanagedIsNeedSave(const KWinTabBoxConfigForm *form, const TabBox::TabBoxSettings *config);
|
||||||
bool updateUnmanagedIsDefault(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:
|
private:
|
||||||
KWinTabBoxConfigForm *m_primaryTabBoxUi = nullptr;
|
KWinTabBoxConfigForm *m_primaryTabBoxUi = nullptr;
|
||||||
|
|
Loading…
Reference in a new issue