Skip to content

Commit

Permalink
+ fixes #1877: associate a grayed out icon with Freecad's backup file…
Browse files Browse the repository at this point in the history
…s (fcstd1)
  • Loading branch information
wwmayer committed Dec 28, 2014
1 parent e329cb5 commit 51c017a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Gui/FileDialog.cpp
Expand Up @@ -453,6 +453,18 @@ QIcon FileIconProvider::icon(IconType type) const

QIcon FileIconProvider::icon(const QFileInfo & info) const
{
if (info.suffix().toLower() == QLatin1String("fcstd")) {
// return QApplication::windowIcon();
return QIcon(QString::fromLatin1(":/icons/freecad-doc.png"));
}
else if (info.suffix().toLower().startsWith(QLatin1String("fcstd"))) {
QIcon icon(QString::fromLatin1(":/icons/freecad-doc.png"));
QIcon darkIcon;
int w = QApplication::style()->pixelMetric(QStyle::PM_ListViewIconSize);
darkIcon.addPixmap(icon.pixmap(w, w, QIcon::Disabled, QIcon::Off), QIcon::Normal, QIcon::Off);
darkIcon.addPixmap(icon.pixmap(w, w, QIcon::Disabled, QIcon::On ), QIcon::Normal, QIcon::On );
return darkIcon;
}
return QFileIconProvider::icon(info);
}

Expand Down

0 comments on commit 51c017a

Please sign in to comment.