Changeset View
Changeset View
Standalone View
Standalone View
libs/widgets/KoEditColorSetDialog.cpp
Context not available. | |||||
133 | columns = m_activeColorSet->columnCount(); | 133 | columns = m_activeColorSet->columnCount(); | ||
---|---|---|---|---|---|
134 | if (columns==0){columns=16;} | 134 | if (columns==0){columns=16;} | ||
135 | widget.remove->setEnabled(false); | 135 | widget.remove->setEnabled(false); | ||
136 | for (int i = 0; i < m_activeColorSet->nColors(); i++) { | 136 | for (quint32 i = 0; i < m_activeColorSet->nColors(); i++) { | ||
137 | KoColorPatch *patch = new KoColorPatch(widget.patchesFrame); | 137 | KoColorPatch *patch = new KoColorPatch(widget.patchesFrame); | ||
138 | patch->setColor(m_activeColorSet->getColor(i).color); | 138 | KoColorSetEntry c = m_activeColorSet->getColorGlobal(i); | ||
139 | patch->setToolTip(m_activeColorSet->getColor(i).name); | 139 | patch->setColor(c.color); | ||
140 | patch->setToolTip(c.name); | ||||
140 | connect(patch, SIGNAL(triggered(KoColorPatch *)), this, SLOT(setTextLabel(KoColorPatch *))); | 141 | connect(patch, SIGNAL(triggered(KoColorPatch *)), this, SLOT(setTextLabel(KoColorPatch *))); | ||
141 | m_gridLayout->addWidget(patch, i/columns, i%columns); | 142 | m_gridLayout->addWidget(patch, i/columns, i%columns); | ||
142 | } | 143 | } | ||
Context not available. | |||||
183 | void KoEditColorSetWidget::removeColor() | 184 | void KoEditColorSetWidget::removeColor() | ||
184 | { | 185 | { | ||
185 | Q_ASSERT(m_activeColorSet); | 186 | Q_ASSERT(m_activeColorSet); | ||
186 | for (int i = 0; i < m_activeColorSet->nColors(); i++) { | 187 | for (quint32 i = 0; i < m_activeColorSet->nColors(); i++) { | ||
187 | if (m_activePatch->color() == m_activeColorSet->getColor(i).color) { | 188 | KoColorSetEntry c = m_activeColorSet->getColorGlobal(i); | ||
188 | m_activeColorSet->remove(m_activeColorSet->getColor(i)); | 189 | if (m_activePatch->color() == c.color) { | ||
190 | m_activeColorSet->remove(c); | ||||
189 | setActiveColorSet(widget.selector->currentIndex()); | 191 | setActiveColorSet(widget.selector->currentIndex()); | ||
190 | break; | 192 | break; | ||
191 | } | 193 | } | ||
Context not available. |