diff --git a/client.qrc b/client.qrc
deleted file mode 100644
index bb284644a..000000000
--- a/client.qrc
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
- resources/settings.png
- resources/settings@2x.png
- resources/activity.svg
- resources/activity.png
- resources/activity@2x.png
- resources/network.png
- resources/network@2x.png
- resources/lock-http.png
- resources/lock-http@2x.png
- resources/lock-https.png
- resources/lock-https@2x.png
- resources/account.png
- resources/account.svg
- resources/more.svg
- resources/delete.png
- resources/close.svg
- resources/bell.svg
- resources/link.svg
- resources/files.svg
- resources/state-error.svg
- resources/state-warning.svg
- resources/folder.svg
- resources/network.svg
- resources/settings.svg
- resources/public-white.svg
- resources/public.svg
- resources/confirm.svg
- resources/copy.svg
- resources/state-sync.svg
- resources/add.png
- resources/add-color.svg
- resources/state-info.svg
- resources/change.svg
- resources/delete-color.svg
-
-
-
- src/gui/tray/Window.qml
- src/gui/tray/UserLine.qml
-
-
diff --git a/resources.qrc b/resources.qrc
new file mode 100644
index 000000000..60e0f0a6e
--- /dev/null
+++ b/resources.qrc
@@ -0,0 +1,6 @@
+
+
+ src/gui/tray/Window.qml
+ src/gui/tray/UserLine.qml
+
+
diff --git a/resources/account.png b/resources/account.png
deleted file mode 100644
index e2eede81d..000000000
Binary files a/resources/account.png and /dev/null differ
diff --git a/resources/account@2x.png b/resources/account@2x.png
deleted file mode 100644
index c227f8d77..000000000
Binary files a/resources/account@2x.png and /dev/null differ
diff --git a/resources/activity.png b/resources/activity.png
deleted file mode 100644
index a05e841c8..000000000
Binary files a/resources/activity.png and /dev/null differ
diff --git a/resources/activity.svg b/resources/activity.svg
deleted file mode 100644
index 496b7cad8..000000000
--- a/resources/activity.svg
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
diff --git a/resources/activity@2x.png b/resources/activity@2x.png
deleted file mode 100644
index 8d4ae9f70..000000000
Binary files a/resources/activity@2x.png and /dev/null differ
diff --git a/resources/add.png b/resources/add.png
deleted file mode 100644
index 2c624c182..000000000
Binary files a/resources/add.png and /dev/null differ
diff --git a/resources/bell.svg b/resources/bell.svg
deleted file mode 100644
index 1bc88f4c3..000000000
--- a/resources/bell.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
diff --git a/resources/close.svg b/resources/close.svg
deleted file mode 100644
index c58fe6379..000000000
--- a/resources/close.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
diff --git a/resources/delete.png b/resources/delete.png
deleted file mode 100644
index e891b370c..000000000
Binary files a/resources/delete.png and /dev/null differ
diff --git a/resources/link.svg b/resources/link.svg
deleted file mode 100644
index 08127c001..000000000
--- a/resources/link.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/resources/lock-http.png b/resources/lock-http.png
deleted file mode 100644
index dbdbefb1e..000000000
Binary files a/resources/lock-http.png and /dev/null differ
diff --git a/resources/lock-http.svg b/resources/lock-http.svg
deleted file mode 100644
index a2e25cfae..000000000
--- a/resources/lock-http.svg
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
diff --git a/resources/lock-http@2x.png b/resources/lock-http@2x.png
deleted file mode 100644
index 94b169006..000000000
Binary files a/resources/lock-http@2x.png and /dev/null differ
diff --git a/resources/lock-https.png b/resources/lock-https.png
deleted file mode 100644
index a59c4e3af..000000000
Binary files a/resources/lock-https.png and /dev/null differ
diff --git a/resources/lock-https.svg b/resources/lock-https.svg
deleted file mode 100644
index acfd2a5ec..000000000
--- a/resources/lock-https.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
diff --git a/resources/lock-https@2x.png b/resources/lock-https@2x.png
deleted file mode 100644
index 733e5ffd9..000000000
Binary files a/resources/lock-https@2x.png and /dev/null differ
diff --git a/resources/more.svg b/resources/more.svg
deleted file mode 100644
index 9ab5d4243..000000000
--- a/resources/more.svg
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
diff --git a/resources/network.png b/resources/network.png
deleted file mode 100644
index bed57f7de..000000000
Binary files a/resources/network.png and /dev/null differ
diff --git a/resources/network@2x.png b/resources/network@2x.png
deleted file mode 100644
index 5190c9a82..000000000
Binary files a/resources/network@2x.png and /dev/null differ
diff --git a/resources/public-white.svg b/resources/public-white.svg
deleted file mode 100644
index d85defb6a..000000000
--- a/resources/public-white.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/resources/settings.png b/resources/settings.png
deleted file mode 100644
index b7c6b11dd..000000000
Binary files a/resources/settings.png and /dev/null differ
diff --git a/resources/state-error.svg b/resources/state-error.svg
deleted file mode 100644
index 224ce8626..000000000
--- a/resources/state-error.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/resources/state-info.svg b/resources/state-info.svg
deleted file mode 100644
index 14b52e326..000000000
--- a/resources/state-info.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/resources/state-sync.svg b/resources/state-sync.svg
deleted file mode 100644
index 658d1b40e..000000000
--- a/resources/state-sync.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/resources/state-warning.svg b/resources/state-warning.svg
deleted file mode 100644
index a738cdbc8..000000000
--- a/resources/state-warning.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/src/3rdparty/kmessagewidget/kmessagewidget.cpp b/src/3rdparty/kmessagewidget/kmessagewidget.cpp
index cd3563a1d..c0166f622 100644
--- a/src/3rdparty/kmessagewidget/kmessagewidget.cpp
+++ b/src/3rdparty/kmessagewidget/kmessagewidget.cpp
@@ -94,7 +94,7 @@ void KMessageWidgetPrivate::init(KMessageWidget *q_ptr)
QAction *closeAction = new QAction(q);
closeAction->setText(KMessageWidget::tr("&Close"));
closeAction->setToolTip(KMessageWidget::tr("Close message"));
- closeAction->setIcon(QIcon(":/client/resources/close.svg")); // ivan: NC customization
+ closeAction->setIcon(QIcon(":/client/theme/close.svg")); // ivan: NC customization
QObject::connect(closeAction, &QAction::triggered, q, &KMessageWidget::animatedHide);
diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt
index 4ccf3abaa..3cc80a1df 100644
--- a/src/gui/CMakeLists.txt
+++ b/src/gui/CMakeLists.txt
@@ -5,8 +5,7 @@ set(CMAKE_AUTOUIC TRUE)
set(CMAKE_AUTORCC TRUE)
add_subdirectory(updater)
-#TODO Move resources files
-set(MIRALL_RC_SRC ../../client.qrc)
+set(MIRALL_RC_SRC ../../resources.qrc)
if (EXISTS "${OEM_THEME_DIR}/theme.qrc")
list(APPEND MIRALL_RC_SRC ${OEM_THEME_DIR}/theme.qrc)
set(theme_dir ${OEM_THEME_DIR}/theme)
diff --git a/src/gui/folderstatusdelegate.cpp b/src/gui/folderstatusdelegate.cpp
index 4b8899a05..d7ba865a4 100644
--- a/src/gui/folderstatusdelegate.cpp
+++ b/src/gui/folderstatusdelegate.cpp
@@ -217,7 +217,7 @@ void FolderStatusDelegate::paint(QPainter *painter, const QStyleOptionViewItem &
warnRect.setWidth(16);
warnRect.setHeight(16);
- QIcon warnIcon(":/client/resources/warning");
+ QIcon warnIcon(":/client/theme/warning");
QPixmap pm = warnIcon.pixmap(16, 16, syncEnabled ? QIcon::Normal : QIcon::Disabled);
warnRect = QStyle::visualRect(option.direction, option.rect, warnRect);
painter->drawPixmap(QPoint(warnRect.left(), warnRect.top()), pm);
@@ -440,7 +440,7 @@ void FolderStatusDelegate::slotStyleChanged()
void FolderStatusDelegate::customizeStyle()
{
- _iconMore = Theme::createColorAwareIcon(QLatin1String(":/client/resources/more.svg"));
+ _iconMore = Theme::createColorAwareIcon(QLatin1String(":/client/theme/more.svg"));
}
} // namespace OCC
diff --git a/src/gui/folderstatusmodel.cpp b/src/gui/folderstatusmodel.cpp
index 319436cd2..3f0d20adf 100644
--- a/src/gui/folderstatusmodel.cpp
+++ b/src/gui/folderstatusmodel.cpp
@@ -159,7 +159,7 @@ QVariant FolderStatusModel::data(const QModelIndex &index, int role) const
return x._checked;
case Qt::DecorationRole:
if (_accountState->account()->e2e()->isFolderEncrypted(x._path)) {
- return QIcon(QLatin1String(":/client/resources/lock-https.png"));
+ return QIcon(QLatin1String(":/client/theme/lock-https.svg"));
}
return QFileIconProvider().icon(x._isExternal ? QFileIconProvider::Network : QFileIconProvider::Folder);
case Qt::ForegroundRole:
diff --git a/src/gui/main.cpp b/src/gui/main.cpp
index c29720d69..1224869b8 100644
--- a/src/gui/main.cpp
+++ b/src/gui/main.cpp
@@ -46,7 +46,7 @@ void warnSystray()
int main(int argc, char **argv)
{
- Q_INIT_RESOURCE(client);
+ Q_INIT_RESOURCE(resources);
// OpenSSL 1.1.0: No explicit initialisation or de-initialisation is necessary.
diff --git a/src/gui/settingsdialog.cpp b/src/gui/settingsdialog.cpp
index 53ff923b8..206e4d444 100644
--- a/src/gui/settingsdialog.cpp
+++ b/src/gui/settingsdialog.cpp
@@ -97,7 +97,7 @@ SettingsDialog::SettingsDialog(ownCloudGui *gui, QWidget *parent)
spacer->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Minimum);
_toolBar->addWidget(spacer);
- QAction *generalAction = createColorAwareAction(QLatin1String(":/client/resources/settings.png"), tr("General"));
+ QAction *generalAction = createColorAwareAction(QLatin1String(":/client/theme/settings.svg"), tr("General"));
_actionGroup->addAction(generalAction);
_toolBar->addAction(generalAction);
GeneralSettings *generalSettings = new GeneralSettings;
@@ -106,7 +106,7 @@ SettingsDialog::SettingsDialog(ownCloudGui *gui, QWidget *parent)
// Connect styleChanged events to our widgets, so they can adapt (Dark-/Light-Mode switching)
connect(this, &SettingsDialog::styleChanged, generalSettings, &GeneralSettings::slotStyleChanged);
- QAction *networkAction = createColorAwareAction(QLatin1String(":/client/resources/network.png"), tr("Network"));
+ QAction *networkAction = createColorAwareAction(QLatin1String(":/client/theme/network.svg"), tr("Network"));
_actionGroup->addAction(networkAction);
_toolBar->addAction(networkAction);
NetworkSettings *networkSettings = new NetworkSettings;
@@ -206,7 +206,7 @@ void SettingsDialog::accountAdded(AccountState *s)
QImage avatar = s->account()->avatar();
const QString actionText = brandingSingleAccount ? tr("Account") : s->account()->displayName();
if (avatar.isNull()) {
- accountAction = createColorAwareAction(QLatin1String(":/client/resources/account.png"),
+ accountAction = createColorAwareAction(QLatin1String(":/client/theme/account.svg"),
actionText);
} else {
QIcon icon(QPixmap::fromImage(AvatarJob::makeCircularAvatar(avatar)));
diff --git a/src/gui/sharelinkwidget.cpp b/src/gui/sharelinkwidget.cpp
index 62ed18da8..e531ae2ab 100644
--- a/src/gui/sharelinkwidget.cpp
+++ b/src/gui/sharelinkwidget.cpp
@@ -232,15 +232,15 @@ void ShareLinkWidget::setupUiOptions()
}
// Adds action to unshare widget (check box)
- _unshareLinkAction = _linkContextMenu->addAction(QIcon(":/client/resources/delete.png"),
+ _unshareLinkAction = _linkContextMenu->addAction(QIcon(":/client/theme/delete.svg"),
tr("Unshare"));
_linkContextMenu->addSeparator();
- _addAnotherLinkAction = _linkContextMenu->addAction(QIcon(":/client/resources/add.png"),
+ _addAnotherLinkAction = _linkContextMenu->addAction(QIcon(":/client/theme/add.svg"),
tr("Add another link"));
- _ui->enableShareLink->setIcon(QIcon(":/client/resources/copy.svg"));
+ _ui->enableShareLink->setIcon(QIcon(":/client/theme/copy.svg"));
disconnect(_ui->enableShareLink, &QPushButton::clicked, this, &ShareLinkWidget::slotCreateShareLink);
connect(_ui->enableShareLink, &QPushButton::clicked, this, &ShareLinkWidget::slotCopyLinkShare);
@@ -560,19 +560,19 @@ void ShareLinkWidget::slotStyleChanged()
void ShareLinkWidget::customizeStyle()
{
- _unshareLinkAction->setIcon(Theme::createColorAwareIcon(":/client/resources/delete.png"));
+ _unshareLinkAction->setIcon(Theme::createColorAwareIcon(":/client/theme/delete.svg"));
- _addAnotherLinkAction->setIcon(Theme::createColorAwareIcon(":/client/resources/add.png"));
+ _addAnotherLinkAction->setIcon(Theme::createColorAwareIcon(":/client/theme/add.svg"));
- _ui->enableShareLink->setIcon(Theme::createColorAwareIcon(":/client/resources/copy.svg"));
+ _ui->enableShareLink->setIcon(Theme::createColorAwareIcon(":/client/theme/copy.svg"));
- _ui->shareLinkIconLabel->setPixmap(Theme::createColorAwarePixmap(":/client/resources/public.svg"));
+ _ui->shareLinkIconLabel->setPixmap(Theme::createColorAwarePixmap(":/client/theme/public.svg"));
- _ui->shareLinkToolButton->setIcon(Theme::createColorAwareIcon(":/client/resources/more.svg"));
+ _ui->shareLinkToolButton->setIcon(Theme::createColorAwareIcon(":/client/theme/more.svg"));
- _ui->confirmNote->setIcon(Theme::createColorAwareIcon(":/client/resources/confirm.svg"));
- _ui->confirmPassword->setIcon(Theme::createColorAwareIcon(":/client/resources/confirm.svg"));
- _ui->confirmExpirationDate->setIcon(Theme::createColorAwareIcon(":/client/resources/confirm.svg"));
+ _ui->confirmNote->setIcon(Theme::createColorAwareIcon(":/client/theme/confirm.svg"));
+ _ui->confirmPassword->setIcon(Theme::createColorAwareIcon(":/client/theme/confirm.svg"));
+ _ui->confirmExpirationDate->setIcon(Theme::createColorAwareIcon(":/client/theme/confirm.svg"));
_ui->progressIndicator->setColor(QGuiApplication::palette().color(QPalette::Text));
}
diff --git a/src/gui/sharelinkwidget.ui b/src/gui/sharelinkwidget.ui
index 90cd61067..ec520fd7d 100644
--- a/src/gui/sharelinkwidget.ui
+++ b/src/gui/sharelinkwidget.ui
@@ -25,7 +25,7 @@
- :/client/resources/public.svg
+ :/client/theme/public.svg
Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
@@ -74,8 +74,8 @@
-
- :/client/resources/add.png:/client/resources/add.png
+
+ :/client/theme/add.svg:/client/theme/add.svg
false
@@ -97,8 +97,8 @@
-
- :/client/resources/more.svg:/client/resources/more.svg
+
+ :/client/theme/more.svg:/client/theme/more.svg
QToolButton::InstantPopup
@@ -162,8 +162,8 @@
-
-
- :/client/resources/confirm.svg:/client/resources/confirm.svg
+
+ :/client/theme/confirm.svg:/client/theme/confirm.svg
true
@@ -215,8 +215,8 @@
-
-
- :/client/resources/confirm.svg:/client/resources/confirm.svg
+
+ :/client/theme/confirm.svg:/client/theme/confirm.svg
true
@@ -265,8 +265,8 @@
-
-
- :/client/resources/confirm.svg:/client/resources/confirm.svg
+
+ :/client/theme/confirm.svg:/client/theme/confirm.svg
true
@@ -337,7 +337,7 @@
-
+
diff --git a/src/gui/shareusergroupwidget.cpp b/src/gui/shareusergroupwidget.cpp
index 0a58d61a5..0a2bea6ab 100644
--- a/src/gui/shareusergroupwidget.cpp
+++ b/src/gui/shareusergroupwidget.cpp
@@ -266,7 +266,7 @@ void ShareUserGroupWidget::slotPrivateLinkShare()
menu->setAttribute(Qt::WA_DeleteOnClose);
// this icon is not handled by slotStyleChanged() -> customizeStyle but we can live with that
- menu->addAction(Theme::createColorAwareIcon(":/client/resources/copy.svg"),
+ menu->addAction(Theme::createColorAwareIcon(":/client/theme/copy.svg"),
tr("Copy link"),
this, SLOT(slotPrivateLinkCopy()));
@@ -379,7 +379,7 @@ void ShareUserGroupWidget::slotStyleChanged()
void ShareUserGroupWidget::customizeStyle()
{
- _ui->confirmShare->setIcon(Theme::createColorAwareIcon(":/client/resources/confirm.svg"));
+ _ui->confirmShare->setIcon(Theme::createColorAwareIcon(":/client/theme/confirm.svg"));
_pi_sharee.setColor(QGuiApplication::palette().color(QPalette::Text));
@@ -421,7 +421,7 @@ ShareUserLine::ShareUserLine(QSharedPointer share,
menu->addSeparator();
// Adds action to delete share widget
- QIcon deleteicon = QIcon::fromTheme(QLatin1String("user-trash"),QIcon(QLatin1String(":/client/resources/delete.png")));
+ QIcon deleteicon = QIcon::fromTheme(QLatin1String("user-trash"),QIcon(QLatin1String(":/client/theme/delete.svg")));
_deleteShareButton= new QAction(deleteicon,tr("Unshare"), this);
menu->addAction(_deleteShareButton);
@@ -453,10 +453,6 @@ ShareUserLine::ShareUserLine(QSharedPointer share,
_ui->permissionToolButton->setMenu(menu);
_ui->permissionToolButton->setPopupMode(QToolButton::InstantPopup);
- // icon now set in: customizeStyle
- /*QIcon icon(QLatin1String(":/client/resources/more.svg"));
- _ui->permissionToolButton->setIcon(icon);*/
-
// Set the permissions checkboxes
displayPermissions();
@@ -474,9 +470,6 @@ ShareUserLine::ShareUserLine(QSharedPointer share,
connect(share.data(), &Share::permissionsSet, this, &ShareUserLine::slotPermissionsSet);
connect(share.data(), &Share::shareDeleted, this, &ShareUserLine::slotShareDeleted);
- // _ui->deleteShareButton->setIcon(QIcon::fromTheme(QLatin1String("user-trash"),
- // QIcon(QLatin1String(":/client/resources/delete.png"))));
-
if (!share->account()->capabilities().shareResharing()) {
_permissionReshare->setVisible(false);
}
@@ -686,9 +679,9 @@ void ShareUserLine::slotStyleChanged()
void ShareUserLine::customizeStyle()
{
- _ui->permissionToolButton->setIcon(Theme::createColorAwareIcon(":/client/resources/more.svg"));
+ _ui->permissionToolButton->setIcon(Theme::createColorAwareIcon(":/client/theme/more.svg"));
- QIcon deleteicon = QIcon::fromTheme(QLatin1String("user-trash"),Theme::createColorAwareIcon(QLatin1String(":/client/resources/delete.png")));
+ QIcon deleteicon = QIcon::fromTheme(QLatin1String("user-trash"),Theme::createColorAwareIcon(QLatin1String(":/client/theme/delete.svg")));
_deleteShareButton->setIcon(deleteicon);
}
diff --git a/src/gui/shareusergroupwidget.ui b/src/gui/shareusergroupwidget.ui
index ab4c91797..e5b194699 100644
--- a/src/gui/shareusergroupwidget.ui
+++ b/src/gui/shareusergroupwidget.ui
@@ -63,8 +63,8 @@
-
-
- :/client/resources/confirm.svg:/client/resources/confirm.svg
+
+ :/client/theme/confirm.svg:/client/theme/confirm.svg
true
@@ -133,7 +133,7 @@
-
+
diff --git a/src/gui/shareuserline.ui b/src/gui/shareuserline.ui
index 8049607a6..b947aed3c 100644
--- a/src/gui/shareuserline.ui
+++ b/src/gui/shareuserline.ui
@@ -93,8 +93,8 @@
-
-
- :/client/resources/more.svg:/client/resources/more.svg
+
+ :/client/theme/more.svg:/client/theme/more.svg
true
@@ -111,7 +111,7 @@
-
+
diff --git a/src/gui/sslbutton.cpp b/src/gui/sslbutton.cpp
index 0efdc6f7c..8b4bd6e40 100644
--- a/src/gui/sslbutton.cpp
+++ b/src/gui/sslbutton.cpp
@@ -169,11 +169,11 @@ void SslButton::updateAccountState(AccountState *accountState)
AccountPtr account = _accountState->account();
if (account->url().scheme() == QLatin1String("https")) {
- setIcon(QIcon(QLatin1String(":/client/resources/lock-https.png")));
+ setIcon(QIcon(QLatin1String(":/client/theme/lock-https.svg")));
QSslCipher cipher = account->_sessionCipher;
setToolTip(tr("This connection is encrypted using %1 bit %2.\n").arg(cipher.usedBits()).arg(cipher.name()));
} else {
- setIcon(QIcon(QLatin1String(":/client/resources/lock-http.png")));
+ setIcon(QIcon(QLatin1String(":/client/theme/lock-http.svg")));
setToolTip(tr("This connection is NOT secure as it is not encrypted.\n"));
}
}
diff --git a/src/gui/tray/ActivityListModel.cpp b/src/gui/tray/ActivityListModel.cpp
index a9b2efc64..d1d06c765 100644
--- a/src/gui/tray/ActivityListModel.cpp
+++ b/src/gui/tray/ActivityListModel.cpp
@@ -137,11 +137,11 @@ QVariant ActivityListModel::data(const QModelIndex &index, int role) const
} else {
// File sync successful
if (a._fileAction == "file_created") {
- return "qrc:///client/resources/add-color.svg";
+ return "qrc:///client/theme/colored/add.svg";
} else if (a._fileAction == "file_deleted") {
- return "qrc:///client/resources/delete-color.svg";
+ return "qrc:///client/theme/colored/delete.svg";
} else {
- return "qrc:///client/resources/change.svg";
+ return "qrc:///client/theme/change.svg";
}
}
} else {
diff --git a/src/gui/tray/UserLine.qml b/src/gui/tray/UserLine.qml
index 357be6005..10fb36122 100644
--- a/src/gui/tray/UserLine.qml
+++ b/src/gui/tray/UserLine.qml
@@ -104,7 +104,7 @@ MenuItem {
Layout.preferredHeight: userLineLayout.height
flat: true
- icon.source: "qrc:///client/resources/more.svg"
+ icon.source: "qrc:///client/theme/more.svg"
icon.color: "transparent"
MouseArea {
diff --git a/src/gui/tray/Window.qml b/src/gui/tray/Window.qml
index 5a040c970..865e9e130 100644
--- a/src/gui/tray/Window.qml
+++ b/src/gui/tray/Window.qml
@@ -563,7 +563,7 @@ Window {
hoverEnabled: false
visible: (path === "") ? false : true
display: AbstractButton.IconOnly
- icon.source: "qrc:///client/resources/files.svg"
+ icon.source: "qrc:///client/theme/files.svg"
icon.color: "transparent"
onClicked: {
@@ -579,7 +579,7 @@ Window {
hoverEnabled: false
visible: (link === "") ? false : true
display: AbstractButton.IconOnly
- icon.source: "qrc:///client/resources/public.svg"
+ icon.source: "qrc:///client/theme/public.svg"
icon.color: "transparent"
onClicked: {
diff --git a/src/gui/wizard/owncloudadvancedsetuppage.cpp b/src/gui/wizard/owncloudadvancedsetuppage.cpp
index 03cfb0661..f83e1f43f 100644
--- a/src/gui/wizard/owncloudadvancedsetuppage.cpp
+++ b/src/gui/wizard/owncloudadvancedsetuppage.cpp
@@ -68,7 +68,9 @@ OwncloudAdvancedSetupPage::OwncloudAdvancedSetupPage()
_ui.lServerIcon->setText(QString());
_ui.lServerIcon->setPixmap(appIcon.pixmap(48));
_ui.lLocalIcon->setText(QString());
- _ui.lLocalIcon->setPixmap(QPixmap(Theme::hidpiFileName(":/client/resources/folder-sync.png")));
+
+ // TO DO: File doesn't exist anymore - unneccessary or replacement needed?
+ _ui.lLocalIcon->setPixmap(QPixmap(Theme::hidpiFileName(":/client/theme/folder-sync.png")));
if (theme->wizardHideExternalStorageConfirmationCheckbox()) {
_ui.confCheckBoxExternal->hide();
diff --git a/src/gui/wizard/owncloudsetuppage.cpp b/src/gui/wizard/owncloudsetuppage.cpp
index 84f160aaf..48f5edba8 100644
--- a/src/gui/wizard/owncloudsetuppage.cpp
+++ b/src/gui/wizard/owncloudsetuppage.cpp
@@ -178,11 +178,11 @@ void OwncloudSetupPage::slotUrlChanged(const QString &url)
}
if (!url.startsWith(QLatin1String("https://"))) {
- _ui.urlLabel->setPixmap(QPixmap(Theme::hidpiFileName(":/client/resources/lock-http.png")));
+ _ui.urlLabel->setPixmap(QPixmap(Theme::hidpiFileName(":/client/theme/lock-http.png")));
_ui.urlLabel->setToolTip(tr("This url is NOT secure as it is not encrypted.\n"
"It is not advisable to use it."));
} else {
- _ui.urlLabel->setPixmap(QPixmap(Theme::hidpiFileName(":/client/resources/lock-https.png")));
+ _ui.urlLabel->setPixmap(QPixmap(Theme::hidpiFileName(":/client/theme/lock-https.png")));
_ui.urlLabel->setToolTip(tr("This url is secure. You can use it."));
}
}
diff --git a/src/gui/wizard/owncloudwizardresultpage.cpp b/src/gui/wizard/owncloudwizardresultpage.cpp
index 6d884e396..79446de37 100644
--- a/src/gui/wizard/owncloudwizardresultpage.cpp
+++ b/src/gui/wizard/owncloudwizardresultpage.cpp
@@ -38,7 +38,8 @@ OwncloudWizardResultPage::OwncloudWizardResultPage()
setSubTitle(QLatin1String(" "));
_ui.pbOpenLocal->setText(tr("Open Local Folder"));
- _ui.pbOpenLocal->setIcon(QIcon(QLatin1String(":/client/resources/folder-sync.png")));
+ // TODO: File doesn't exist anymore - unneccessary or replacement needed?
+ _ui.pbOpenLocal->setIcon(QIcon(QLatin1String(":/client/theme/folder-sync.png")));
_ui.pbOpenLocal->setIconSize(QSize(48, 48));
_ui.pbOpenLocal->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
connect(_ui.pbOpenLocal, &QAbstractButton::clicked, this, &OwncloudWizardResultPage::slotOpenLocal);
diff --git a/src/libsync/CMakeLists.txt b/src/libsync/CMakeLists.txt
index b83061282..663bc1ac8 100644
--- a/src/libsync/CMakeLists.txt
+++ b/src/libsync/CMakeLists.txt
@@ -102,8 +102,8 @@ target_link_libraries(${synclib_NAME}
)
if (NOT TOKEN_AUTH_ONLY)
- find_package(Qt5 REQUIRED COMPONENTS Widgets)
- target_link_libraries(${synclib_NAME} Qt5::Widgets ${QTKEYCHAIN_LIBRARY})
+ find_package(Qt5 REQUIRED COMPONENTS Widgets Svg)
+ target_link_libraries(${synclib_NAME} Qt5::Widgets Qt5::Svg ${QTKEYCHAIN_LIBRARY})
target_include_directories(${synclib_NAME} PRIVATE ${QTKEYCHAIN_INCLUDE_DIR})
endif()
diff --git a/src/libsync/theme.cpp b/src/libsync/theme.cpp
index 08bf11521..8f6dbd83f 100644
--- a/src/libsync/theme.cpp
+++ b/src/libsync/theme.cpp
@@ -24,6 +24,7 @@
#include
#endif
#include
+#include
#include "nextcloudtheme.h"
@@ -141,28 +142,23 @@ QIcon Theme::themeIcon(const QString &name, bool sysTray) const
}
QList sizes;
- sizes << 16 << 22 << 32 << 48 << 64 << 128 << 256 << 512 << 1024;
+ sizes << 16 << 32 << 64 << 128 << 256;
foreach (int size, sizes) {
- QString pixmapName = QString::fromLatin1(":/client/theme/%1/%2-%3.png").arg(flavor).arg(name).arg(size);
- if (QFile::exists(pixmapName)) {
- QPixmap px(pixmapName);
- // HACK, get rid of it by supporting FDO icon themes, this is really just emulating ubuntu-mono
- if (qgetenv("DESKTOP_SESSION") == "ubuntu") {
- QBitmap mask = px.createMaskFromColor(Qt::white, Qt::MaskOutColor);
- QPainter p(&px);
- p.setPen(QColor("#dfdbd2"));
- p.drawPixmap(px.rect(), mask, mask.rect());
- }
- cached.addPixmap(px);
- }
- }
- if (cached.isNull()) {
- foreach (int size, sizes) {
- QString pixmapName = QString::fromLatin1(":/client/resources/%1-%2.png").arg(name).arg(size);
- if (QFile::exists(pixmapName)) {
- cached.addFile(pixmapName);
- }
+ QString svgName = QString::fromLatin1(":/client/theme/%1/%2.svg").arg(flavor).arg(name);
+ QSvgRenderer renderer(svgName);
+ QImage img(size, size, QImage::Format_ARGB32);
+ img.fill(Qt::GlobalColor::transparent);
+ QPainter imgPainter(&img);
+ renderer.render(&imgPainter);
+ auto px = QPixmap::fromImage(img);
+ // HACK, get rid of it by supporting FDO icon themes, this is really just emulating ubuntu-mono
+ if (qgetenv("DESKTOP_SESSION") == "ubuntu") {
+ QBitmap mask = px.createMaskFromColor(Qt::white, Qt::MaskOutColor);
+ QPainter p(&px);
+ p.setPen(QColor("#dfdbd2"));
+ p.drawPixmap(px.rect(), mask, mask.rect());
}
+ cached.addPixmap(px);
}
}
@@ -592,8 +588,17 @@ void Theme::replaceLinkColorString(QString &linkString, const QColor &newColor)
QIcon Theme::createColorAwareIcon(const QString &name, const QPalette &palette)
{
- QImage img(name);
- QImage inverted(img);
+ QSvgRenderer renderer(name);
+ QImage img(64, 64, QImage::Format_ARGB32);
+ img.fill(Qt::GlobalColor::transparent);
+ QPainter imgPainter(&img);
+ QImage inverted(64, 64, QImage::Format_ARGB32);
+ inverted.fill(Qt::GlobalColor::transparent);
+ QPainter invPainter(&inverted);
+
+ renderer.render(&imgPainter);
+ renderer.render(&invPainter);
+
inverted.invertPixels(QImage::InvertRgb);
QIcon icon;
diff --git a/theme.qrc b/theme.qrc
index 2a2881e96..678842632 100644
--- a/theme.qrc
+++ b/theme.qrc
@@ -143,5 +143,21 @@
theme/black/activity.svg
theme/black/bell.svg
theme/black/state-info.svg
+ theme/close.svg
+ theme/files.svg
+ theme/public.svg
+ theme/settings.svg
+ theme/confirm.svg
+ theme/copy.svg
+ theme/more.svg
+ theme/change.svg
+ theme/lock-http.svg
+ theme/lock-https.svg
+ theme/network.svg
+ theme/account.svg
+ theme/colored/add.svg
+ theme/colored/delete.svg
+ theme/colored/Nextcloud-icon.svg
+ theme/colored/Nextcloud-sidebar.svg
diff --git a/resources/account.svg b/theme/account.svg
similarity index 100%
rename from resources/account.svg
rename to theme/account.svg
diff --git a/theme/add.svg b/theme/add.svg
new file mode 100644
index 000000000..4b2d21330
--- /dev/null
+++ b/theme/add.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/resources/change.svg b/theme/change.svg
similarity index 100%
rename from resources/change.svg
rename to theme/change.svg
diff --git a/theme/close.svg b/theme/close.svg
new file mode 100644
index 000000000..30de70b7c
--- /dev/null
+++ b/theme/close.svg
@@ -0,0 +1 @@
+
diff --git a/resources/add-color.svg b/theme/colored/add.svg
similarity index 100%
rename from resources/add-color.svg
rename to theme/colored/add.svg
diff --git a/resources/delete-color.svg b/theme/colored/delete.svg
similarity index 83%
rename from resources/delete-color.svg
rename to theme/colored/delete.svg
index 72aed6b93..f92bad593 100644
--- a/resources/delete-color.svg
+++ b/theme/colored/delete.svg
@@ -1 +1 @@
-
+
\ No newline at end of file
diff --git a/resources/folder.svg b/theme/colored/folder.svg
similarity index 100%
rename from resources/folder.svg
rename to theme/colored/folder.svg
diff --git a/theme/colored/state-pause-128.png b/theme/colored/state-pause-128.png
deleted file mode 100644
index a423df502..000000000
Binary files a/theme/colored/state-pause-128.png and /dev/null differ
diff --git a/theme/colored/state-pause-16.png b/theme/colored/state-pause-16.png
deleted file mode 100644
index 0563bf3f1..000000000
Binary files a/theme/colored/state-pause-16.png and /dev/null differ
diff --git a/theme/colored/state-pause-256.png b/theme/colored/state-pause-256.png
deleted file mode 100644
index cc52d94f3..000000000
Binary files a/theme/colored/state-pause-256.png and /dev/null differ
diff --git a/theme/colored/state-pause-32.png b/theme/colored/state-pause-32.png
deleted file mode 100644
index 5853fa488..000000000
Binary files a/theme/colored/state-pause-32.png and /dev/null differ
diff --git a/theme/colored/state-pause-64.png b/theme/colored/state-pause-64.png
deleted file mode 100644
index 76d6192d8..000000000
Binary files a/theme/colored/state-pause-64.png and /dev/null differ
diff --git a/resources/confirm.svg b/theme/confirm.svg
similarity index 100%
rename from resources/confirm.svg
rename to theme/confirm.svg
diff --git a/resources/copy.svg b/theme/copy.svg
similarity index 100%
rename from resources/copy.svg
rename to theme/copy.svg
diff --git a/theme/delete.svg b/theme/delete.svg
new file mode 100644
index 000000000..cfbac88c5
--- /dev/null
+++ b/theme/delete.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/resources/files.svg b/theme/files.svg
similarity index 100%
rename from resources/files.svg
rename to theme/files.svg
diff --git a/theme/lock-http.svg b/theme/lock-http.svg
new file mode 100644
index 000000000..a77e45536
--- /dev/null
+++ b/theme/lock-http.svg
@@ -0,0 +1 @@
+
diff --git a/theme/lock-https.svg b/theme/lock-https.svg
new file mode 100644
index 000000000..cf013708d
--- /dev/null
+++ b/theme/lock-https.svg
@@ -0,0 +1 @@
+
diff --git a/theme/more.svg b/theme/more.svg
new file mode 100644
index 000000000..8bbdaca10
--- /dev/null
+++ b/theme/more.svg
@@ -0,0 +1 @@
+
diff --git a/resources/network.svg b/theme/network.svg
similarity index 100%
rename from resources/network.svg
rename to theme/network.svg
diff --git a/resources/public.svg b/theme/public.svg
similarity index 100%
rename from resources/public.svg
rename to theme/public.svg
diff --git a/resources/settings.svg b/theme/settings.svg
similarity index 99%
rename from resources/settings.svg
rename to theme/settings.svg
index 8cc9790be..8dfc7a8b9 100644
--- a/resources/settings.svg
+++ b/theme/settings.svg
@@ -11,4 +11,4 @@
-
+
\ No newline at end of file
diff --git a/resources/settings@2x.png b/theme/settings@2x.png
similarity index 100%
rename from resources/settings@2x.png
rename to theme/settings@2x.png