Skip to content

Commit

Permalink
Add support for themeIcons to the juiCompiler
Browse files Browse the repository at this point in the history
Change-Id: I46cd15d9e17c5ac1444fa85fe0188b042259a87d
Reviewed-on: http://gerrit.smar.fi/1296
Reviewed-by: Samu Voutilainen <smar@smar.fi>
  • Loading branch information
seijikun authored and Smarre committed Sep 8, 2015
1 parent f16d275 commit a015085
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions juic/javawriteinitialization.cpp
Expand Up @@ -1279,10 +1279,17 @@ QString WriteInitialization::pixCall(DomProperty *p) const
s = p->elementPixmap()->text();
}

if (s.isEmpty())
return "new " + type + QLatin1String("()");
else if (findImage(s) != 0)
if (s.isEmpty()){
if(type == QLatin1String("QIcon") &&
p->elementIconSet()->attributeTheme() != QLatin1String("")){
QString iconName = p->elementIconSet()->attributeTheme();
return "QIcon.fromTheme(" + javaFixString(iconName) + QLatin1String(");");
}else {
return "new " + type + QLatin1String("()");
}
} else if (findImage(s) != 0){
return QLatin1String("icon(") + s + QLatin1String("_ID)");
}

return "new " + type + QLatin1String("(") + pixFunc + QLatin1String("(") + javaFixString(s) + QLatin1String(")") + QLatin1String(")");
}
Expand Down

0 comments on commit a015085

Please sign in to comment.