Commit 321a35e3 authored by Halla Rempt's avatar Halla Rempt
Browse files

BUG: 328376

Don't scroll if we don't change paintops and reset the view settings
of the strip when we do change paintops.

This fixes the weirdness when you select a preset and scroll to the start
as well as the weirdness when you select a paintop without presets and
then select one with, and the preset icons are shown half-height.
parent f7d7be74
......@@ -259,6 +259,7 @@ KoResourceItemChooser *KisPresetChooser::itemChooser()
void KisPresetChooser::setPresetFilter(const QString& paintOpId)
{
static_cast<KisPresetProxyAdapter*>(m_adapter)->setPresetFilter(paintOpId);
updateViewSettings();
}
......
......@@ -41,6 +41,7 @@ KisPresetSelectorStrip::KisPresetSelectorStrip(QWidget* parent)
/* This is an heuristic to fill smallPresetChooser with only the presets
* for the paintop that comes selected by default: Pixel Brush. */
const QString PIXEL_BRUSH_ID = "paintbrush";
m_currentPaintopID = PIXEL_BRUSH_ID;
}
KisPresetSelectorStrip::~KisPresetSelectorStrip()
......@@ -50,7 +51,10 @@ KisPresetSelectorStrip::~KisPresetSelectorStrip()
void KisPresetSelectorStrip::setPresetFilter(const QString& paintOpId)
{
smallPresetChooser->setPresetFilter(paintOpId);
m_resourceItemView->scrollTo(m_resourceItemView->model()->index(0, 0));
if (m_currentPaintopID != paintOpId) {
m_resourceItemView->scrollTo(m_resourceItemView->model()->index(0, 0));
m_currentPaintopID = paintOpId;
}
}
void KisPresetSelectorStrip::on_leftScrollBtn_pressed()
......
......@@ -60,6 +60,7 @@ private:
* instead of class methods
*/
KoResourceItemView* m_resourceItemView;
QString m_currentPaintopID;
};
......
Supports Markdown
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