mirror of
https://bitbucket.org/smil3y/kde-extraapps.git
synced 2025-02-23 18:32:53 +00:00
kdeplasma-addons: change the native widget icon regardless if the color is in the menu history
when picking the same color twice (or more) the icon was not changing to the currently picked color (as if no pixel was grabbed) Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
1cc12738f4
commit
57d542804f
1 changed files with 3 additions and 3 deletions
|
@ -389,19 +389,19 @@ void Kolourpicker::installFilter()
|
|||
|
||||
void Kolourpicker::addColor(const QColor &color, bool save)
|
||||
{
|
||||
ColorIcon colorIcon(color);
|
||||
m_configAndHistory->nativeWidget()->setIcon(colorIcon);
|
||||
|
||||
QHash<QColor, QAction *>::ConstIterator it = m_menus.constFind(color);
|
||||
if (it != m_menus.constEnd()) {
|
||||
return;
|
||||
}
|
||||
|
||||
KMenu *newmenu = buildMenuForColor(color);
|
||||
QAction *act = newmenu->menuAction();
|
||||
ColorIcon colorIcon(color);
|
||||
act->setIcon(colorIcon);
|
||||
act->setText(QString("%1, %2, %3").arg(color.red()).arg(color.green()).arg(color.blue()));
|
||||
connect(newmenu, SIGNAL(triggered(QAction*)), this, SLOT(colorActionTriggered(QAction*)));
|
||||
m_configAndHistoryMenu->insertMenu(m_configAndHistoryMenu->actions().at(1), newmenu);
|
||||
m_configAndHistory->nativeWidget()->setIcon(colorIcon);
|
||||
m_menus.insert(color, act);
|
||||
m_colors.append(color.name());
|
||||
m_configAndHistory->setEnabled(true);
|
||||
|
|
Loading…
Add table
Reference in a new issue