Commit 8cf7f8c3 authored by Boudewijn Rempt's avatar Boudewijn Rempt

Simplify the Pressure Toggle button

There's no need to create a physical button that then doesn't
get used; we can just create the action, and the action can be
added to the toolbars.
parent eae8d123
......@@ -160,15 +160,6 @@ KisPaintopBox::KisPaintopBox(KisViewManager *view, QWidget *parent, const char *
KisAction* alphaLockAction = m_viewManager->actionManager()->createAction("preserve_alpha");
m_alphaLockButton->setDefaultAction(alphaLockAction);
// pen pressure
m_disablePressureButton = new KisHighlightedToolButton(this);
m_disablePressureButton->setFixedSize(iconsize, iconsize);
m_disablePressureButton->setCheckable(true);
m_disablePressureAction = m_viewManager->actionManager()->createAction("disable_pressure");
m_disablePressureButton->setDefaultAction(m_disablePressureAction);
// horizontal and vertical mirror toolbar buttons
// mirror tool options for the X Mirror
......@@ -331,17 +322,6 @@ KisPaintopBox::KisPaintopBox(KisViewManager *view, QWidget *parent, const char *
action->setText(i18n("Brush composite"));
action->setDefaultWidget(compositeActions);
QWidget* compositePressure = new QWidget(this);
QHBoxLayout* pressureLayout = new QHBoxLayout(compositePressure);
pressureLayout->addWidget(m_disablePressureButton);
pressureLayout->setSpacing(4);
pressureLayout->setContentsMargins(0, 0, 0, 0);
action = new QWidgetAction(this);
view->actionCollection()->addAction("pressure_action", action);
action->setText(i18n("Pressure usage (small button)"));
action->setDefaultWidget(compositePressure);
action = new QWidgetAction(this);
KisActionRegistry::instance()->propertizeAction("brushslider1", action);
view->actionCollection()->addAction("brushslider1", action);
......@@ -463,8 +443,9 @@ KisPaintopBox::KisPaintopBox(KisViewManager *view, QWidget *parent, const char *
connect(m_cmbCompositeOp , SIGNAL(currentIndexChanged(int)) , SLOT(slotSetCompositeMode(int)));
connect(m_eraseAction , SIGNAL(toggled(bool)) , SLOT(slotToggleEraseMode(bool)));
connect(alphaLockAction , SIGNAL(toggled(bool)) , SLOT(slotToggleAlphaLockMode(bool)));
connect(m_disablePressureAction , SIGNAL(toggled(bool)) , SLOT(slotDisablePressureMode(bool)));
m_disablePressureAction = m_viewManager->actionManager()->createAction("disable_pressure");
connect(m_disablePressureAction , SIGNAL(toggled(bool)) , SLOT(slotDisablePressureMode(bool)));
m_disablePressureAction->setChecked(true);
connect(m_hMirrorAction , SIGNAL(toggled(bool)) , SLOT(slotHorizontalMirrorChanged(bool)));
......@@ -1157,9 +1138,9 @@ void KisPaintopBox::slotToggleAlphaLockMode(bool checked)
void KisPaintopBox::slotDisablePressureMode(bool checked)
{
if (checked) {
m_disablePressureButton->actions()[0]->setIcon(KisIconUtils::loadIcon("transform_icons_penPressure"));
m_disablePressureAction->setIcon(KisIconUtils::loadIcon("transform_icons_penPressure"));
} else {
m_disablePressureButton->actions()[0]->setIcon(KisIconUtils::loadIcon("transform_icons_penPressure_locked"));
m_disablePressureAction->setIcon(KisIconUtils::loadIcon("transform_icons_penPressure_locked"));
}
m_resourceProvider->setDisablePressure(checked);
......@@ -1278,9 +1259,9 @@ void KisPaintopBox::slotUpdateSelectionIcon()
m_reloadAction->setIcon(KisIconUtils::loadIcon("view-refresh"));
if (m_disablePressureAction->isChecked()) {
m_disablePressureButton->setIcon(KisIconUtils::loadIcon("transform_icons_penPressure"));
m_disablePressureAction->setIcon(KisIconUtils::loadIcon("transform_icons_penPressure"));
} else {
m_disablePressureButton->setIcon(KisIconUtils::loadIcon("transform_icons_penPressure_locked"));
m_disablePressureAction->setIcon(KisIconUtils::loadIcon("transform_icons_penPressure_locked"));
}
}
......
......@@ -191,7 +191,6 @@ private:
KisCompositeOpComboBox* m_cmbCompositeOp;
QToolButton* m_eraseModeButton;
QToolButton* m_alphaLockButton;
QToolButton* m_disablePressureButton;
QToolButton* m_hMirrorButton;
QToolButton* m_vMirrorButton;
KisToolOptionsPopup* m_toolOptionsPopup;
......
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