[kwin/kcmdeco] Show an information if close window by dbl click gets activated

The option changes the behavior of the menu button, thus we should point
out to the user that the behavior changes.

This is only done for Auroae configurations as other decorations have to
take care about it themselves.

CCBUG: 331462
REVIEW: 116715
This commit is contained in:
Martin Gräßlin 2014-03-11 15:03:36 +01:00
parent 9fc3aabc66
commit a51cbf7b9e
2 changed files with 19 additions and 0 deletions

View file

@ -11,6 +11,10 @@
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="KMessageWidget" name="doubleClickMessage">
</widget>
</item>
<item>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
@ -131,6 +135,12 @@
<extends>QComboBox</extends>
<header>kcombobox.h</header>
</customwidget>
<customwidget>
<class>KMessageWidget</class>
<extends>QFrame</extends>
<header location="global">kmessagewidget.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>

View file

@ -380,6 +380,15 @@ void KWinDecorationModule::slotConfigureDecoration()
form->borderSizesCombo->setCurrentIndex(index.data(DecorationModel::BorderSizeRole).toInt());
form->buttonSizesCombo->setCurrentIndex(index.data(DecorationModel::ButtonSizeRole).toInt());
form->closeWindowsDoubleClick->setChecked(index.data(DecorationModel::CloseOnDblClickRole).toBool());
form->doubleClickMessage->setCloseButtonVisible(true);
form->doubleClickMessage->setText(i18n("Close by double clicking:\n To open the menu, keep the button pressed until it appears."));
form->doubleClickMessage->setVisible(false);
connect(form->closeWindowsDoubleClick, &QCheckBox::toggled, [form](bool toggled) {
if (!toggled) {
return;
}
form->doubleClickMessage->animatedShow();
});
// in case of QmlDecoration look for a config.ui in the package structure
KConfigDialogManager *configManager = nullptr;
if (index.data(DecorationModel::TypeRole).toInt() == DecorationModelData::QmlDecoration) {