Commit 7d106501 authored by Karl Ove Hufthammer's avatar Karl Ove Hufthammer

Ensure that checkboxes are shown in menus

The old code tried to add an icon for all menu items, even for
empty icon names. Most themes (including the default ‘Fusion’ theme,
but not KDE’s ‘Breeze’) don’t display checkboxes when a menu item
already has an icon. The result was that unchecked checkboxes
were invisible and checked checkboxes looked strange (like large,
empty rectangles).

With this commit, icons are only added for actions that actually
*have* icons, and the checkboxes are thus correctly displayed no matter
what theme the user has.
parent 1c6679c9
......@@ -276,7 +276,9 @@ bool KisActionRegistry::propertizeAction(const QString &name, QAction * a)
bool isCheckable = getChildContent(actionXml, "isCheckable") == QString("true");
a->setObjectName(name); // This is helpful, should be added more places in Krita
a->setIcon(KisIconUtils::loadIcon(icon.toLatin1()));
if (!icon.isEmpty()) {
a->setIcon(KisIconUtils::loadIcon(icon.toLatin1()));
}
a->setText(text);
a->setObjectName(name);
a->setWhatsThis(whatsthis);
......
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