Added shared misc icons.

This commit is contained in:
Martin Rotter 2016-05-03 06:54:43 +02:00
parent 2587482692
commit e1742d82e1
24 changed files with 19 additions and 15 deletions

View File

@ -451,7 +451,7 @@ if(WIN32)
install(FILES ${APP_DLLS_QT5_MSVC2013_PLATFORMS} DESTINATION ./platforms) install(FILES ${APP_DLLS_QT5_MSVC2013_PLATFORMS} DESTINATION ./platforms)
install(FILES ${APP_DLLS_QT5_MSVC2013_SQLDRIVERS} DESTINATION ./sqldrivers) install(FILES ${APP_DLLS_QT5_MSVC2013_SQLDRIVERS} DESTINATION ./sqldrivers)
install(FILES ${MISC_ICONS} DESTINATION ./icons/) install(DIRECTORY resources/graphics/misc DESTINATION ./icons)
install(FILES resources/graphics/Faenza/index.theme DESTINATION ./icons/Faenza) install(FILES resources/graphics/Faenza/index.theme DESTINATION ./icons/Faenza)
install(DIRECTORY ${FAENZA_FOLDERS} DESTINATION ./icons/Faenza) install(DIRECTORY ${FAENZA_FOLDERS} DESTINATION ./icons/Faenza)
@ -498,7 +498,7 @@ elseif(APPLE)
# Setup custom "bundle" prefix. # Setup custom "bundle" prefix.
set(APPLE_PREFIX ${CMAKE_INSTALL_PREFIX}/${EXE_NAME}.app/Contents/Resources) set(APPLE_PREFIX ${CMAKE_INSTALL_PREFIX}/${EXE_NAME}.app/Contents/Resources)
install(FILES ${MISC_ICONS} DESTINATION ${APPLE_PREFIX}/icons/) install(DIRECTORY resources/graphics/misc DESTINATION ${APPLE_PREFIX}/icons)
install(FILES resources/graphics/Faenza/index.theme DESTINATION ${APPLE_PREFIX}/icons/Faenza) install(FILES resources/graphics/Faenza/index.theme DESTINATION ${APPLE_PREFIX}/icons/Faenza)
install(DIRECTORY ${FAENZA_FOLDERS} DESTINATION ${APPLE_PREFIX}/icons/Faenza) install(DIRECTORY ${FAENZA_FOLDERS} DESTINATION ${APPLE_PREFIX}/icons/Faenza)
@ -514,7 +514,7 @@ elseif(UNIX)
install(TARGETS ${EXE_NAME} RUNTIME DESTINATION bin) install(TARGETS ${EXE_NAME} RUNTIME DESTINATION bin)
install(FILES ${MISC_ICONS} DESTINATION share/${APP_LOW_NAME}/icons) install(DIRECTORY resources/graphics/misc DESTINATION share/${APP_LOW_NAME}/icons)
install(DIRECTORY resources/initial_feeds DESTINATION share/${APP_LOW_NAME}) install(DIRECTORY resources/initial_feeds DESTINATION share/${APP_LOW_NAME})
install(DIRECTORY resources/skins/base DESTINATION share/${APP_LOW_NAME}/skins) install(DIRECTORY resources/skins/base DESTINATION share/${APP_LOW_NAME}/skins)
install(DIRECTORY resources/misc DESTINATION share/${APP_LOW_NAME}) install(DIRECTORY resources/misc DESTINATION share/${APP_LOW_NAME})

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 809 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 614 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 744 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 824 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 906 B

View File

Before

Width:  |  Height:  |  Size: 342 B

After

Width:  |  Height:  |  Size: 342 B

View File

Before

Width:  |  Height:  |  Size: 243 B

After

Width:  |  Height:  |  Size: 243 B

View File

Before

Width:  |  Height:  |  Size: 397 B

After

Width:  |  Height:  |  Size: 397 B

View File

