diff --git a/components/qtmaterialiconbutton.cpp b/components/qtmaterialiconbutton.cpp
index 5ef8fc4..71fd70f 100644
--- a/components/qtmaterialiconbutton.cpp
+++ b/components/qtmaterialiconbutton.cpp
@@ -31,8 +31,6 @@ void QtMaterialIconButtonPrivate::init()
QSizePolicy policy;
policy.setWidthForHeight(true);
q->setSizePolicy(policy);
-
- rippleOverlay->installEventFilter(q);
}
/*!
@@ -144,21 +142,6 @@ bool QtMaterialIconButton::event(QEvent *event)
return QAbstractButton::event(event);
}
-/*!
- * \reimp
- */
-bool QtMaterialIconButton::eventFilter(QObject *obj, QEvent *event)
-{
- if (QEvent::Resize == event->type())
- {
- Q_D(QtMaterialIconButton);
-
- const int s = iconSize().width()/2;
- d->rippleOverlay->setGeometry(geometry().adjusted(-s, -s, s, s));
- }
- return QAbstractButton::eventFilter(obj, event);
-}
-
/*!
* \reimp
*/
diff --git a/components/qtmaterialiconbutton.h b/components/qtmaterialiconbutton.h
index 5c2afc4..90dd91f 100644
--- a/components/qtmaterialiconbutton.h
+++ b/components/qtmaterialiconbutton.h
@@ -28,7 +28,6 @@ protected:
QtMaterialIconButton(QtMaterialIconButtonPrivate &d, QWidget *parent = 0);
bool event(QEvent *event) Q_DECL_OVERRIDE;
- bool eventFilter(QObject *obj, QEvent *event) Q_DECL_OVERRIDE;
void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
diff --git a/examples/iconbuttonsettingseditor.cpp b/examples/iconbuttonsettingseditor.cpp
index f320c19..6c5667f 100644
--- a/examples/iconbuttonsettingseditor.cpp
+++ b/examples/iconbuttonsettingseditor.cpp
@@ -28,12 +28,14 @@ void IconButtonSettingsEditor::setupForm()
{
ui->disabledCheckBox->setChecked(!m_button->isEnabled());
ui->useThemeColorsCheckBox->setChecked(m_button->useThemeColors());
+ ui->sizeSpinBox->setValue(m_button->iconSize().width());
}
void IconButtonSettingsEditor::updateWidget()
{
m_button->setDisabled(ui->disabledCheckBox->isChecked());
m_button->setUseThemeColors(ui->useThemeColorsCheckBox->isChecked());
+ m_button->setIconSize(QSize(ui->sizeSpinBox->value(), ui->sizeSpinBox->value()));
}
void IconButtonSettingsEditor::selectColor()
@@ -79,4 +81,5 @@ void IconButtonSettingsEditor::init()
connect(ui->useThemeColorsCheckBox, SIGNAL(toggled(bool)), this, SLOT(updateWidget()));
connect(ui->colorToolButton, SIGNAL(clicked(bool)), this, SLOT(selectColor()));
connect(ui->disabledColorToolButton, SIGNAL(clicked(bool)), this, SLOT(selectColor()));
+ connect(ui->sizeSpinBox, SIGNAL(valueChanged(int)), this, SLOT(updateWidget()));
}
diff --git a/examples/iconbuttonsettingsform.ui b/examples/iconbuttonsettingsform.ui
index 4fa8942..97461d2 100644
--- a/examples/iconbuttonsettingsform.ui
+++ b/examples/iconbuttonsettingsform.ui
@@ -18,8 +18,8 @@
0
0
- 234
- 391
+ 274
+ 371
@@ -37,23 +37,33 @@
-
+
+
+ Size
+
+
+
+ -
+
+
+ -
Use theme colors
- -
+
-
- -
+
-
Color
- -
+
-
-
@@ -71,14 +81,14 @@
- -
+
-
Disabled color
- -
+
-
-