Commit 17e6e284 authored by Mathias Wein's avatar Mathias Wein

Remove old workaround for popup palette hiding

Commit 59168414 and
Commit ae734675
added this to prevent picking up the new foreground color as
used by closing the palette with a left-click on the canvas.

The paint tools however have been refactored since then and
the "TODO" is no longer present in kis_tool_freehand.cc,
so remove the remains of this workaround.

BUG:415106
parent 11e140ff
...@@ -47,7 +47,6 @@ KisCanvasResourceProvider::KisCanvasResourceProvider(KisViewManager * view) ...@@ -47,7 +47,6 @@ KisCanvasResourceProvider::KisCanvasResourceProvider(KisViewManager * view)
: m_view(view) : m_view(view)
{ {
m_fGChanged = true; m_fGChanged = true;
m_enablefGChange = true; // default to true, so that colour history is working without popup palette
} }
KisCanvasResourceProvider::~KisCanvasResourceProvider() KisCanvasResourceProvider::~KisCanvasResourceProvider()
...@@ -369,7 +368,7 @@ void KisCanvasResourceProvider::setEraserMode(bool value) ...@@ -369,7 +368,7 @@ void KisCanvasResourceProvider::setEraserMode(bool value)
void KisCanvasResourceProvider::slotPainting() void KisCanvasResourceProvider::slotPainting()
{ {
if (m_fGChanged && m_enablefGChange) { if (m_fGChanged) {
emit sigFGColorUsed(fgColor()); emit sigFGColorUsed(fgColor());
m_fGChanged = false; m_fGChanged = false;
} }
...@@ -404,11 +403,6 @@ void KisCanvasResourceProvider::slotGamutMaskDeactivate() ...@@ -404,11 +403,6 @@ void KisCanvasResourceProvider::slotGamutMaskDeactivate()
emit sigGamutMaskDeactivated(); emit sigGamutMaskDeactivated();
} }
void KisCanvasResourceProvider::slotResetEnableFGChange(bool b)
{
m_enablefGChange = b;
}
QList<QPointer<KisAbstractPerspectiveGrid> > KisCanvasResourceProvider::perspectiveGrids() const QList<QPointer<KisAbstractPerspectiveGrid> > KisCanvasResourceProvider::perspectiveGrids() const
{ {
return m_perspectiveGrids; return m_perspectiveGrids;
......
...@@ -200,13 +200,6 @@ public Q_SLOTS: ...@@ -200,13 +200,6 @@ public Q_SLOTS:
void slotImageSizeChanged(); void slotImageSizeChanged();
void slotOnScreenResolutionChanged(); void slotOnScreenResolutionChanged();
// This is a flag to handle a bug:
// If pop up palette is visible and a new colour is selected, the new colour
// will be added when the user clicks on the canvas to hide the palette
// In general, we want to be able to store recent color if the pop up palette
// is not visible
void slotResetEnableFGChange(bool);
private Q_SLOTS: private Q_SLOTS:
void slotCanvasResourceChanged(int key, const QVariant & res); void slotCanvasResourceChanged(int key, const QVariant & res);
...@@ -240,14 +233,6 @@ private: ...@@ -240,14 +233,6 @@ private:
KoCanvasResourceProvider *m_resourceManager; KoCanvasResourceProvider *m_resourceManager;
bool m_fGChanged; bool m_fGChanged;
QList<QPointer<KisAbstractPerspectiveGrid> > m_perspectiveGrids; QList<QPointer<KisAbstractPerspectiveGrid> > m_perspectiveGrids;
// This is a flag to handle a bug:
// If pop up palette is visible and a new colour is selected, the new colour
// will be added when the user clicks on the canvas to hide the palette
// In general, we want to be able to store recent color if the pop up palette
// is not visible
bool m_enablefGChange;
}; };
#endif #endif
...@@ -74,13 +74,6 @@ Q_SIGNALS: ...@@ -74,13 +74,6 @@ Q_SIGNALS:
void sigSetFGColor(const KoColor& c); void sigSetFGColor(const KoColor& c);
void sigSetBGColor(const KoColor& c); void sigSetBGColor(const KoColor& c);
// This is a flag to handle a bug:
// If pop up palette is visible and a new colour is selected, the new colour
// will be added when the user clicks on the canvas to hide the palette
// In general, we want to be able to store recent colours if the pop up palette
// is not visible
void sigEnableChangeColor(bool b);
void sigChangeFGColorSelector(const KoColor&); void sigChangeFGColorSelector(const KoColor&);
void setSelectedColor(int); void setSelectedColor(int);
......
...@@ -472,7 +472,6 @@ KisPaintopBox::KisPaintopBox(KisViewManager *view, QWidget *parent, const char * ...@@ -472,7 +472,6 @@ KisPaintopBox::KisPaintopBox(KisViewManager *view, QWidget *parent, const char *
connect(m_favoriteResourceManager, SIGNAL(sigSetFGColor(KoColor)), m_resourceProvider, SLOT(slotSetFGColor(KoColor))); connect(m_favoriteResourceManager, SIGNAL(sigSetFGColor(KoColor)), m_resourceProvider, SLOT(slotSetFGColor(KoColor)));
connect(m_favoriteResourceManager, SIGNAL(sigSetBGColor(KoColor)), m_resourceProvider, SLOT(slotSetBGColor(KoColor))); connect(m_favoriteResourceManager, SIGNAL(sigSetBGColor(KoColor)), m_resourceProvider, SLOT(slotSetBGColor(KoColor)));
connect(m_favoriteResourceManager, SIGNAL(sigEnableChangeColor(bool)), m_resourceProvider, SLOT(slotResetEnableFGChange(bool)));
connect(view->mainWindow(), SIGNAL(themeChanged()), this, SLOT(slotUpdateSelectionIcon())); connect(view->mainWindow(), SIGNAL(themeChanged()), this, SLOT(slotUpdateSelectionIcon()));
connect(m_resourceProvider->resourceManager(), SIGNAL(canvasResourceChanged(int,QVariant)), connect(m_resourceProvider->resourceManager(), SIGNAL(canvasResourceChanged(int,QVariant)),
......
...@@ -174,16 +174,6 @@ KisPopupPalette::KisPopupPalette(KisViewManager* viewManager, KisCoordinatesConv ...@@ -174,16 +174,6 @@ KisPopupPalette::KisPopupPalette(KisViewManager* viewManager, KisCoordinatesConv
connect(m_resourceManager, SIGNAL(updatePalettes()), SLOT(slotUpdate())); connect(m_resourceManager, SIGNAL(updatePalettes()), SLOT(slotUpdate()));
connect(m_resourceManager, SIGNAL(hidePalettes()), SLOT(slotHide())); connect(m_resourceManager, SIGNAL(hidePalettes()), SLOT(slotHide()));
// This is used to handle a bug:
// If pop up palette is visible and a new colour is selected, the new colour
// will be added when the user clicks on the canvas to hide the palette
// In general, we want to be able to store recent color if the pop up palette
// is not visible
m_timer.setSingleShot(true);
connect(this, SIGNAL(sigTriggerTimer()), this, SLOT(slotTriggerTimer()));
connect(&m_timer, SIGNAL(timeout()), this, SLOT(slotEnableChangeFGColor()));
connect(this, SIGNAL(sigEnableChangeFGColor(bool)), m_resourceManager, SIGNAL(sigEnableChangeColor(bool)));
setCursor(Qt::ArrowCursor); setCursor(Qt::ArrowCursor);
setMouseTracking(true); setMouseTracking(true);
setHoveredPreset(-1); setHoveredPreset(-1);
...@@ -332,16 +322,6 @@ void KisPopupPalette::setSelectedColor(int x) ...@@ -332,16 +322,6 @@ void KisPopupPalette::setSelectedColor(int x)
m_selectedColor = x; m_selectedColor = x;
} }
void KisPopupPalette::slotTriggerTimer()
{
m_timer.start(750);
}
void KisPopupPalette::slotEnableChangeFGColor()
{
emit sigEnableChangeFGColor(true);
}
void KisPopupPalette::slotZoomSliderChanged(int zoom) { void KisPopupPalette::slotZoomSliderChanged(int zoom) {
emit zoomLevelChanged(zoom); emit zoomLevelChanged(zoom);
} }
...@@ -428,9 +408,6 @@ void KisPopupPalette::showPopupPalette(bool show) ...@@ -428,9 +408,6 @@ void KisPopupPalette::showPopupPalette(bool show)
KisSignalsBlocker b(zoomCanvasSlider); KisSignalsBlocker b(zoomCanvasSlider);
zoomCanvasSlider->setValue(m_coordinatesConverter->zoomInPercent()); // sync the zoom slider zoomCanvasSlider->setValue(m_coordinatesConverter->zoomInPercent()); // sync the zoom slider
} }
emit sigEnableChangeFGColor(!show);
} else {
emit sigTriggerTimer();
} }
setVisible(show); setVisible(show);
m_brushHud->setVisible(show && m_brushHudButton->isChecked()); m_brushHud->setVisible(show && m_brushHudButton->isChecked());
......
...@@ -119,8 +119,6 @@ private: ...@@ -119,8 +119,6 @@ private:
QScopedPointer<KisSignalCompressor> m_colorChangeCompressor; QScopedPointer<KisSignalCompressor> m_colorChangeCompressor;
KActionCollection *m_actionCollection; KActionCollection *m_actionCollection;
QTimer m_timer;
KisBrushHud *m_brushHud {0}; KisBrushHud *m_brushHud {0};
float m_popupPaletteSize {385.0}; float m_popupPaletteSize {385.0};
float m_colorHistoryInnerRadius {72.0}; float m_colorHistoryInnerRadius {72.0};
...@@ -158,14 +156,6 @@ Q_SIGNALS: ...@@ -158,14 +156,6 @@ Q_SIGNALS:
void sigUpdateCanvas(); void sigUpdateCanvas();
void zoomLevelChanged(int); void zoomLevelChanged(int);
// These are used to handle a bug:
// If pop up palette is visible and a new colour is selected, the new colour
// will be added when the user clicks on the canvas to hide the palette
// In general, we want to be able to store recent color if the pop up palette
// is not visible
void sigEnableChangeFGColor(bool);
void sigTriggerTimer();
public Q_SLOTS: public Q_SLOTS:
void slotUpdateIcons(); void slotUpdateIcons();
...@@ -174,8 +164,6 @@ private Q_SLOTS: ...@@ -174,8 +164,6 @@ private Q_SLOTS:
void slotExternalFgColorChanged(const KoColor &color); void slotExternalFgColorChanged(const KoColor &color);
void slotEmitColorChanged(); void slotEmitColorChanged();
void slotSetSelectedColor(int x) { setSelectedColor(x); update(); } void slotSetSelectedColor(int x) { setSelectedColor(x); update(); }
void slotTriggerTimer();
void slotEnableChangeFGColor();
void slotUpdate() { update(); } void slotUpdate() { update(); }
void slotHide() { showPopupPalette(false); } void slotHide() { showPopupPalette(false); }
void slotShowTagsPopup(); void slotShowTagsPopup();
......
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