add fallback icons for buttons
This commit is contained in:
parent
8b3752ef47
commit
ebeb4089eb
6 changed files with 48 additions and 28 deletions
|
@ -255,8 +255,12 @@ void Conversation::addAttachedFile(const QString& path)
|
|||
QMimeDatabase db;
|
||||
QMimeType type = db.mimeTypeForFile(path);
|
||||
QFileInfo info(path);
|
||||
|
||||
Badge* badge = new Badge(path, info.fileName(), QIcon::fromTheme(type.iconName()));
|
||||
|
||||
QIcon fileIcon = QIcon::fromTheme(type.iconName());
|
||||
if (fileIcon.isNull()) {
|
||||
fileIcon.addFile(QString::fromUtf8(":/images/fallback/dark/big/mail-attachment.svg"), QSize(), QIcon::Normal, QIcon::Off);
|
||||
}
|
||||
Badge* badge = new Badge(path, info.fileName(), fileIcon);
|
||||
|
||||
connect(badge, &Badge::close, this, &Conversation::onBadgeClose);
|
||||
try {
|
||||
|
|
|
@ -271,8 +271,8 @@
|
|||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="smiley-shape">
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
<iconset theme="smiley-shape" resource="../../resources/resources.qrc">
|
||||
<normaloff>:/images/fallback/dark/big/unfavorite.svg</normaloff>:/images/fallback/dark/big/unfavorite.svg</iconset>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<bool>true</bool>
|
||||
|
@ -298,8 +298,8 @@
|
|||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="mail-attachment-symbolic">
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
<iconset theme="mail-attachment-symbolic" resource="../../resources/resources.qrc">
|
||||
<normaloff>:/images/fallback/dark/big/mail-attachment.svg</normaloff>:/images/fallback/dark/big/mail-attachment.svg</iconset>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<bool>true</bool>
|
||||
|
@ -312,8 +312,8 @@
|
|||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="edit-clear-all">
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
<iconset theme="edit-clear-all" resource="../../resources/resources.qrc">
|
||||
<normaloff>:/images/fallback/dark/big/clean.svg</normaloff>:/images/fallback/dark/big/clean.svg</iconset>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<bool>true</bool>
|
||||
|
@ -332,8 +332,8 @@
|
|||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="document-send">
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
<iconset theme="document-send" resource="../../resources/resources.qrc">
|
||||
<normaloff>:/images/fallback/dark/big/send.svg</normaloff>:/images/fallback/dark/big/send.svg</iconset>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<bool>true</bool>
|
||||
|
@ -419,6 +419,8 @@ p, li { white-space: pre-wrap; }
|
|||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<resources>
|
||||
<include location="../../resources/resources.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
|
|
@ -164,6 +164,9 @@ void Preview::applyNewSize()
|
|||
break;
|
||||
default: {
|
||||
QIcon icon = QIcon::fromTheme(info.mime.iconName());
|
||||
if (icon.isNull()) {
|
||||
icon.addFile(QString::fromUtf8(":/images/fallback/dark/big/mail-attachment.svg"), QSize(), QIcon::Normal, QIcon::Off);
|
||||
}
|
||||
widget->setPixmap(icon.pixmap(actualSize));
|
||||
widget->resize(actualSize);
|
||||
}
|
||||
|
@ -264,6 +267,10 @@ void Preview::initializeElements()
|
|||
break;
|
||||
default: {
|
||||
QIcon icon = QIcon::fromTheme(info.mime.iconName());
|
||||
if (icon.isNull()) {
|
||||
icon.addFile(QString::fromUtf8(":/images/fallback/dark/big/mail-attachment.svg"), QSize(), QIcon::Normal, QIcon::Off);
|
||||
}
|
||||
|
||||
widget = new QLabel(parent);
|
||||
widget->setPixmap(icon.pixmap(actualSize));
|
||||
widget->show();
|
||||
|
|
|
@ -482,8 +482,8 @@
|
|||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="user">
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
<iconset theme="user" resource="../../../resources/resources.qrc">
|
||||
<normaloff>:/images/fallback/dark/big/user.svg</normaloff>:/images/fallback/dark/big/user.svg</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
|
@ -852,8 +852,8 @@
|
|||
</layout>
|
||||
<action name="actionSetAvatar">
|
||||
<property name="icon">
|
||||
<iconset theme="photo">
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
<iconset theme="photo" resource="../../../resources/resources.qrc">
|
||||
<normaloff>:/images/fallback/dark/big/edit-rename.svg</normaloff>:/images/fallback/dark/big/edit-rename.svg</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Set avatar</string>
|
||||
|
@ -861,8 +861,8 @@
|
|||
</action>
|
||||
<action name="actionClearAvatar">
|
||||
<property name="icon">
|
||||
<iconset theme="edit-clear-all">
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
<iconset theme="edit-clear-all" resource="../../../resources/resources.qrc">
|
||||
<normaloff>:/images/fallback/dark/big/clean.svg</normaloff>:/images/fallback/dark/big/clean.svg</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Clear avatar</string>
|
||||
|
@ -886,7 +886,7 @@
|
|||
<tabstop>description</tabstop>
|
||||
</tabstops>
|
||||
<resources>
|
||||
<include location="../../resources/resources.qrc"/>
|
||||
<include location="../../../resources/resources.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue