Commit 623be008 authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

Remove harcoded margins from filter dialog, use normal buttonbox for ok/cancel

REVIEW: 117937

thanks boud for review
parent 03779ea7
......@@ -72,12 +72,10 @@ KisDlgFilter::KisDlgFilter(KisView2 *view, KisNodeSP node, KisFilterManager *fil
}
d->uiFilterDialog.filterSelection->setPaintDevice(true, d->node->original());
d->uiFilterDialog.pushButtonOk->setGuiItem(KStandardGuiItem::ok());
d->uiFilterDialog.pushButtonCancel->setGuiItem(KStandardGuiItem::cancel());
connect(d->uiFilterDialog.pushButtonOk, SIGNAL(pressed()), SLOT(apply()));
connect(d->uiFilterDialog.pushButtonOk, SIGNAL(pressed()), SLOT(accept()));
connect(d->uiFilterDialog.pushButtonCancel, SIGNAL(pressed()), SLOT(reject()));
connect(d->uiFilterDialog.buttonBox, SIGNAL(accepted()), SLOT(apply()));
connect(d->uiFilterDialog.buttonBox, SIGNAL(accepted()), SLOT(accept()));
connect(d->uiFilterDialog.buttonBox, SIGNAL(rejected()), SLOT(reject()));
connect(d->uiFilterDialog.checkBoxPreview, SIGNAL(stateChanged(int)), SLOT(previewCheckBoxChange(int)));
connect(d->uiFilterDialog.filterSelection, SIGNAL(configurationChanged()), SLOT(updatePreview()));
......@@ -121,7 +119,7 @@ void KisDlgFilter::updatePreview()
startApplyingFilter(config);
}
d->uiFilterDialog.pushButtonOk->setEnabled(true);
d->uiFilterDialog.buttonBox->button(QDialogButtonBox::Ok)->setEnabled(true);
}
void KisDlgFilter::apply()
......@@ -132,7 +130,7 @@ void KisDlgFilter::apply()
}
d->filterManager->finish();
d->uiFilterDialog.pushButtonOk->setEnabled(false);
d->uiFilterDialog.buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
}
void KisDlgFilter::close()
......
......@@ -20,9 +20,6 @@
<string>Dialog</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="margin">
<number>4</number>
</property>
<item>
<widget class="KisFilterSelectorWidget" name="filterSelection" native="true">
<property name="sizePolicy">
......@@ -36,7 +33,7 @@
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="topMargin">
<number>18</number>
<number>0</number>
</property>
<item>
<widget class="QPushButton" name="pushButtonCreateMaskEffect">
......@@ -73,29 +70,9 @@
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="KPushButton" name="pushButtonCancel">
<property name="autoDefault">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>10</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="KPushButton" name="pushButtonOk">
<property name="default">
<bool>true</bool>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
......@@ -104,11 +81,6 @@
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KPushButton</class>
<extends>QPushButton</extends>
<header>kpushbutton.h</header>
</customwidget>
<customwidget>
<class>KisFilterSelectorWidget</class>
<extends>QWidget</extends>
......@@ -118,9 +90,7 @@
</customwidgets>
<tabstops>
<tabstop>checkBoxPreview</tabstop>
<tabstop>pushButtonOk</tabstop>
<tabstop>pushButtonCreateMaskEffect</tabstop>
<tabstop>pushButtonCancel</tabstop>
</tabstops>
<resources/>
<connections/>
......
......@@ -14,16 +14,7 @@
<string>Filter selection</string>
</property>
<layout class="QGridLayout">
<property name="leftMargin">
<number>4</number>
</property>
<property name="topMargin">
<number>4</number>
</property>
<property name="rightMargin">
<number>4</number>
</property>
<property name="bottomMargin">
<property name="margin">
<number>0</number>
</property>
<item row="0" column="0">
......@@ -31,8 +22,11 @@
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<widget class="QWidget" name="layoutWidget">
<widget class="QWidget">
<layout class="QVBoxLayout">
<property name="rightMargin">
<number>-1</number>
</property>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
......@@ -55,10 +49,10 @@
</item>
</layout>
</widget>
<widget class="QWidget" name="layoutWidget">
<widget class="QWidget">
<layout class="QGridLayout">
<property name="leftMargin">
<number>9</number>
<number>-1</number>
</property>
<property name="topMargin">
<number>0</number>
......@@ -72,9 +66,6 @@
<property name="horizontalSpacing">
<number>0</number>
</property>
<property name="verticalSpacing">
<number>3</number>
</property>
<item row="0" column="2">
<widget class="QPushButton" name="pushButtonEditPressets">
<property name="text">
......
Markdown is supported
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