Commit 8c53a59d authored by Dmitry Kazakov's avatar Dmitry Kazakov

Remove Show Decorations option from Transform Tool

This option didn't work for several years and noone noticed that. I'm
also not sure it is possible to make it work in a sane way for new
transformation modes, like "Cage" and "Liquify". It seems like the
option didn't work right from implementation of these modes.

BUG:413573
parent e2eb1356
......@@ -213,13 +213,6 @@ void KisToolTransform::paint(QPainter& gc, const KoViewConverter &converter)
currentStrategy()->externalConfigChanged();
}
gc.save();
if (m_optionsWidget && m_optionsWidget->showDecorations()) {
gc.setOpacity(0.3);
gc.fillPath(m_selectionPath, Qt::black);
}
gc.restore();
currentStrategy()->paint(gc);
......@@ -651,16 +644,6 @@ void KisToolTransform::initGuiAfterTransformMode()
setFunctionalCursor();
}
void KisToolTransform::updateSelectionPath(const QPainterPath &selectionOutline)
{
m_selectionPath = selectionOutline;
const KisCoordinatesConverter *converter = m_canvas->coordinatesConverter();
QTransform i2f = converter->imageToDocumentTransform() * converter->documentToFlakeTransform();
m_selectionPath = i2f.map(selectionOutline);
}
void KisToolTransform::initThumbnailImage(KisPaintDeviceSP previewDevice)
{
QImage origImg;
......@@ -800,7 +783,7 @@ void KisToolTransform::startStroke(ToolTransformArgs::TransformMode mode, bool f
}
TransformStrokeStrategy *strategy = new TransformStrokeStrategy(mode, m_workRecursively, m_currentArgs.filterId(), forceReset, currentNode, selection, image().data(), image().data());
connect(strategy, SIGNAL(sigPreviewDeviceReady(KisPaintDeviceSP, QPainterPath)), SLOT(slotPreviewDeviceGenerated(KisPaintDeviceSP, QPainterPath)));
connect(strategy, SIGNAL(sigPreviewDeviceReady(KisPaintDeviceSP)), SLOT(slotPreviewDeviceGenerated(KisPaintDeviceSP)));
connect(strategy, SIGNAL(sigTransactionGenerated(TransformTransactionProperties, ToolTransformArgs, void*)), SLOT(slotTransactionGenerated(TransformTransactionProperties, ToolTransformArgs, void*)));
// save unique identifier of the stroke so we could
......@@ -812,7 +795,7 @@ void KisToolTransform::startStroke(ToolTransformArgs::TransformMode mode, bool f
KIS_SAFE_ASSERT_RECOVER_NOOP(m_changesTracker.isEmpty());
slotPreviewDeviceGenerated(0, QPainterPath());
slotPreviewDeviceGenerated(0);
}
void KisToolTransform::endStroke()
......@@ -867,7 +850,7 @@ void KisToolTransform::slotTransactionGenerated(TransformTransactionProperties t
}
}
void KisToolTransform::slotPreviewDeviceGenerated(KisPaintDeviceSP device, const QPainterPath &selectionOutline)
void KisToolTransform::slotPreviewDeviceGenerated(KisPaintDeviceSP device)
{
if (device && device->exactBounds().isEmpty()) {
KisCanvas2 *kisCanvas = dynamic_cast<KisCanvas2*>(canvas());
......@@ -880,7 +863,6 @@ void KisToolTransform::slotPreviewDeviceGenerated(KisPaintDeviceSP device, const
cancelStroke();
} else {
initThumbnailImage(device);
updateSelectionPath(selectionOutline);
initGuiAfterTransformMode();
}
}
......
......@@ -249,7 +249,6 @@ private:
void initGuiAfterTransformMode();
void initThumbnailImage(KisPaintDeviceSP previewDevice);
void updateSelectionPath(const QPainterPath &selectionOutline);
void updateApplyResetAvailability();
private:
......@@ -315,7 +314,7 @@ private Q_SLOTS:
void slotEditingFinished();
void slotTransactionGenerated(TransformTransactionProperties transaction, ToolTransformArgs args, void *strokeStrategyCookie);
void slotPreviewDeviceGenerated(KisPaintDeviceSP device, const QPainterPath &selectionOutline);
void slotPreviewDeviceGenerated(KisPaintDeviceSP device);
// context menu options for updating the transform type
// this is to help with discoverability since come people can't find the tool options
......
......@@ -44,7 +44,6 @@ KisToolTransformConfigWidget::KisToolTransformConfigWidget(TransformTransactionP
m_configChanged(false)
{
setupUi(this);
showDecorationsBox->setIcon(KisIconUtils::loadIcon("krita_tool_transform"));
chkWorkRecursively->setIcon(KisIconUtils::loadIcon("krita_tool_transform_recursive"));
flipXButton->setIcon(KisIconUtils::loadIcon("transform_icons_mirror_x"));
flipYButton->setIcon(KisIconUtils::loadIcon("transform_icons_mirror_y"));
......@@ -300,9 +299,6 @@ KisToolTransformConfigWidget::KisToolTransformConfigWidget(TransformTransactionP
connect(perspectiveTransformButton, SIGNAL(clicked(bool)), this, SLOT(slotSetPerspectiveModeButtonClicked(bool)));
connect(liquifyButton, SIGNAL(clicked(bool)), this, SLOT(slotSetLiquifyModeButtonClicked(bool)));
// Connect Decorations switcher
connect(showDecorationsBox, SIGNAL(toggled(bool)), canvas, SLOT(updateCanvas()));
tooBigLabelWidget->hide();
connect(canvas->viewManager()->mainWindow(), SIGNAL(themeChanged()), SLOT(slotUpdateIcons()), Qt::UniqueConnection);
......@@ -705,11 +701,6 @@ void KisToolTransformConfigWidget::setTooBigLabelVisible(bool value)
tooBigLabelWidget->setVisible(value);
}
bool KisToolTransformConfigWidget::showDecorations() const
{
return showDecorationsBox->isChecked();
}
void KisToolTransformConfigWidget::blockNotifications()
{
m_notificationsBlocked++;
......
......@@ -37,7 +37,6 @@ public:
void resetRotationCenterButtons();
void setDefaultWarpPoints(int pointsPerLine = -1);
void setTooBigLabelVisible(bool value);
bool showDecorations() const;
bool workRecursively() const;
public Q_SLOTS:
......
......@@ -247,14 +247,7 @@ void TransformStrokeStrategy::doStrokeCallback(KisStrokeJobData *data)
putDeviceCache(rootNode->paintDevice(), cacheDevice);
}
QPainterPath selectionOutline;
if (m_selection && m_selection->outlineCacheValid()) {
selectionOutline = m_selection->outlineCache();
} else if (previewDevice) {
selectionOutline.addRect(previewDevice->exactBounds());
}
emit sigPreviewDeviceReady(previewDevice, selectionOutline);
emit sigPreviewDeviceReady(previewDevice);
} else if(td) {
if (td->destination == TransformData::PAINT_DEVICE) {
QRect oldExtent = td->node->extent();
......
......@@ -107,7 +107,7 @@ public:
Q_SIGNALS:
void sigTransactionGenerated(TransformTransactionProperties transaction, ToolTransformArgs args, void *cookie);
void sigPreviewDeviceReady(KisPaintDeviceSP device, const QPainterPath &selectionOutline);
void sigPreviewDeviceReady(KisPaintDeviceSP device);
protected:
void postProcessToplevelCommand(KUndo2Command *command) override;
......
......@@ -2139,34 +2139,6 @@
<property name="topMargin">
<number>6</number>
</property>
<item>
<widget class="QPushButton" name="showDecorationsBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>32</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Show Decorations</string>
</property>
<property name="text">
<string/>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="chkWorkRecursively">
<property name="sizePolicy">
......@@ -2258,8 +2230,8 @@
<resources/>
<connections/>
<buttongroups>
<buttongroup name="freeTransformRadioGroup"/>
<buttongroup name="cageTransformButtonGroup"/>
<buttongroup name="buttonGroup"/>
<buttongroup name="freeTransformRadioGroup"/>
</buttongroups>
</ui>
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