Skip to content

Commit

Permalink
Fix coloring app icon
Browse files Browse the repository at this point in the history
Signed-off-by: Lukas Holecek <hluk@email.cz>
  • Loading branch information
hluk committed Nov 4, 2019
1 parent 996c864 commit ae10e01
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/gui/iconfactory.cpp
Expand Up @@ -55,9 +55,23 @@ const int lightThreshold = 100;

QPointer<QObject> activePaintDevice;

bool hasNormalIconHelper()
{
// QIcon::hasThemeIcon() returns true even if icon "copyq-normal" is not available
// but "copyq" is.
const QString iconName = COPYQ_ICON_NAME "-normal";
const QIcon normalIcon = QIcon::fromTheme(COPYQ_ICON_NAME "-normal");
if ( normalIcon.isNull() )
return false;

const QIcon defaultIcon = QIcon::fromTheme(COPYQ_ICON_NAME);
return defaultIcon.pixmap(16).toImage() != normalIcon.pixmap(16).toImage();
}

bool hasNormalIcon()
{
return QIcon::hasThemeIcon(COPYQ_ICON_NAME "-normal");
static const bool result = hasNormalIconHelper();
return result;
}

QString sessionName()
Expand Down

0 comments on commit ae10e01

Please sign in to comment.