expose ElectricBorderCornerRatio to config GUI

BUG: 308993
FIXED-IN: 4.11
REVIEW: 109683
This commit is contained in:
Thomas Lübking 2013-03-23 21:38:33 +01:00
parent aa8fd5f86c
commit 551c9f4c22
2 changed files with 130 additions and 8 deletions

View file

@ -58,6 +58,7 @@ KWinScreenEdgesConfig::KWinScreenEdgesConfig(QWidget* parent, const QVariantList
connect(m_ui->triggerCooldownSpin, SIGNAL(valueChanged(int)), this, SLOT(changed()));
connect(m_ui->quickMaximizeBox, SIGNAL(stateChanged(int)), this, SLOT(changed()));
connect(m_ui->quickTileBox, SIGNAL(stateChanged(int)), this, SLOT(changed()));
connect(m_ui->electricBorderCornerRatio, SIGNAL(valueChanged(int)), this, SLOT(changed()));
// Visual feedback of action group conflicts
connect(m_ui->desktopSwitchCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(groupChanged()));
@ -96,6 +97,7 @@ void KWinScreenEdgesConfig::load()
m_ui->triggerCooldownSpin->setValue(config.readEntry("ElectricBorderCooldown", 350));
m_ui->quickMaximizeBox->setChecked(config.readEntry("ElectricBorderMaximize", true));
m_ui->quickTileBox->setChecked(config.readEntry("ElectricBorderTiling", true));
m_ui->electricBorderCornerRatio->setValue(qRound(config.readEntry("ElectricBorderCornerRatio", 0.25)*100));
emit changed(false);
}
@ -113,6 +115,7 @@ void KWinScreenEdgesConfig::save()
config.writeEntry("ElectricBorderCooldown", m_ui->triggerCooldownSpin->value());
config.writeEntry("ElectricBorderMaximize", m_ui->quickMaximizeBox->isChecked());
config.writeEntry("ElectricBorderTiling", m_ui->quickTileBox->isChecked());
config.writeEntry("ElectricBorderCornerRatio", m_ui->electricBorderCornerRatio->value()/100.0);
config.sync();
@ -132,6 +135,7 @@ void KWinScreenEdgesConfig::defaults()
m_ui->triggerCooldownSpin->setValue(350);
m_ui->quickMaximizeBox->setChecked(true);
m_ui->quickTileBox->setChecked(true);
m_ui->electricBorderCornerRatio->setValue(25);
emit changed(true);
}

View file

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>461</width>
<height>478</height>
<height>511</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
@ -51,24 +51,93 @@
<property name="title">
<string>Window Management</string>
</property>
<layout class="QFormLayout" name="formLayout_2">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum>
</property>
<item row="0" column="0" colspan="2">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QCheckBox" name="quickMaximizeBox">
<property name="text">
<string>Maximize windows by dragging them to the top of the screen</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<item>
<widget class="QCheckBox" name="quickTileBox">
<property name="text">
<string>Tile windows by dragging them to the side of the screen</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_3">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Quarter tiling triggered in the outer</string>
</property>
<property name="buddy">
<cstring>electricBorderCornerRatio</cstring>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="electricBorderCornerRatio">
<property name="enabled">
<bool>false</bool>
</property>
<property name="suffix">
<string>%</string>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>49</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_4">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>of the screen</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
</item>
@ -236,5 +305,54 @@
<tabstop>triggerCooldownSpin</tabstop>
</tabstops>
<resources/>
<connections/>
<connections>
<connection>
<sender>quickTileBox</sender>
<signal>toggled(bool)</signal>
<receiver>label_3</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>93</x>
<y>306</y>
</hint>
<hint type="destinationlabel">
<x>105</x>
<y>329</y>
</hint>
</hints>
</connection>
<connection>
<sender>quickTileBox</sender>
<signal>toggled(bool)</signal>
<receiver>electricBorderCornerRatio</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>164</x>
<y>312</y>
</hint>
<hint type="destinationlabel">
<x>301</x>
<y>345</y>
</hint>
</hints>
</connection>
<connection>
<sender>quickTileBox</sender>
<signal>toggled(bool)</signal>
<receiver>label_4</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>220</x>
<y>305</y>
</hint>
<hint type="destinationlabel">
<x>340</x>
<y>329</y>
</hint>
</hints>
</connection>
</connections>
</ui>