@ -455,7 +455,7 @@ void FormSettings::loadLanguage() {
item->setText(1, language.m_code); item->setText(1, language.m_code);
item->setText(2, language.m_version); item->setText(2, language.m_version);
item->setText(3, language.m_author); item->setText(3, language.m_author);
item->setIcon(0, qApp->icons()->fromTheme(QString(FLAG_ICON_SUBFOLDER) + QDir::separator() + language.m_code)); item->setIcon(0, qApp->icons()->miscIcon(QString(FLAG_ICON_SUBFOLDER) + QDir::separator() + language.m_code));
} }
QList<QTreeWidgetItem*> matching_items = m_ui->m_treeLanguages->findItems(qApp->localization()->loadedLanguage(), Qt::MatchContains, 1); QList<QTreeWidgetItem*> matching_items = m_ui->m_treeLanguages->findItems(qApp->localization()->loadedLanguage(), Qt::MatchContains, 1);

View File

@ -17,10 +17,7 @@ QVariant MessageTextBrowser::loadResource(int type, const QUrl &name) {
switch (type) { switch (type) {
case QTextDocument::ImageResource: { case QTextDocument::ImageResource: {
if (m_imagePlaceholder.isNull()) { if (m_imagePlaceholder.isNull()) {
// TODO: opravit, zahrnout ten obrázek asi. m_imagePlaceholder = qApp->icons()->miscPixmap(QSL("image-placeholder")).scaledToWidth(20, Qt::FastTransformation);
m_imagePlaceholder = QPixmap(QString(APP_THEME_PATH) +
QDir::separator() +
QSL("image-placeholder.png")).scaledToWidth(20, Qt::FastTransformation);
} }
emit imageRequested(name.toString()); emit imageRequested(name.toString());

View File

@ -70,6 +70,14 @@ QIcon IconFactory::fromTheme(const QString &name) {
return QIcon::fromTheme(name); return QIcon::fromTheme(name);
} }
QPixmap IconFactory::miscPixmap(const QString &name) {
return QPixmap(QString(APP_THEME_PATH) + QDir::separator() + "misc" + QDir::separator() + name + ".png");
}
QIcon IconFactory::miscIcon(const QString &name) {
return QIcon(QString(APP_THEME_PATH) + QDir::separator() + "misc" + QDir::separator() + name + ".png");
}
void IconFactory::setupSearchPaths() { void IconFactory::setupSearchPaths() {
QIcon::setThemeSearchPaths(QIcon::themeSearchPaths() << APP_THEME_PATH); QIcon::setThemeSearchPaths(QIcon::themeSearchPaths() << APP_THEME_PATH);
qDebug("Available icon theme paths: %s.", qDebug("Available icon theme paths: %s.",
@ -120,7 +128,7 @@ QStringList IconFactory::installedIconThemes() const {
icon_themes_paths.removeDuplicates(); icon_themes_paths.removeDuplicates();
foreach (const QString &icon_path, icon_themes_paths) { foreach (const QString &icon_path, icon_themes_paths) {
const QDir icon_dir(icon_path); const QDir icon_dir(icon_path);
// Iterate all icon themes in this directory. // Iterate all icon themes in this directory.
foreach (const QFileInfo &icon_theme_path, icon_dir.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot | foreach (const QFileInfo &icon_theme_path, icon_dir.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot |

View File

@ -50,6 +50,9 @@ class IconFactory : public QObject {
// "no icon theme" is set. // "no icon theme" is set.
QIcon fromTheme(const QString &name); QIcon fromTheme(const QString &name);
QPixmap miscPixmap(const QString &name);
QIcon miscIcon(const QString &name);
// Adds custom application path to be search for icons. // Adds custom application path to be search for icons.
void setupSearchPaths(); void setupSearchPaths();

View File

@ -70,8 +70,6 @@ QString OwnCloudServiceEntryPoint::author() const {
} }
QIcon OwnCloudServiceEntryPoint::icon() const { QIcon OwnCloudServiceEntryPoint::icon() const {
return QIcon(QString(APP_THEME_PATH) + return qApp->icons()->miscIcon(QSL("owncloud"));
QDir::separator() +
QSL("owncloud.png"));
} }

View File

@ -59,9 +59,7 @@ QString TtRssServiceEntryPoint::author() const {
} }
QIcon TtRssServiceEntryPoint::icon() const { QIcon TtRssServiceEntryPoint::icon() const {
return QIcon(QString(APP_THEME_PATH) + return qApp->icons()->miscIcon(QSL("tt-rss"));
QDir::separator() +
QSL("tt-rss.png"));
} }
QString TtRssServiceEntryPoint::code() const { QString TtRssServiceEntryPoint::code() const {