Commit 676c3c8e authored by Halla Rempt's avatar Halla Rempt
Browse files

BUG:328879 Update the channel docker when changing image colorspace

parent 93981593
......@@ -31,6 +31,7 @@
#include <kis_image.h>
#include <kis_group_layer.h>
#include <kis_layer.h>
#include <kis_paint_device.h>
ChannelDockerDock::ChannelDockerDock( ) : QDockWidget(i18n("Channels")), m_canvas(0)
......@@ -56,7 +57,10 @@ void ChannelDockerDock::setCanvas(KoCanvasBase * canvas)
if (m_canvas) {
KisView2* view = m_canvas->view();
m_model->slotLayerActivated(view->image()->rootLayer());
KisPaintDeviceSP dev = view->image()->projection();
connect(dev, SIGNAL(colorSpaceChanged(const KoColorSpace*)), m_model, SLOT(slotColorSpaceChanged(const KoColorSpace*)));
}
connect(m_model, SIGNAL(channelFlagsChanged()), m_canvas, SLOT(channelSelectionChanged()));
}
......
......@@ -124,8 +124,14 @@ Qt::ItemFlags ChannelModel::flags(const QModelIndex& /*index*/) const
void ChannelModel::slotLayerActivated(KisLayerSP layer)
{
beginResetModel();
m_currentLayer = layer;
reset();
endResetModel();
}
void ChannelModel::slotColorSpaceChanged(const KoColorSpace */*colorSpace*/)
{
slotLayerActivated(m_currentLayer);
}
#include "channelmodel.moc"
......@@ -20,6 +20,8 @@
#include <QModelIndex>
class KoColorSpace;
#include <kis_types.h>
class ChannelModel : public QAbstractTableModel
......@@ -38,6 +40,7 @@ public:
public slots:
void slotLayerActivated(KisLayerSP layer);
void slotColorSpaceChanged(const KoColorSpace *colorSpace);
signals:
void channelFlagsChanged();
private:
......
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