From 71d1fa6f24d54a6888f51aa23e5ca731a1a418c0 Mon Sep 17 00:00:00 2001 From: Jimi Huotari Date: Mon, 10 Sep 2018 14:19:22 +0300 Subject: [PATCH] refactor(themes): load css and images from themes folder Original work by tox-user. The default theme is now placed in a different path: - C:\users\%username%\AppData\roaming\qtox\themes - for Windows - ~/Library/Application Support/qtox/themes - for MacOS - ~/.config/qtox/themes - for other Unix systems including GNU/Linux Thanks to that it's no longer required to recompile the program to modify the theme. In addition to that the default theme is also included as a resource. If the theme folder or some file inside it is missing, qTox will load it from resource. --- CMakeLists.txt | 9 ++ res.qrc | 124 +++++++++--------- src/chatlog/chatmessage.cpp | 9 +- src/chatlog/content/filetransferwidget.cpp | 20 +-- src/chatlog/content/filetransferwidget.ui | 6 +- src/chatlog/content/notificationicon.cpp | 3 +- src/chatlog/content/text.cpp | 2 +- src/video/genericnetcamview.cpp | 4 +- src/widget/categorywidget.cpp | 6 +- src/widget/chatformheader.cpp | 2 +- src/widget/contentdialog.cpp | 4 +- src/widget/contentlayout.cpp | 4 +- src/widget/emoticonswidget.cpp | 2 +- src/widget/form/filesform.cpp | 3 +- src/widget/form/genericchatform.cpp | 12 +- src/widget/form/groupchatform.cpp | 2 +- src/widget/form/profileform.cpp | 2 +- src/widget/form/searchsettingsform.cpp | 8 +- src/widget/loginscreen.cpp | 2 +- src/widget/notificationedgewidget.cpp | 6 +- src/widget/searchform.cpp | 6 +- src/widget/style.cpp | 111 +++++++++++++++- src/widget/style.h | 3 + src/widget/tool/callconfirmwidget.cpp | 5 +- src/widget/widget.cpp | 20 +-- .../default}/acceptCall/acceptCall.svg | 0 {ui => themes/default}/chatArea/chatArea.css | 0 {ui => themes/default}/chatArea/chatHead.css | 0 {ui => themes/default}/chatArea/error.svg | 0 {ui => themes/default}/chatArea/info.svg | 0 .../default}/chatArea/innerStyle.css | 0 .../default}/chatArea/scrollBarDownArrow.svg | 0 .../default}/chatArea/scrollBarLeftArrow.svg | 0 .../default}/chatArea/scrollBarRightArrow.svg | 0 .../default}/chatArea/scrollBarUpArrow.svg | 0 {ui => themes/default}/chatArea/spinner.svg | 0 {ui => themes/default}/chatArea/symbols.svg | 0 {ui => themes/default}/chatArea/typing.svg | 0 {ui => themes/default}/chatForm/buttons.css | 26 ++-- .../default}/chatForm/callButton.svg | 0 .../default}/chatForm/emoteButton.svg | 0 .../chatForm/exitFullScreenButton.svg | 0 .../default}/chatForm/fileButton.svg | 0 .../default}/chatForm/fullScreenButtons.css | 16 +-- {ui => themes/default}/chatForm/labels.css | 0 {ui => themes/default}/chatForm/micButton.svg | 0 .../default}/chatForm/micButtonRed.svg | 0 .../default}/chatForm/screenshotButton.svg | 0 .../chatForm/searchCalendarButton.svg | 0 .../default}/chatForm/searchDownButton.svg | 0 .../default}/chatForm/searchHideButton.svg | 0 .../chatForm/searchSettingsButton.svg | 0 .../default}/chatForm/searchUpButton.svg | 0 .../default}/chatForm/sendButton.svg | 0 .../default}/chatForm/videoButton.svg | 0 .../default}/chatForm/videoButtonRed.svg | 0 .../default}/chatForm/videoPreview.svg | 0 .../default}/chatForm/videoPreviewRed.svg | 0 {ui => themes/default}/chatForm/volButton.svg | 0 .../default}/chatForm/volButtonRed.svg | 0 .../default}/contentDialog/contentDialog.css | 0 .../default}/emoteButton/emoteButton.css | 2 +- .../default}/emoteButton/emoteButton.svg | 0 .../default}/emoticonWidget/dot_page.svg | 0 .../emoticonWidget/dot_page_current.svg | 0 .../emoticonWidget/dot_page_hover.svg | 0 .../emoticonWidget/emoticonWidget.css | 8 +- .../default}/fileButton/fileButton.css | 2 +- .../default}/fileButton/fileButton.svg | 0 .../fileTransferInstance/arrow_white.svg | 0 .../default}/fileTransferInstance/browse.svg | 0 .../default}/fileTransferInstance/dir.svg | 0 .../filetransferWidget.css | 0 .../default}/fileTransferInstance/no.svg | 0 .../default}/fileTransferInstance/pause.svg | 0 .../default}/fileTransferInstance/yes.svg | 0 .../default}/fileTransferWidget/fileDone.svg | 0 .../fileTransferWidget/fileTransferWidget.css | 0 .../default}/friendList/friendList.css | 0 .../default}/loginScreen/loginScreen.css | 0 {ui => themes/default}/msgEdit/msgEdit.css | 0 .../notificationEdge/notificationEdge.css | 0 .../default}/rejectCall/rejectCall.svg | 0 .../screenshotButton/screenshotButton.css | 2 +- .../screenshotButton/screenshotButton.svg | 0 .../default}/sendButton/sendButton.css | 2 +- .../default}/sendButton/sendButton.svg | 0 .../default}/settings/mainContent.css | 0 {ui => themes/default}/settings/mainHead.css | 0 .../default}/statusButton/menu_indicator.svg | 0 .../default}/statusButton/statusButton.css | 2 +- .../default}/tooliconsZone/tooliconsZone.css | 0 {ui => themes/default}/window/general.css | 0 {ui => themes/default}/window/profile.css | 0 {ui => themes/default}/window/statusPanel.css | 2 +- {ui => themes/default}/window/window.css | 24 ++-- 96 files changed, 287 insertions(+), 174 deletions(-) rename {ui => themes/default}/acceptCall/acceptCall.svg (100%) rename {ui => themes/default}/chatArea/chatArea.css (100%) rename {ui => themes/default}/chatArea/chatHead.css (100%) rename {ui => themes/default}/chatArea/error.svg (100%) rename {ui => themes/default}/chatArea/info.svg (100%) rename {ui => themes/default}/chatArea/innerStyle.css (100%) rename {ui => themes/default}/chatArea/scrollBarDownArrow.svg (100%) rename {ui => themes/default}/chatArea/scrollBarLeftArrow.svg (100%) rename {ui => themes/default}/chatArea/scrollBarRightArrow.svg (100%) rename {ui => themes/default}/chatArea/scrollBarUpArrow.svg (100%) rename {ui => themes/default}/chatArea/spinner.svg (100%) rename {ui => themes/default}/chatArea/symbols.svg (100%) rename {ui => themes/default}/chatArea/typing.svg (100%) rename {ui => themes/default}/chatForm/buttons.css (71%) rename {ui => themes/default}/chatForm/callButton.svg (100%) rename {ui => themes/default}/chatForm/emoteButton.svg (100%) rename {ui => themes/default}/chatForm/exitFullScreenButton.svg (100%) rename {ui => themes/default}/chatForm/fileButton.svg (100%) rename {ui => themes/default}/chatForm/fullScreenButtons.css (63%) rename {ui => themes/default}/chatForm/labels.css (100%) rename {ui => themes/default}/chatForm/micButton.svg (100%) rename {ui => themes/default}/chatForm/micButtonRed.svg (100%) rename {ui => themes/default}/chatForm/screenshotButton.svg (100%) rename {ui => themes/default}/chatForm/searchCalendarButton.svg (100%) rename {ui => themes/default}/chatForm/searchDownButton.svg (100%) rename {ui => themes/default}/chatForm/searchHideButton.svg (100%) rename {ui => themes/default}/chatForm/searchSettingsButton.svg (100%) rename {ui => themes/default}/chatForm/searchUpButton.svg (100%) rename {ui => themes/default}/chatForm/sendButton.svg (100%) rename {ui => themes/default}/chatForm/videoButton.svg (100%) rename {ui => themes/default}/chatForm/videoButtonRed.svg (100%) rename {ui => themes/default}/chatForm/videoPreview.svg (100%) rename {ui => themes/default}/chatForm/videoPreviewRed.svg (100%) rename {ui => themes/default}/chatForm/volButton.svg (100%) rename {ui => themes/default}/chatForm/volButtonRed.svg (100%) rename {ui => themes/default}/contentDialog/contentDialog.css (100%) rename {ui => themes/default}/emoteButton/emoteButton.css (82%) rename {ui => themes/default}/emoteButton/emoteButton.svg (100%) rename {ui => themes/default}/emoticonWidget/dot_page.svg (100%) rename {ui => themes/default}/emoticonWidget/dot_page_current.svg (100%) rename {ui => themes/default}/emoticonWidget/dot_page_hover.svg (100%) rename {ui => themes/default}/emoticonWidget/emoticonWidget.css (64%) rename {ui => themes/default}/fileButton/fileButton.css (85%) rename {ui => themes/default}/fileButton/fileButton.svg (100%) rename {ui => themes/default}/fileTransferInstance/arrow_white.svg (100%) rename {ui => themes/default}/fileTransferInstance/browse.svg (100%) rename {ui => themes/default}/fileTransferInstance/dir.svg (100%) rename {ui => themes/default}/fileTransferInstance/filetransferWidget.css (100%) rename {ui => themes/default}/fileTransferInstance/no.svg (100%) rename {ui => themes/default}/fileTransferInstance/pause.svg (100%) rename {ui => themes/default}/fileTransferInstance/yes.svg (100%) rename {ui => themes/default}/fileTransferWidget/fileDone.svg (100%) rename {ui => themes/default}/fileTransferWidget/fileTransferWidget.css (100%) rename {ui => themes/default}/friendList/friendList.css (100%) rename {ui => themes/default}/loginScreen/loginScreen.css (100%) rename {ui => themes/default}/msgEdit/msgEdit.css (100%) rename {ui => themes/default}/notificationEdge/notificationEdge.css (100%) rename {ui => themes/default}/rejectCall/rejectCall.svg (100%) rename {ui => themes/default}/screenshotButton/screenshotButton.css (83%) rename {ui => themes/default}/screenshotButton/screenshotButton.svg (100%) rename {ui => themes/default}/sendButton/sendButton.css (82%) rename {ui => themes/default}/sendButton/sendButton.svg (100%) rename {ui => themes/default}/settings/mainContent.css (100%) rename {ui => themes/default}/settings/mainHead.css (100%) rename {ui => themes/default}/statusButton/menu_indicator.svg (100%) rename {ui => themes/default}/statusButton/statusButton.css (91%) rename {ui => themes/default}/tooliconsZone/tooliconsZone.css (100%) rename {ui => themes/default}/window/general.css (100%) rename {ui => themes/default}/window/profile.css (100%) rename {ui => themes/default}/window/statusPanel.css (97%) rename {ui => themes/default}/window/window.css (52%) diff --git a/CMakeLists.txt b/CMakeLists.txt index e642fc209..0575477d5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -100,6 +100,15 @@ include_directories(${CMAKE_SOURCE_DIR}) include(Dependencies) +# Copy themes +if (UNIX AND NOT APPLE) + file(COPY ${CMAKE_SOURCE_DIR}/themes DESTINATION $ENV{HOME}/.config/qtox) +elseif (APPLE) + file(COPY ${CMAKE_SOURCE_DIR}/themes DESTINATION "$ENV{HOME}/Library/Application Support/qtox") +elseif (WIN32) + file(COPY ${CMAKE_SOURCE_DIR}/themes DESTINATION C:\\users\\%username%\\AppData\\roaming\\qtox) +endif() + ################################################################################ # # :: qTox main library sources diff --git a/res.qrc b/res.qrc index 83e8b99af..f816bcfac 100644 --- a/res.qrc +++ b/res.qrc @@ -44,70 +44,70 @@ img/taskbar/light/taskbar_offline.svg img/taskbar/light/taskbar_event.svg img/transfer.svg - ui/fileTransferWidget/fileDone.svg - ui/chatArea/chatArea.css - ui/chatArea/chatHead.css - ui/chatArea/innerStyle.css - ui/chatArea/scrollBarUpArrow.svg - ui/chatArea/scrollBarDownArrow.svg - ui/chatArea/scrollBarLeftArrow.svg - ui/chatArea/scrollBarRightArrow.svg - ui/chatForm/buttons.css - ui/chatForm/fullScreenButtons.css - ui/chatForm/callButton.svg - ui/chatForm/labels.css - ui/chatForm/micButton.svg - ui/chatForm/micButtonRed.svg - ui/chatForm/videoButton.svg - ui/chatForm/videoButtonRed.svg - ui/chatForm/volButton.svg - ui/chatForm/volButtonRed.svg - ui/chatForm/videoPreview.svg - ui/chatForm/videoPreviewRed.svg - ui/chatForm/emoteButton.svg - ui/chatForm/fileButton.svg - ui/chatForm/screenshotButton.svg - ui/chatForm/searchCalendarButton.svg - ui/chatForm/searchDownButton.svg - ui/chatForm/searchHideButton.svg - ui/chatForm/searchSettingsButton.svg - ui/chatForm/searchUpButton.svg - ui/chatForm/sendButton.svg - ui/chatForm/exitFullScreenButton.svg - ui/emoticonWidget/dot_page.svg - ui/emoticonWidget/dot_page_current.svg - ui/emoticonWidget/dot_page_hover.svg - ui/emoticonWidget/emoticonWidget.css - ui/fileTransferWidget/fileTransferWidget.css - ui/friendList/friendList.css - ui/msgEdit/msgEdit.css - ui/settings/mainContent.css - ui/settings/mainHead.css - ui/statusButton/statusButton.css - ui/statusButton/menu_indicator.svg - ui/window/general.css - ui/window/profile.css - ui/window/statusPanel.css - ui/window/window.css - ui/chatArea/info.svg - ui/chatArea/spinner.svg - ui/chatArea/typing.svg - ui/chatArea/error.svg - ui/fileTransferInstance/no.svg - ui/fileTransferInstance/pause.svg - ui/fileTransferInstance/yes.svg - ui/fileTransferInstance/dir.svg - ui/fileTransferInstance/arrow_white.svg - ui/fileTransferInstance/browse.svg - ui/fileTransferInstance/filetransferWidget.css - ui/acceptCall/acceptCall.svg - ui/rejectCall/rejectCall.svg + themes/default/fileTransferWidget/fileDone.svg + themes/default/chatArea/chatArea.css + themes/default/chatArea/chatHead.css + themes/default/chatArea/innerStyle.css + themes/default/chatArea/scrollBarUpArrow.svg + themes/default/chatArea/scrollBarDownArrow.svg + themes/default/chatArea/scrollBarLeftArrow.svg + themes/default/chatArea/scrollBarRightArrow.svg + themes/default/chatForm/buttons.css + themes/default/chatForm/fullScreenButtons.css + themes/default/chatForm/callButton.svg + themes/default/chatForm/labels.css + themes/default/chatForm/micButton.svg + themes/default/chatForm/micButtonRed.svg + themes/default/chatForm/videoButton.svg + themes/default/chatForm/videoButtonRed.svg + themes/default/chatForm/volButton.svg + themes/default/chatForm/volButtonRed.svg + themes/default/chatForm/videoPreview.svg + themes/default/chatForm/videoPreviewRed.svg + themes/default/chatForm/emoteButton.svg + themes/default/chatForm/fileButton.svg + themes/default/chatForm/screenshotButton.svg + themes/default/chatForm/searchCalendarButton.svg + themes/default/chatForm/searchDownButton.svg + themes/default/chatForm/searchHideButton.svg + themes/default/chatForm/searchSettingsButton.svg + themes/default/chatForm/searchUpButton.svg + themes/default/chatForm/sendButton.svg + themes/default/chatForm/exitFullScreenButton.svg + themes/default/emoticonWidget/dot_page.svg + themes/default/emoticonWidget/dot_page_current.svg + themes/default/emoticonWidget/dot_page_hover.svg + themes/default/emoticonWidget/emoticonWidget.css + themes/default/fileTransferWidget/fileTransferWidget.css + themes/default/friendList/friendList.css + themes/default/msgEdit/msgEdit.css + themes/default/settings/mainContent.css + themes/default/settings/mainHead.css + themes/default/statusButton/statusButton.css + themes/default/statusButton/menu_indicator.svg + themes/default/window/general.css + themes/default/window/profile.css + themes/default/window/statusPanel.css + themes/default/window/window.css + themes/default/chatArea/info.svg + themes/default/chatArea/spinner.svg + themes/default/chatArea/typing.svg + themes/default/chatArea/error.svg + themes/default/fileTransferInstance/no.svg + themes/default/fileTransferInstance/pause.svg + themes/default/fileTransferInstance/yes.svg + themes/default/fileTransferInstance/dir.svg + themes/default/fileTransferInstance/arrow_white.svg + themes/default/fileTransferInstance/browse.svg + themes/default/fileTransferInstance/filetransferWidget.css + themes/default/acceptCall/acceptCall.svg + themes/default/rejectCall/rejectCall.svg img/login_logo.svg - ui/notificationEdge/notificationEdge.css - ui/loginScreen/loginScreen.css + themes/default/notificationEdge/notificationEdge.css + themes/default/loginScreen/loginScreen.css img/others/logout-icon.svg img/caps_lock.svg - ui/contentDialog/contentDialog.css - ui/tooliconsZone/tooliconsZone.css + themes/default/contentDialog/contentDialog.css + themes/default/tooliconsZone/tooliconsZone.css diff --git a/src/chatlog/chatmessage.cpp b/src/chatlog/chatmessage.cpp index 03c0beec9..ebb491dda 100644 --- a/src/chatlog/chatmessage.cpp +++ b/src/chatlog/chatmessage.cpp @@ -26,6 +26,7 @@ #include "content/spinner.h" #include "content/text.h" #include "content/timestamp.h" +#include "src/widget/style.h" #include @@ -92,7 +93,7 @@ ChatMessage::Ptr ChatMessage::createChatMessage(const QString& sender, const QSt ? QString("%1 %2").arg(sender, rawMessage) : rawMessage), ColumnFormat(1.0, ColumnFormat::VariableSize)); - msg->addColumn(new Spinner(":/ui/chatArea/spinner.svg", QSize(16, 16), 360.0 / 1.6), + msg->addColumn(new Spinner(Style::getImagePath("chatArea/spinner.svg"), QSize(16, 16), 360.0 / 1.6), ColumnFormat(TIME_COL_WIDTH, ColumnFormat::FixedSize, ColumnFormat::Right)); if (!date.isNull()) @@ -110,13 +111,13 @@ ChatMessage::Ptr ChatMessage::createChatInfoMessage(const QString& rawMessage, QString img; switch (type) { case INFO: - img = ":/ui/chatArea/info.svg"; + img = Style::getImagePath("chatArea/info.svg"); break; case ERROR: - img = ":/ui/chatArea/error.svg"; + img = Style::getImagePath("chatArea/error.svg"); break; case TYPING: - img = ":/ui/chatArea/typing.svg"; + img = Style::getImagePath("chatArea/typing.svg"); break; } diff --git a/src/chatlog/content/filetransferwidget.cpp b/src/chatlog/content/filetransferwidget.cpp index 9fd45e59e..86365384d 100644 --- a/src/chatlog/content/filetransferwidget.cpp +++ b/src/chatlog/content/filetransferwidget.cpp @@ -181,7 +181,7 @@ void FileTransferWidget::setBackgroundColor(const QColor& c, bool whiteFont) setProperty("fontColor", whiteFont ? "white" : "black"); - setStyleSheet(Style::getStylesheet(":/ui/fileTransferInstance/filetransferWidget.css")); + setStyleSheet(Style::getStylesheet("fileTransferInstance/filetransferWidget.css")); Style::repolish(this); update(); @@ -387,12 +387,12 @@ void FileTransferWidget::onFileTransferFinished(ToxFile file) setupButtons(); hideWidgets(); - ui->leftButton->setIcon(QIcon(":/ui/fileTransferInstance/yes.svg")); + ui->leftButton->setIcon(QIcon(Style::getImagePath("fileTransferInstance/yes.svg"))); ui->leftButton->setObjectName("ok"); ui->leftButton->setToolTip(tr("Open file")); ui->leftButton->show(); - ui->rightButton->setIcon(QIcon(":/ui/fileTransferInstance/dir.svg")); + ui->rightButton->setIcon(QIcon(Style::getImagePath("fileTransferInstance/dir.svg"))); ui->rightButton->setObjectName("dir"); ui->rightButton->setToolTip(tr("Open file directory")); ui->rightButton->show(); @@ -443,11 +443,11 @@ void FileTransferWidget::setupButtons() { switch (fileInfo.status) { case ToxFile::TRANSMITTING: - ui->leftButton->setIcon(QIcon(":/ui/fileTransferInstance/pause.svg")); + ui->leftButton->setIcon(QIcon(Style::getImagePath("fileTransferInstance/pause.svg"))); ui->leftButton->setObjectName("pause"); ui->leftButton->setToolTip(tr("Pause transfer")); - ui->rightButton->setIcon(QIcon(":/ui/fileTransferInstance/no.svg")); + ui->rightButton->setIcon(QIcon(Style::getImagePath("fileTransferInstance/no.svg"))); ui->rightButton->setObjectName("cancel"); ui->rightButton->setToolTip(tr("Cancel transfer")); @@ -455,11 +455,11 @@ void FileTransferWidget::setupButtons() break; case ToxFile::PAUSED: - ui->leftButton->setIcon(QIcon(":/ui/fileTransferInstance/arrow_white.svg")); + ui->leftButton->setIcon(QIcon(Style::getImagePath("fileTransferInstance/arrow_white.svg"))); ui->leftButton->setObjectName("resume"); ui->leftButton->setToolTip(tr("Resume transfer")); - ui->rightButton->setIcon(QIcon(":/ui/fileTransferInstance/no.svg")); + ui->rightButton->setIcon(QIcon(Style::getImagePath("fileTransferInstance/no.svg"))); ui->rightButton->setObjectName("cancel"); ui->rightButton->setToolTip(tr("Cancel transfer")); @@ -468,16 +468,16 @@ void FileTransferWidget::setupButtons() case ToxFile::STOPPED: case ToxFile::BROKEN: - ui->rightButton->setIcon(QIcon(":/ui/fileTransferInstance/no.svg")); + ui->rightButton->setIcon(QIcon(Style::getImagePath("fileTransferInstance/no.svg"))); ui->rightButton->setObjectName("cancel"); ui->rightButton->setToolTip(tr("Cancel transfer")); if (fileInfo.direction == ToxFile::SENDING) { - ui->leftButton->setIcon(QIcon(":/ui/fileTransferInstance/pause.svg")); + ui->leftButton->setIcon(QIcon(Style::getImagePath("fileTransferInstance/pause.svg"))); ui->leftButton->setObjectName("pause"); ui->leftButton->setToolTip(tr("Pause transfer")); } else { - ui->leftButton->setIcon(QIcon(":/ui/fileTransferInstance/yes.svg")); + ui->leftButton->setIcon(QIcon(Style::getImagePath("fileTransferInstance/yes.svg"))); ui->leftButton->setObjectName("accept"); ui->leftButton->setToolTip(tr("Accept transfer")); } diff --git a/src/chatlog/content/filetransferwidget.ui b/src/chatlog/content/filetransferwidget.ui index 8b99e6de9..eca5d8480 100644 --- a/src/chatlog/content/filetransferwidget.ui +++ b/src/chatlog/content/filetransferwidget.ui @@ -297,7 +297,7 @@ - :/ui/fileTransferInstance/no.svg:/ui/fileTransferInstance/no.svg + :themes/default/fileTransferInstance/no.svg:themes/default/fileTransferInstance/no.svg @@ -383,7 +383,7 @@ - :/ui/fileTransferInstance/no.svg:/ui/fileTransferInstance/no.svg + :themes/default/fileTransferInstance/no.svg:themes/default/fileTransferInstance/no.svg @@ -421,7 +421,7 @@ - :/ui/fileTransferInstance/no.svg:/ui/fileTransferInstance/no.svg + :themes/default/fileTransferInstance/no.svg:themes/default/fileTransferInstance/no.svg diff --git a/src/chatlog/content/notificationicon.cpp b/src/chatlog/content/notificationicon.cpp index 8f9ba06bc..ba79e0f8a 100644 --- a/src/chatlog/content/notificationicon.cpp +++ b/src/chatlog/content/notificationicon.cpp @@ -19,6 +19,7 @@ #include "notificationicon.h" #include "../pixmapcache.h" +#include "src/widget/style.h" #include #include @@ -27,7 +28,7 @@ NotificationIcon::NotificationIcon(QSize Size) : size(Size) { - pmap = PixmapCache::getInstance().get(":/ui/chatArea/typing.svg", size); + pmap = PixmapCache::getInstance().get(Style::getImagePath("chatArea/typing.svg"), size); updateTimer = new QTimer(this); updateTimer->setInterval(1000 / 30); diff --git a/src/chatlog/content/text.cpp b/src/chatlog/content/text.cpp index f34ff8aea..f6f1d2fb1 100644 --- a/src/chatlog/content/text.cpp +++ b/src/chatlog/content/text.cpp @@ -40,7 +40,7 @@ Text::Text(const QString& txt, const QFont& font, bool enableElide, const QStrin : rawText(rwText) , elide(enableElide) , defFont(font) - , defStyleSheet(Style::getStylesheet(QStringLiteral(":/ui/chatArea/innerStyle.css"), font)) + , defStyleSheet(Style::getStylesheet(QStringLiteral("chatArea/innerStyle.css"), font)) , color(c) { setText(txt); diff --git a/src/video/genericnetcamview.cpp b/src/video/genericnetcamview.cpp index 7b7db2091..716eed331 100644 --- a/src/video/genericnetcamview.cpp +++ b/src/video/genericnetcamview.cpp @@ -32,7 +32,7 @@ const auto BTN_STATE_NONE = QVariant("none"); const auto BTN_STATE_RED = QVariant("red"); const int BTN_PANEL_HEIGHT = 55; const int BTN_PANEL_WIDTH = 250; -const auto BTN_STYLE_SHEET_PATH = QStringLiteral(":/ui/chatForm/fullScreenButtons.css"); +const auto BTN_STYLE_SHEET_PATH = QStringLiteral("chatForm/fullScreenButtons.css"); } GenericNetCamView::GenericNetCamView(QWidget* parent) @@ -117,7 +117,7 @@ void GenericNetCamView::setShowMessages(bool show, bool notify) toggleMessagesButton->setText(tr("Show Messages")); if (notify) { - toggleMessagesButton->setIcon(QIcon(":/ui/chatArea/info.svg")); + toggleMessagesButton->setIcon(QIcon(Style::getImagePath("chatArea/info.svg"))); } } diff --git a/src/widget/categorywidget.cpp b/src/widget/categorywidget.cpp index c8f2b9588..aab87b22c 100644 --- a/src/widget/categorywidget.cpp +++ b/src/widget/categorywidget.cpp @@ -48,7 +48,7 @@ CategoryWidget::CategoryWidget(bool compact, QWidget* parent) statusLabel->setObjectName("status"); statusLabel->setTextFormat(Qt::PlainText); - statusPic.setPixmap(QPixmap(":/ui/chatArea/scrollBarRightArrow.svg")); + statusPic.setPixmap(QPixmap(Style::getImagePath("chatArea/scrollBarRightArrow.svg"))); fullLayout = new QVBoxLayout(this); fullLayout->setSpacing(0); @@ -90,9 +90,9 @@ void CategoryWidget::setExpanded(bool isExpanded, bool save) QString pixmapPath; if (isExpanded) - pixmapPath = ":/ui/chatArea/scrollBarDownArrow.svg"; + pixmapPath = Style::getImagePath("chatArea/scrollBarDownArrow.svg"); else - pixmapPath = ":/ui/chatArea/scrollBarRightArrow.svg"; + pixmapPath = Style::getImagePath("chatArea/scrollBarRightArrow.svg"); statusPic.setPixmap(QPixmap(pixmapPath)); // The listWidget will recieve a enterEvent for some reason if now visible. // Using the following, we prevent that. diff --git a/src/widget/chatformheader.cpp b/src/widget/chatformheader.cpp index 4852d88dc..82ada779d 100644 --- a/src/widget/chatformheader.cpp +++ b/src/widget/chatformheader.cpp @@ -38,7 +38,7 @@ static const short MIC_BUTTONS_LAYOUT_SPACING = 4; static const short BUTTONS_LAYOUT_HOR_SPACING = 4; namespace { -const QString STYLE_PATH = QStringLiteral(":/ui/chatForm/buttons.css"); +const QString STYLE_PATH = QStringLiteral("chatForm/buttons.css"); const QString STATE_NAME[] = { QString{}, diff --git a/src/widget/contentdialog.cpp b/src/widget/contentdialog.cpp index e4293b3f0..4a4ab0c60 100644 --- a/src/widget/contentdialog.cpp +++ b/src/widget/contentdialog.cpp @@ -63,7 +63,7 @@ ContentDialog::ContentDialog(QWidget* parent) , videoCount(0) { const Settings& s = Settings::getInstance(); - setStyleSheet(Style::getStylesheet(":/ui/contentDialog/contentDialog.css")); + setStyleSheet(Style::getStylesheet("contentDialog/contentDialog.css")); friendLayout->setMargin(0); friendLayout->setSpacing(0); @@ -87,7 +87,7 @@ ContentDialog::ContentDialog(QWidget* parent) friendScroll->setFrameStyle(QFrame::NoFrame); friendScroll->setLayoutDirection(Qt::RightToLeft); friendScroll->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - friendScroll->setStyleSheet(Style::getStylesheet(":/ui/friendList/friendList.css")); + friendScroll->setStyleSheet(Style::getStylesheet("friendList/friendList.css")); friendScroll->setWidgetResizable(true); friendScroll->setWidget(friendWidget); diff --git a/src/widget/contentlayout.cpp b/src/widget/contentlayout.cpp index 7e5d64a8a..4c3a0e259 100644 --- a/src/widget/contentlayout.cpp +++ b/src/widget/contentlayout.cpp @@ -111,8 +111,8 @@ void ContentLayout::init() } #ifndef Q_OS_MAC - mainHead->setStyleSheet(Style::getStylesheet(":ui/settings/mainHead.css")); - mainContent->setStyleSheet(Style::getStylesheet(":ui/settings/mainContent.css")); + mainHead->setStyleSheet(Style::getStylesheet("settings/mainHead.css")); + mainContent->setStyleSheet(Style::getStylesheet("settings/mainContent.css")); #endif mainHLineLayout.addWidget(&mainHLine); diff --git a/src/widget/emoticonswidget.cpp b/src/widget/emoticonswidget.cpp index 0cf653d1a..05237f797 100644 --- a/src/widget/emoticonswidget.cpp +++ b/src/widget/emoticonswidget.cpp @@ -34,7 +34,7 @@ EmoticonsWidget::EmoticonsWidget(QWidget* parent) : QMenu(parent) { - setStyleSheet(Style::getStylesheet(":/ui/emoticonWidget/emoticonWidget.css")); + setStyleSheet(Style::getStylesheet("emoticonWidget/emoticonWidget.css")); setLayout(&layout); layout.addWidget(&stack); diff --git a/src/widget/form/filesform.cpp b/src/widget/form/filesform.cpp index f57a9180d..39ace4928 100644 --- a/src/widget/form/filesform.cpp +++ b/src/widget/form/filesform.cpp @@ -20,13 +20,14 @@ #include "filesform.h" #include "src/widget/contentlayout.h" #include "src/widget/translator.h" +#include "src/widget/style.h" #include "src/widget/widget.h" #include #include FilesForm::FilesForm() : QObject() - , doneIcon(":/ui/fileTransferWidget/fileDone.svg") + , doneIcon(Style::getImagePath("fileTransferWidget/fileDone.svg")) { head = new QWidget(); QFont bold; diff --git a/src/widget/form/genericchatform.cpp b/src/widget/form/genericchatform.cpp index f98537b7a..ae7eccb39 100644 --- a/src/widget/form/genericchatform.cpp +++ b/src/widget/form/genericchatform.cpp @@ -58,7 +58,7 @@ * elements and methods to work with chat messages. */ -#define SET_STYLESHEET(x) (x)->setStyleSheet(Style::getStylesheet(":/ui/" #x "/" #x ".css")) +#define SET_STYLESHEET(x) (x)->setStyleSheet(Style::getStylesheet(":/themes/default/" #x "/" #x ".css")) static const QSize FILE_FLYOUT_SIZE{24, 24}; static const short FOOT_BUTTONS_SPACING = 2; @@ -108,7 +108,7 @@ QString GenericChatForm::resolveToxPk(const ToxPk& pk) namespace { -const QString STYLE_PATH = QStringLiteral(":/ui/chatForm/buttons.css"); +const QString STYLE_PATH = QStringLiteral("chatForm/buttons.css"); } namespace @@ -170,7 +170,7 @@ GenericChatForm::GenericChatForm(const Contact* contact, QWidget* parent) fileLayout->setSpacing(0); fileLayout->setMargin(0); - msgEdit->setStyleSheet(Style::getStylesheet(":/ui/msgEdit/msgEdit.css") + msgEdit->setStyleSheet(Style::getStylesheet("msgEdit/msgEdit.css") + fontToCss(s.getChatMessageFont(), "QTextEdit")); msgEdit->setFixedHeight(MESSAGE_EDIT_HEIGHT); msgEdit->setFrameStyle(QFrame::NoFrame); @@ -238,8 +238,8 @@ GenericChatForm::GenericChatForm(const Contact* contact, QWidget* parent) connect(chatWidget, &ChatLog::workerTimeoutFinished, this, &GenericChatForm::onContinueSearch); - chatWidget->setStyleSheet(Style::getStylesheet(":/ui/chatArea/chatArea.css")); - headWidget->setStyleSheet(Style::getStylesheet(":/ui/chatArea/chatHead.css")); + chatWidget->setStyleSheet(Style::getStylesheet("chatArea/chatArea.css")); + headWidget->setStyleSheet(Style::getStylesheet("chatArea/chatHead.css")); fileFlyout->setFixedSize(FILE_FLYOUT_SIZE); fileFlyout->setParent(this); @@ -523,7 +523,7 @@ void GenericChatForm::onChatMessageFontChanged(const QFont& font) chatWidget->fontChanged(font); chatWidget->forceRelayout(); // message editor - msgEdit->setStyleSheet(Style::getStylesheet(":/ui/msgEdit/msgEdit.css") + msgEdit->setStyleSheet(Style::getStylesheet("msgEdit/msgEdit.css") + fontToCss(font, "QTextEdit")); } diff --git a/src/widget/form/groupchatform.cpp b/src/widget/form/groupchatform.cpp index 2a73d8ca4..2b521c581 100644 --- a/src/widget/form/groupchatform.cpp +++ b/src/widget/form/groupchatform.cpp @@ -50,7 +50,7 @@ const auto LABEL_PEER_TYPE_OUR = QVariant(QStringLiteral("our")); const auto LABEL_PEER_TYPE_MUTED = QVariant(QStringLiteral("muted")); const auto LABEL_PEER_PLAYING_AUDIO = QVariant(QStringLiteral("true")); const auto LABEL_PEER_NOT_PLAYING_AUDIO = QVariant(QStringLiteral("false")); -const auto PEER_LABEL_STYLE_SHEET_PATH = QStringLiteral(":/ui/chatArea/chatHead.css"); +const auto PEER_LABEL_STYLE_SHEET_PATH = QStringLiteral("chatArea/chatHead.css"); } /** diff --git a/src/widget/form/profileform.cpp b/src/widget/form/profileform.cpp index 2c8c35e1c..e8b200e38 100644 --- a/src/widget/form/profileform.cpp +++ b/src/widget/form/profileform.cpp @@ -144,7 +144,7 @@ ProfileForm::ProfileForm(IProfileInfo* profileInfo, QWidget* parent) profilePicture->installEventFilter(this); profilePicture->setAccessibleName("Profile avatar"); profilePicture->setAccessibleDescription("Set a profile avatar shown to all contacts"); - profilePicture->setStyleSheet(Style::getStylesheet(":ui/window/profile.css")); + profilePicture->setStyleSheet(Style::getStylesheet("window/profile.css")); connect(profilePicture, &MaskablePixmapWidget::clicked, this, &ProfileForm::onAvatarClicked); connect(profilePicture, &MaskablePixmapWidget::customContextMenuRequested, this, &ProfileForm::showProfilePictureContextMenu); diff --git a/src/widget/form/searchsettingsform.cpp b/src/widget/form/searchsettingsform.cpp index 3c9223e10..4d993ad06 100644 --- a/src/widget/form/searchsettingsform.cpp +++ b/src/widget/form/searchsettingsform.cpp @@ -15,9 +15,9 @@ SearchSettingsForm::SearchSettingsForm(QWidget *parent) : ui->choiceDateButton->setAttribute(Qt::WA_LayoutUsesWidgetRect); ui->choiceDateButton->setObjectName(QStringLiteral("choiceDateButton")); - ui->choiceDateButton->setStyleSheet(Style::getStylesheet(QStringLiteral(":/ui/chatForm/buttons.css"))); + ui->choiceDateButton->setStyleSheet(Style::getStylesheet(QStringLiteral("chatForm/buttons.css"))); - ui->startDateLabel->setStyleSheet(Style::getStylesheet(QStringLiteral(":/ui/chatForm/labels.css"))); + ui->startDateLabel->setStyleSheet(Style::getStylesheet(QStringLiteral("chatForm/labels.css"))); connect(ui->startSearchComboBox, static_cast(&QComboBox::currentIndexChanged), this, &SearchSettingsForm::onStartSearchSelected); @@ -93,7 +93,7 @@ void SearchSettingsForm::onStartSearchSelected(const int index) ui->startDateLabel->setEnabled(true); ui->choiceDateButton->setProperty("state", QStringLiteral("green")); - ui->choiceDateButton->setStyleSheet(Style::getStylesheet(QStringLiteral(":/ui/chatForm/buttons.css"))); + ui->choiceDateButton->setStyleSheet(Style::getStylesheet(QStringLiteral("chatForm/buttons.css"))); if (startDate.isNull()) { startDate = QDate::currentDate(); @@ -105,7 +105,7 @@ void SearchSettingsForm::onStartSearchSelected(const int index) ui->startDateLabel->setEnabled(false); ui->choiceDateButton->setProperty("state", QString()); - ui->choiceDateButton->setStyleSheet(Style::getStylesheet(QStringLiteral(":/ui/chatForm/buttons.css"))); + ui->choiceDateButton->setStyleSheet(Style::getStylesheet(QStringLiteral("chatForm/buttons.css"))); } setUpdate(true); diff --git a/src/widget/loginscreen.cpp b/src/widget/loginscreen.cpp index 1bf36bc92..8c0a72479 100644 --- a/src/widget/loginscreen.cpp +++ b/src/widget/loginscreen.cpp @@ -60,7 +60,7 @@ LoginScreen::LoginScreen(QString initialProfile, QWidget* parent) connect(ui->importButton, &QPushButton::clicked, this, &LoginScreen::onImportProfile); reset(initialProfile); - this->setStyleSheet(Style::getStylesheet(":/ui/loginScreen/loginScreen.css")); + this->setStyleSheet(Style::getStylesheet("loginScreen/loginScreen.css")); retranslateUi(); Translator::registerHandler(std::bind(&LoginScreen::retranslateUi, this), this); diff --git a/src/widget/notificationedgewidget.cpp b/src/widget/notificationedgewidget.cpp index ddf9dda10..f3a6df5b4 100644 --- a/src/widget/notificationedgewidget.cpp +++ b/src/widget/notificationedgewidget.cpp @@ -28,7 +28,7 @@ NotificationEdgeWidget::NotificationEdgeWidget(Position position, QWidget* paren : QWidget(parent) { setAttribute(Qt::WA_StyledBackground); // Show background. - setStyleSheet(Style::getStylesheet(":/ui/notificationEdge/notificationEdge.css")); + setStyleSheet(Style::getStylesheet("notificationEdge/notificationEdge.css")); QHBoxLayout* layout = new QHBoxLayout(this); layout->addStretch(); @@ -39,9 +39,9 @@ NotificationEdgeWidget::NotificationEdgeWidget(Position position, QWidget* paren QLabel* arrowLabel = new QLabel(this); if (position == Top) - arrowLabel->setPixmap(QPixmap("://ui/chatArea/scrollBarUpArrow.svg")); + arrowLabel->setPixmap(QPixmap(Style::getImagePath("chatArea/scrollBarUpArrow.svg"))); else - arrowLabel->setPixmap(QPixmap("://ui/chatArea/scrollBarDownArrow.svg")); + arrowLabel->setPixmap(QPixmap(Style::getImagePath("chatArea/scrollBarDownArrow.svg"))); layout->addWidget(arrowLabel); layout->addStretch(); diff --git a/src/widget/searchform.cpp b/src/widget/searchform.cpp index 7ed28c476..6aca3f67e 100644 --- a/src/widget/searchform.cpp +++ b/src/widget/searchform.cpp @@ -48,7 +48,7 @@ SearchForm::SearchForm(QWidget* parent) : QWidget(parent) settings->setVisible(false); messageLabel->setProperty("state", QStringLiteral("red")); - messageLabel->setStyleSheet(Style::getStylesheet(QStringLiteral(":/ui/chatForm/labels.css"))); + messageLabel->setStyleSheet(Style::getStylesheet(QStringLiteral("chatForm/labels.css"))); messageLabel->setText(tr("The text could not be found.")); messageLabel->setVisible(false); @@ -130,7 +130,7 @@ QPushButton *SearchForm::createButton(const QString& name, const QString& state) btn->setAttribute(Qt::WA_LayoutUsesWidgetRect); btn->setObjectName(name); btn->setProperty("state", state); - btn->setStyleSheet(Style::getStylesheet(QStringLiteral(":/ui/chatForm/buttons.css"))); + btn->setStyleSheet(Style::getStylesheet(QStringLiteral("chatForm/buttons.css"))); return btn; } @@ -156,7 +156,7 @@ void SearchForm::setStateName(QPushButton *btn, ToolButtonState state) { const auto index = static_cast(state); btn->setProperty("state", STATE_NAME[index]); - btn->setStyleSheet(Style::getStylesheet(QStringLiteral(":/ui/chatForm/buttons.css"))); + btn->setStyleSheet(Style::getStylesheet(QStringLiteral("chatForm/buttons.css"))); btn->setEnabled(index != 0); } diff --git a/src/widget/style.cpp b/src/widget/style.cpp index 5003ff466..b67ae4ef8 100644 --- a/src/widget/style.cpp +++ b/src/widget/style.cpp @@ -22,11 +22,13 @@ #include "src/widget/gui.h" #include +#include #include #include #include #include #include +#include #include #include #include @@ -89,6 +91,31 @@ QStringList Style::getThemeColorNames() QObject::tr("Violet")}; } +QString Style::getThemeName() +{ + //TODO: return name of the current theme + const QString themeName = "default"; + return QStringLiteral("default"); +} + +QString Style::getThemePath() +{ + const QString themeName = getThemeName(); + const QString homePath = QDir::homePath(); + +#if defined(Q_OS_UNIX) and not defined(Q_OS_MACOS) + const QString themePath = homePath % QLatin1String("/.config/qtox/themes/") % themeName % '/'; +#elif defined(Q_OS_MACOS) + const QString themePath = homePath % QLatin1String("/Library/Application Support/qtox/themes/") + % themeName % '/'; +#elif defined(Q_OS_WIN32) + const QString themePath = homePath % QLatin1String("/AppData/roaming/qtox/themes/") + % themeName % '/'; +#endif + + return themePath; +} + QList Style::themeColorColors = {QColor(), QColor("#004aa4"), QColor("#97ba00"), QColor("#c23716"), QColor("#4617b5")}; @@ -98,7 +125,8 @@ std::map, const QString> Style::stylesheet const QString Style::getStylesheet(const QString& filename, const QFont& baseFont) { - const std::pair cacheKey(filename, baseFont); + const QString fullPath = getThemePath() + filename; + const std::pair cacheKey(fullPath, baseFont); auto it = stylesheetsCache.find(cacheKey); if (it != stylesheetsCache.end()) { @@ -111,6 +139,34 @@ const QString Style::getStylesheet(const QString& filename, const QFont& baseFon return newStylesheet; } +static QStringList existingImagesCache; +const QString Style::getImagePath(const QString& filename) +{ + QString fullPath = getThemePath() + filename; + + // search for image in cache + if (existingImagesCache.contains(fullPath)) { + return fullPath; + } + + // if not in cache + if (QFileInfo::exists(fullPath)) { + existingImagesCache << fullPath; + return fullPath; + } else { + qWarning() << "Failed to open file (using defaults):" << fullPath; + + fullPath = QLatin1String(":themes/default/") % filename; + + if (QFileInfo::exists(fullPath)) { + return fullPath; + } else { + qWarning() << "Failed to open default file:" << fullPath; + return {}; + } + } +} + QColor Style::getColor(Style::ColorPalette entry) { return palette[entry]; @@ -138,12 +194,26 @@ QFont Style::getFont(Style::Font font) const QString Style::resolve(const QString& filename, const QFont& baseFont) { - QFile file{filename}; - if (!file.open(QFile::ReadOnly | QFile::Text)) { - qWarning() << "Stylesheet " << filename << " not found"; - return QString(""); + QString themePath = getThemePath(); + QString fullPath = themePath + filename; + QString qss; + + QFile file{fullPath}; + if (file.open(QFile::ReadOnly | QFile::Text)) { + qss = file.readAll(); + } else { + qWarning() << "Failed to open file (using defaults):" << fullPath; + + fullPath = QLatin1String(":themes/default/") % filename; + QFile file{fullPath}; + + if (file.open(QFile::ReadOnly | QFile::Text)) { + qss = file.readAll(); + } else { + qWarning() << "Failed to open default file:" << fullPath; + return {}; + } } - QString qss = file.readAll(); if (dict.isEmpty()) { dict = {// colors @@ -175,8 +245,35 @@ const QString Style::resolve(const QString& filename, const QFont& baseFont) } for (const QString& key : dict.keys()) { - qss.replace(QRegularExpression(QString("%1\\b").arg(key)), dict[key]); + qss.replace(QRegularExpression(key % QLatin1Literal{"\\b"}), dict[key]); } + + // @getImagePath() function + const QRegularExpression re{QStringLiteral(R"(@getImagePath\([^)\s]*\))")}; + QRegularExpressionMatchIterator i = re.globalMatch(qss); + + while (i.hasNext()) { + QRegularExpressionMatch match = i.next(); + QString path = match.captured(0); + const QString phrase = path; + + path.remove(QStringLiteral("@getImagePath(")); + path.chop(1); + + QString fullImagePath = getThemePath() + path; + // image not in cache + if (!existingImagesCache.contains(fullPath)) { + if (QFileInfo::exists(fullImagePath)) { + existingImagesCache << fullImagePath; + } else { + qWarning() << "Failed to open file (using defaults):" << fullImagePath; + fullImagePath = QLatin1String(":themes/default/") % path; + } + } + + qss.replace(phrase, fullImagePath); + } + return qss; } diff --git a/src/widget/style.h b/src/widget/style.h index b81708f70..ce9a6a0c2 100644 --- a/src/widget/style.h +++ b/src/widget/style.h @@ -60,6 +60,9 @@ public: static QStringList getThemeColorNames(); static const QString getStylesheet(const QString& filename, const QFont& baseFont = QFont()); + static const QString getImagePath(const QString& filename); + static QString getThemePath(); + static QString getThemeName(); static QColor getColor(ColorPalette entry); static QFont getFont(Font font); static const QString resolve(const QString& filename, const QFont& baseFont = QFont()); diff --git a/src/widget/tool/callconfirmwidget.cpp b/src/widget/tool/callconfirmwidget.cpp index f3048dd68..7c99d8aca 100644 --- a/src/widget/tool/callconfirmwidget.cpp +++ b/src/widget/tool/callconfirmwidget.cpp @@ -19,6 +19,7 @@ #include "callconfirmwidget.h" +#include "src/widget/style.h" #include "src/widget/widget.h" #include #include @@ -89,8 +90,8 @@ CallConfirmWidget::CallConfirmWidget(const QWidget* anchor) reject->setFlat(true); accept->setStyleSheet("QPushButton{border:none;}"); reject->setStyleSheet("QPushButton{border:none;}"); - accept->setIcon(QIcon(":/ui/acceptCall/acceptCall.svg")); - reject->setIcon(QIcon(":/ui/rejectCall/rejectCall.svg")); + accept->setIcon(QIcon(Style::getImagePath("acceptCall/acceptCall.svg"))); + reject->setIcon(QIcon(Style::getImagePath("rejectCall/rejectCall.svg"))); accept->setIconSize(accept->size()); reject->setIconSize(reject->size()); diff --git a/src/widget/widget.cpp b/src/widget/widget.cpp index 7e3d7486d..b274b67ca 100644 --- a/src/widget/widget.cpp +++ b/src/widget/widget.cpp @@ -142,17 +142,17 @@ void Widget::init() actionQuit->setMenuRole(QAction::QuitRole); #endif - actionQuit->setIcon(prepareIcon(":/ui/rejectCall/rejectCall.svg", icon_size, icon_size)); + actionQuit->setIcon(prepareIcon(Style::getImagePath("rejectCall/rejectCall.svg"), icon_size, icon_size)); connect(actionQuit, &QAction::triggered, qApp, &QApplication::quit); layout()->setContentsMargins(0, 0, 0, 0); - ui->friendList->setStyleSheet(Style::getStylesheet(":/ui/friendList/friendList.css")); + ui->friendList->setStyleSheet(Style::getStylesheet("friendList/friendList.css")); profilePicture = new MaskablePixmapWidget(this, QSize(40, 40), ":/img/avatar_mask.svg"); profilePicture->setPixmap(QPixmap(":/img/contact_dark.svg")); profilePicture->setClickable(true); profilePicture->setObjectName("selfAvatar"); - profilePicture->setStyleSheet(Style::getStylesheet(":ui/window/profile.css")); + profilePicture->setStyleSheet(Style::getStylesheet("window/profile.css")); ui->myProfile->insertWidget(0, profilePicture); ui->myProfile->insertSpacing(1, 7); @@ -196,7 +196,7 @@ void Widget::init() ui->searchContactFilterBox->setMenu(filterMenu); #ifndef Q_OS_MAC - ui->statusHead->setStyleSheet(Style::getStylesheet(":/ui/window/statusPanel.css")); + ui->statusHead->setStyleSheet(Style::getStylesheet("window/statusPanel.css")); #endif contactListWidget = new FriendListWidget(this, Settings::getInstance().getGroupchatPosition()); @@ -206,7 +206,7 @@ void Widget::init() ui->statusLabel->setEditable(true); - ui->statusPanel->setStyleSheet(Style::getStylesheet(":/ui/window/statusPanel.css")); + ui->statusPanel->setStyleSheet(Style::getStylesheet("window/statusPanel.css")); QMenu* statusButtonMenu = new QMenu(ui->statusButton); statusButtonMenu->addAction(statusOnline); @@ -2217,13 +2217,13 @@ void Widget::clearAllReceipts() void Widget::reloadTheme() { - this->setStyleSheet(Style::getStylesheet(":/ui/window/general.css")); - QString statusPanelStyle = Style::getStylesheet(":/ui/window/statusPanel.css"); - ui->tooliconsZone->setStyleSheet(Style::getStylesheet(":/ui/tooliconsZone/tooliconsZone.css")); + this->setStyleSheet(Style::getStylesheet("window/general.css")); + QString statusPanelStyle = Style::getStylesheet("window/statusPanel.css"); + ui->tooliconsZone->setStyleSheet(Style::getStylesheet("tooliconsZone/tooliconsZone.css")); ui->statusPanel->setStyleSheet(statusPanelStyle); ui->statusHead->setStyleSheet(statusPanelStyle); - ui->friendList->setStyleSheet(Style::getStylesheet(":/ui/friendList/friendList.css")); - ui->statusButton->setStyleSheet(Style::getStylesheet(":/ui/statusButton/statusButton.css")); + ui->friendList->setStyleSheet(Style::getStylesheet("friendList/friendList.css")); + ui->statusButton->setStyleSheet(Style::getStylesheet("statusButton/statusButton.css")); contactListWidget->reDraw(); for (Friend* f : FriendList::getAllFriends()) { diff --git a/ui/acceptCall/acceptCall.svg b/themes/default/acceptCall/acceptCall.svg similarity index 100% rename from ui/acceptCall/acceptCall.svg rename to themes/default/acceptCall/acceptCall.svg diff --git a/ui/chatArea/chatArea.css b/themes/default/chatArea/chatArea.css similarity index 100% rename from ui/chatArea/chatArea.css rename to themes/default/chatArea/chatArea.css diff --git a/ui/chatArea/chatHead.css b/themes/default/chatArea/chatHead.css similarity index 100% rename from ui/chatArea/chatHead.css rename to themes/default/chatArea/chatHead.css diff --git a/ui/chatArea/error.svg b/themes/default/chatArea/error.svg similarity index 100% rename from ui/chatArea/error.svg rename to themes/default/chatArea/error.svg diff --git a/ui/chatArea/info.svg b/themes/default/chatArea/info.svg similarity index 100% rename from ui/chatArea/info.svg rename to themes/default/chatArea/info.svg diff --git a/ui/chatArea/innerStyle.css b/themes/default/chatArea/innerStyle.css similarity index 100% rename from ui/chatArea/innerStyle.css rename to themes/default/chatArea/innerStyle.css diff --git a/ui/chatArea/scrollBarDownArrow.svg b/themes/default/chatArea/scrollBarDownArrow.svg similarity index 100% rename from ui/chatArea/scrollBarDownArrow.svg rename to themes/default/chatArea/scrollBarDownArrow.svg diff --git a/ui/chatArea/scrollBarLeftArrow.svg b/themes/default/chatArea/scrollBarLeftArrow.svg similarity index 100% rename from ui/chatArea/scrollBarLeftArrow.svg rename to themes/default/chatArea/scrollBarLeftArrow.svg diff --git a/ui/chatArea/scrollBarRightArrow.svg b/themes/default/chatArea/scrollBarRightArrow.svg similarity index 100% rename from ui/chatArea/scrollBarRightArrow.svg rename to themes/default/chatArea/scrollBarRightArrow.svg diff --git a/ui/chatArea/scrollBarUpArrow.svg b/themes/default/chatArea/scrollBarUpArrow.svg similarity index 100% rename from ui/chatArea/scrollBarUpArrow.svg rename to themes/default/chatArea/scrollBarUpArrow.svg diff --git a/ui/chatArea/spinner.svg b/themes/default/chatArea/spinner.svg similarity index 100% rename from ui/chatArea/spinner.svg rename to themes/default/chatArea/spinner.svg diff --git a/ui/chatArea/symbols.svg b/themes/default/chatArea/symbols.svg similarity index 100% rename from ui/chatArea/symbols.svg rename to themes/default/chatArea/symbols.svg diff --git a/ui/chatArea/typing.svg b/themes/default/chatArea/typing.svg similarity index 100% rename from ui/chatArea/typing.svg rename to themes/default/chatArea/typing.svg diff --git a/ui/chatForm/buttons.css b/themes/default/chatForm/buttons.css similarity index 71% rename from ui/chatForm/buttons.css rename to themes/default/chatForm/buttons.css index 1533d8d19..52325391e 100644 --- a/ui/chatForm/buttons.css +++ b/themes/default/chatForm/buttons.css @@ -2,7 +2,7 @@ QAbstractButton#emoteButton { - background-image: url(":/ui/chatForm/emoteButton.svg"); + background-image: url("@getImagePath(chatForm/emoteButton.svg)"); border-top-right-radius: 5px; width: 24px; height: 24px; @@ -10,7 +10,7 @@ QAbstractButton#emoteButton QAbstractButton#fileButton { - background-image: url(":/ui/chatForm/fileButton.svg"); + background-image: url("@getImagePath(chatForm/fileButton.svg)"); border-bottom-right-radius: 5px; width: 24px; height: 24px; @@ -18,7 +18,7 @@ QAbstractButton#fileButton QAbstractButton#screenshotButton { - background-image: url(":/ui/chatForm/screenshotButton.svg"); + background-image: url("@getImagePath(chatForm/screenshotButton.svg)"); border-top-left-radius: 5px; width: 24px; height: 24px; @@ -26,7 +26,7 @@ QAbstractButton#screenshotButton QAbstractButton#sendButton { - background-image: url(":/ui/chatForm/sendButton.svg"); + background-image: url("@getImagePath(chatForm/sendButton.svg)"); border-radius: 5px; width: 50px; height: 50px; @@ -37,7 +37,7 @@ QAbstractButton#sendButton QAbstractButton#volButton { - border-image: url(":/ui/chatForm/volButton.svg"); + border-image: url("@getImagePath(chatForm/volButton.svg)"); border-radius: 5px; width: 22px; height: 18px; @@ -45,7 +45,7 @@ QAbstractButton#volButton QAbstractButton#micButton { - border-image: url(":/ui/chatForm/micButton.svg"); + border-image: url("@getImagePath(chatForm/micButton.svg)"); border-radius: 5px; width: 22px; height: 18px; @@ -53,7 +53,7 @@ QAbstractButton#micButton QAbstractButton#videoButton { - background-image: url(":/ui/chatForm/videoButton.svg"); + background-image: url("@getImagePath(chatForm/videoButton.svg)"); border-radius: 5px; width: 50px; height: 40px; @@ -61,7 +61,7 @@ QAbstractButton#videoButton QAbstractButton#callButton { - background-image: url(":/ui/chatForm/callButton.svg"); + background-image: url("@getImagePath(chatForm/callButton.svg)"); border-radius: 5px; width: 50px; height: 40px; @@ -71,7 +71,7 @@ QAbstractButton#callButton QAbstractButton#searchSettingsButton { - background-image: url(":/ui/chatForm/searchSettingsButton.svg"); + background-image: url("@getImagePath(chatForm/searchSettingsButton.svg)"); border-radius: 5px; width: 35px; height: 35px; @@ -79,7 +79,7 @@ QAbstractButton#searchSettingsButton QAbstractButton#searchHideButton { - background-image: url(":/ui/chatForm/searchHideButton.svg"); + background-image: url("@getImagePath(chatForm/searchHideButton.svg)"); border-radius: 5px; width: 35px; height: 35px; @@ -87,7 +87,7 @@ QAbstractButton#searchHideButton QAbstractButton#searchUpButton { - background-image: url(":/ui/chatForm/searchUpButton.svg"); + background-image: url("@getImagePath(chatForm/searchUpButton.svg)"); border-radius: 5px; width: 35px; height: 35px; @@ -95,7 +95,7 @@ QAbstractButton#searchUpButton QAbstractButton#searchDownButton { - background-image: url(":/ui/chatForm/searchDownButton.svg"); + background-image: url("@getImagePath(chatForm/searchDownButton.svg)"); border-radius: 5px; width: 35px; height: 35px; @@ -103,7 +103,7 @@ QAbstractButton#searchDownButton QAbstractButton#choiceDateButton { - background-image: url(":/ui/chatForm/searchCalendarButton.svg"); + background-image: url("@getImagePath(chatForm/searchCalendarButton.svg)"); border-radius: 5px; width: 45px; height: 35px; diff --git a/ui/chatForm/callButton.svg b/themes/default/chatForm/callButton.svg similarity index 100% rename from ui/chatForm/callButton.svg rename to themes/default/chatForm/callButton.svg diff --git a/ui/chatForm/emoteButton.svg b/themes/default/chatForm/emoteButton.svg similarity index 100% rename from ui/chatForm/emoteButton.svg rename to themes/default/chatForm/emoteButton.svg diff --git a/ui/chatForm/exitFullScreenButton.svg b/themes/default/chatForm/exitFullScreenButton.svg similarity index 100% rename from ui/chatForm/exitFullScreenButton.svg rename to themes/default/chatForm/exitFullScreenButton.svg diff --git a/ui/chatForm/fileButton.svg b/themes/default/chatForm/fileButton.svg similarity index 100% rename from ui/chatForm/fileButton.svg rename to themes/default/chatForm/fileButton.svg diff --git a/ui/chatForm/fullScreenButtons.css b/themes/default/chatForm/fullScreenButtons.css similarity index 63% rename from ui/chatForm/fullScreenButtons.css rename to themes/default/chatForm/fullScreenButtons.css index da0596378..1fdc96e2e 100644 --- a/ui/chatForm/fullScreenButtons.css +++ b/themes/default/chatForm/fullScreenButtons.css @@ -25,7 +25,7 @@ QAbstractButton:pressed QAbstractButton#volButtonFullScreen { - background-image: url(":/ui/chatForm/volButton.svg"); + background-image: url("@getImagePath(chatForm/volButton.svg)"); width: 11px; height: 9px; padding: 12px; @@ -33,7 +33,7 @@ QAbstractButton#volButtonFullScreen QAbstractButton#micButtonFullScreen { - background-image: url(":/ui/chatForm/micButton.svg"); + background-image: url("@getImagePath(chatForm/micButton.svg)"); width: 11px; height: 9px; padding: 12px; @@ -41,14 +41,14 @@ QAbstractButton#micButtonFullScreen QAbstractButton#videoButtonFullScreen { - background-image: url(":/ui/chatForm/videoButtonRed.svg"); + background-image: url("@getImagePath(chatForm/videoButtonRed.svg)"); width: 37px; height: 33px; } QAbstractButton#videoPreviewButton { - background-image: url(":/ui/chatForm/videoPreview.svg"); + background-image: url("@getImagePath(chatForm/videoPreview.svg)"); width: 13px; height: 13px; padding: 10px; @@ -56,7 +56,7 @@ QAbstractButton#videoPreviewButton QAbstractButton#exitFullScreenButton { - background-image: url(":/ui/chatForm/exitFullScreenButton.svg"); + background-image: url("@getImagePath(chatForm/exitFullScreenButton.svg)"); width: 30px; height: 30px; padding: 1px; @@ -64,15 +64,15 @@ QAbstractButton#exitFullScreenButton QAbstractButton#volButtonFullScreen[state="red"] { - background-image: url(":/ui/chatForm/volButtonRed.svg"); + background-image: url("@getImagePath(chatForm/volButtonRed.svg)"); } QAbstractButton#micButtonFullScreen[state="red"] { - background-image: url(":/ui/chatForm/micButtonRed.svg"); + background-image: url("@getImagePath(chatForm/micButtonRed.svg)"); } QAbstractButton#videoPreviewButton[state="red"] { - background-image: url(":/ui/chatForm/videoPreviewRed.svg"); + background-image: url("@getImagePath(chatForm/videoPreviewRed.svg)"); } diff --git a/ui/chatForm/labels.css b/themes/default/chatForm/labels.css similarity index 100% rename from ui/chatForm/labels.css rename to themes/default/chatForm/labels.css diff --git a/ui/chatForm/micButton.svg b/themes/default/chatForm/micButton.svg similarity index 100% rename from ui/chatForm/micButton.svg rename to themes/default/chatForm/micButton.svg diff --git a/ui/chatForm/micButtonRed.svg b/themes/default/chatForm/micButtonRed.svg similarity index 100% rename from ui/chatForm/micButtonRed.svg rename to themes/default/chatForm/micButtonRed.svg diff --git a/ui/chatForm/screenshotButton.svg b/themes/default/chatForm/screenshotButton.svg similarity index 100% rename from ui/chatForm/screenshotButton.svg rename to themes/default/chatForm/screenshotButton.svg diff --git a/ui/chatForm/searchCalendarButton.svg b/themes/default/chatForm/searchCalendarButton.svg similarity index 100% rename from ui/chatForm/searchCalendarButton.svg rename to themes/default/chatForm/searchCalendarButton.svg diff --git a/ui/chatForm/searchDownButton.svg b/themes/default/chatForm/searchDownButton.svg similarity index 100% rename from ui/chatForm/searchDownButton.svg rename to themes/default/chatForm/searchDownButton.svg diff --git a/ui/chatForm/searchHideButton.svg b/themes/default/chatForm/searchHideButton.svg similarity index 100% rename from ui/chatForm/searchHideButton.svg rename to themes/default/chatForm/searchHideButton.svg diff --git a/ui/chatForm/searchSettingsButton.svg b/themes/default/chatForm/searchSettingsButton.svg similarity index 100% rename from ui/chatForm/searchSettingsButton.svg rename to themes/default/chatForm/searchSettingsButton.svg diff --git a/ui/chatForm/searchUpButton.svg b/themes/default/chatForm/searchUpButton.svg similarity index 100% rename from ui/chatForm/searchUpButton.svg rename to themes/default/chatForm/searchUpButton.svg diff --git a/ui/chatForm/sendButton.svg b/themes/default/chatForm/sendButton.svg similarity index 100% rename from ui/chatForm/sendButton.svg rename to themes/default/chatForm/sendButton.svg diff --git a/ui/chatForm/videoButton.svg b/themes/default/chatForm/videoButton.svg similarity index 100% rename from ui/chatForm/videoButton.svg rename to themes/default/chatForm/videoButton.svg diff --git a/ui/chatForm/videoButtonRed.svg b/themes/default/chatForm/videoButtonRed.svg similarity index 100% rename from ui/chatForm/videoButtonRed.svg rename to themes/default/chatForm/videoButtonRed.svg diff --git a/ui/chatForm/videoPreview.svg b/themes/default/chatForm/videoPreview.svg similarity index 100% rename from ui/chatForm/videoPreview.svg rename to themes/default/chatForm/videoPreview.svg diff --git a/ui/chatForm/videoPreviewRed.svg b/themes/default/chatForm/videoPreviewRed.svg similarity index 100% rename from ui/chatForm/videoPreviewRed.svg rename to themes/default/chatForm/videoPreviewRed.svg diff --git a/ui/chatForm/volButton.svg b/themes/default/chatForm/volButton.svg similarity index 100% rename from ui/chatForm/volButton.svg rename to themes/default/chatForm/volButton.svg diff --git a/ui/chatForm/volButtonRed.svg b/themes/default/chatForm/volButtonRed.svg similarity index 100% rename from ui/chatForm/volButtonRed.svg rename to themes/default/chatForm/volButtonRed.svg diff --git a/ui/contentDialog/contentDialog.css b/themes/default/contentDialog/contentDialog.css similarity index 100% rename from ui/contentDialog/contentDialog.css rename to themes/default/contentDialog/contentDialog.css diff --git a/ui/emoteButton/emoteButton.css b/themes/default/emoteButton/emoteButton.css similarity index 82% rename from ui/emoteButton/emoteButton.css rename to themes/default/emoteButton/emoteButton.css index 237e3cc31..0d9ba959d 100644 --- a/ui/emoteButton/emoteButton.css +++ b/themes/default/emoteButton/emoteButton.css @@ -1,7 +1,7 @@ QPushButton { background-color: #6bc260; - background-image: url(":/ui/emoteButton/emoteButton.svg"); + background-image: url("@getImagePath(emoteButton/emoteButton.svg)"); background-repeat: none; background-position: center; border-top-right-radius: 5px; diff --git a/ui/emoteButton/emoteButton.svg b/themes/default/emoteButton/emoteButton.svg similarity index 100% rename from ui/emoteButton/emoteButton.svg rename to themes/default/emoteButton/emoteButton.svg diff --git a/ui/emoticonWidget/dot_page.svg b/themes/default/emoticonWidget/dot_page.svg similarity index 100% rename from ui/emoticonWidget/dot_page.svg rename to themes/default/emoticonWidget/dot_page.svg diff --git a/ui/emoticonWidget/dot_page_current.svg b/themes/default/emoticonWidget/dot_page_current.svg similarity index 100% rename from ui/emoticonWidget/dot_page_current.svg rename to themes/default/emoticonWidget/dot_page_current.svg diff --git a/ui/emoticonWidget/dot_page_hover.svg b/themes/default/emoticonWidget/dot_page_hover.svg similarity index 100% rename from ui/emoticonWidget/dot_page_hover.svg rename to themes/default/emoticonWidget/dot_page_hover.svg diff --git a/ui/emoticonWidget/emoticonWidget.css b/themes/default/emoticonWidget/emoticonWidget.css similarity index 64% rename from ui/emoticonWidget/emoticonWidget.css rename to themes/default/emoticonWidget/emoticonWidget.css index c24683f11..9074241e4 100644 --- a/ui/emoticonWidget/emoticonWidget.css +++ b/themes/default/emoticonWidget/emoticonWidget.css @@ -15,22 +15,22 @@ QRadioButton::indicator QRadioButton::indicator:unchecked { - image: url(:/ui/emoticonWidget/dot_page.svg); + image: url(@getImagePath(emoticonWidget/dot_page.svg)); } QRadioButton::indicator:unchecked:hover { - image: url(:/ui/emoticonWidget/dot_page_hover.svg); + image: url(@getImagePath(emoticonWidget/dot_page_hover.svg)); } QRadioButton::indicator:unchecked:pressed { - image: url(:/ui/emoticonWidget/dot_page_hover.svg); + image: url(@getImagePath(emoticonWidget/dot_page_hover.svg)); } QRadioButton::indicator:checked { - image: url(:/ui/emoticonWidget/dot_page_current.svg); + image: url(@getImagePath(emoticonWidget/dot_page_current.svg)); } QMenu diff --git a/ui/fileButton/fileButton.css b/themes/default/fileButton/fileButton.css similarity index 85% rename from ui/fileButton/fileButton.css rename to themes/default/fileButton/fileButton.css index 50854944b..7d6fb6258 100644 --- a/ui/fileButton/fileButton.css +++ b/themes/default/fileButton/fileButton.css @@ -1,7 +1,7 @@ QPushButton { background-color: #6bc260; - background-image: url(":/ui/fileButton/fileButton.svg"); + background-image: url("@getImagePath(fileButton/fileButton.svg)"); background-repeat: none; background-position: center; border-bottom-right-radius: 5px; diff --git a/ui/fileButton/fileButton.svg b/themes/default/fileButton/fileButton.svg similarity index 100% rename from ui/fileButton/fileButton.svg rename to themes/default/fileButton/fileButton.svg diff --git a/ui/fileTransferInstance/arrow_white.svg b/themes/default/fileTransferInstance/arrow_white.svg similarity index 100% rename from ui/fileTransferInstance/arrow_white.svg rename to themes/default/fileTransferInstance/arrow_white.svg diff --git a/ui/fileTransferInstance/browse.svg b/themes/default/fileTransferInstance/browse.svg similarity index 100% rename from ui/fileTransferInstance/browse.svg rename to themes/default/fileTransferInstance/browse.svg diff --git a/ui/fileTransferInstance/dir.svg b/themes/default/fileTransferInstance/dir.svg similarity index 100% rename from ui/fileTransferInstance/dir.svg rename to themes/default/fileTransferInstance/dir.svg diff --git a/ui/fileTransferInstance/filetransferWidget.css b/themes/default/fileTransferInstance/filetransferWidget.css similarity index 100% rename from ui/fileTransferInstance/filetransferWidget.css rename to themes/default/fileTransferInstance/filetransferWidget.css diff --git a/ui/fileTransferInstance/no.svg b/themes/default/fileTransferInstance/no.svg similarity index 100% rename from ui/fileTransferInstance/no.svg rename to themes/default/fileTransferInstance/no.svg diff --git a/ui/fileTransferInstance/pause.svg b/themes/default/fileTransferInstance/pause.svg similarity index 100% rename from ui/fileTransferInstance/pause.svg rename to themes/default/fileTransferInstance/pause.svg diff --git a/ui/fileTransferInstance/yes.svg b/themes/default/fileTransferInstance/yes.svg similarity index 100% rename from ui/fileTransferInstance/yes.svg rename to themes/default/fileTransferInstance/yes.svg diff --git a/ui/fileTransferWidget/fileDone.svg b/themes/default/fileTransferWidget/fileDone.svg similarity index 100% rename from ui/fileTransferWidget/fileDone.svg rename to themes/default/fileTransferWidget/fileDone.svg diff --git a/ui/fileTransferWidget/fileTransferWidget.css b/themes/default/fileTransferWidget/fileTransferWidget.css similarity index 100% rename from ui/fileTransferWidget/fileTransferWidget.css rename to themes/default/fileTransferWidget/fileTransferWidget.css diff --git a/ui/friendList/friendList.css b/themes/default/friendList/friendList.css similarity index 100% rename from ui/friendList/friendList.css rename to themes/default/friendList/friendList.css diff --git a/ui/loginScreen/loginScreen.css b/themes/default/loginScreen/loginScreen.css similarity index 100% rename from ui/loginScreen/loginScreen.css rename to themes/default/loginScreen/loginScreen.css diff --git a/ui/msgEdit/msgEdit.css b/themes/default/msgEdit/msgEdit.css similarity index 100% rename from ui/msgEdit/msgEdit.css rename to themes/default/msgEdit/msgEdit.css diff --git a/ui/notificationEdge/notificationEdge.css b/themes/default/notificationEdge/notificationEdge.css similarity index 100% rename from ui/notificationEdge/notificationEdge.css rename to themes/default/notificationEdge/notificationEdge.css diff --git a/ui/rejectCall/rejectCall.svg b/themes/default/rejectCall/rejectCall.svg similarity index 100% rename from ui/rejectCall/rejectCall.svg rename to themes/default/rejectCall/rejectCall.svg diff --git a/ui/screenshotButton/screenshotButton.css b/themes/default/screenshotButton/screenshotButton.css similarity index 83% rename from ui/screenshotButton/screenshotButton.css rename to themes/default/screenshotButton/screenshotButton.css index 82d523193..7e5a94a57 100644 --- a/ui/screenshotButton/screenshotButton.css +++ b/themes/default/screenshotButton/screenshotButton.css @@ -1,7 +1,7 @@ QPushButton { background-color: #6bc260; - background-image: url(":/ui/screenshotButton/screenshotButton.svg"); + background-image: url("@getImagePath(screenshotButton/screenshotButton.svg)"); background-repeat: none; background-position: center; border-top-left-radius: 5px; diff --git a/ui/screenshotButton/screenshotButton.svg b/themes/default/screenshotButton/screenshotButton.svg similarity index 100% rename from ui/screenshotButton/screenshotButton.svg rename to themes/default/screenshotButton/screenshotButton.svg diff --git a/ui/sendButton/sendButton.css b/themes/default/sendButton/sendButton.css similarity index 82% rename from ui/sendButton/sendButton.css rename to themes/default/sendButton/sendButton.css index d3b9998a8..249a9737f 100644 --- a/ui/sendButton/sendButton.css +++ b/themes/default/sendButton/sendButton.css @@ -1,7 +1,7 @@ QPushButton { background-color: #6bc260; - background-image: url(":/ui/sendButton/sendButton.svg"); + background-image: url("@getImagePath(sendButton/sendButton.svg)"); background-repeat: none; background-position: center; border: none; diff --git a/ui/sendButton/sendButton.svg b/themes/default/sendButton/sendButton.svg similarity index 100% rename from ui/sendButton/sendButton.svg rename to themes/default/sendButton/sendButton.svg diff --git a/ui/settings/mainContent.css b/themes/default/settings/mainContent.css similarity index 100% rename from ui/settings/mainContent.css rename to themes/default/settings/mainContent.css diff --git a/ui/settings/mainHead.css b/themes/default/settings/mainHead.css similarity index 100% rename from ui/settings/mainHead.css rename to themes/default/settings/mainHead.css diff --git a/ui/statusButton/menu_indicator.svg b/themes/default/statusButton/menu_indicator.svg similarity index 100% rename from ui/statusButton/menu_indicator.svg rename to themes/default/statusButton/menu_indicator.svg diff --git a/ui/statusButton/statusButton.css b/themes/default/statusButton/statusButton.css similarity index 91% rename from ui/statusButton/statusButton.css rename to themes/default/statusButton/statusButton.css index f97975d2c..515153bad 100644 --- a/ui/statusButton/statusButton.css +++ b/themes/default/statusButton/statusButton.css @@ -33,7 +33,7 @@ QPushButton::menu-indicator {image: none;} QPushButton::menu-indicator:pressed, QPushButton::menu-indicator:open { - image: url(":ui/statusButton/menu_indicator.svg"); + image: url("@getImagePath(statusButton/menu_indicator.svg)"); subcontrol-origin: padding; subcontrol-position: bottom center; position: relative; diff --git a/ui/tooliconsZone/tooliconsZone.css b/themes/default/tooliconsZone/tooliconsZone.css similarity index 100% rename from ui/tooliconsZone/tooliconsZone.css rename to themes/default/tooliconsZone/tooliconsZone.css diff --git a/ui/window/general.css b/themes/default/window/general.css similarity index 100% rename from ui/window/general.css rename to themes/default/window/general.css diff --git a/ui/window/profile.css b/themes/default/window/profile.css similarity index 100% rename from ui/window/profile.css rename to themes/default/window/profile.css diff --git a/ui/window/statusPanel.css b/themes/default/window/statusPanel.css similarity index 97% rename from ui/window/statusPanel.css rename to themes/default/window/statusPanel.css index 3b94f248e..f0bab5f38 100644 --- a/ui/window/statusPanel.css +++ b/themes/default/window/statusPanel.css @@ -119,7 +119,7 @@ QListView #statusPanel > #statusHead > #statusButton::menu-indicator:pressed, #statusPanel > #statusHead > #statusButton::menu-indicator:open { - image: url(":ui/statusButton/menu_indicator.png"); + image: url("@getImagePath(statusButton/menu_indicator.svg)"); subcontrol-origin: padding; subcontrol-position: bottom center; position: relative; diff --git a/ui/window/window.css b/themes/default/window/window.css similarity index 52% rename from ui/window/window.css rename to themes/default/window/window.css index 49c60da8c..c56387d25 100644 --- a/ui/window/window.css +++ b/themes/default/window/window.css @@ -35,38 +35,38 @@ QPushButton#minimizeButton { border: 0px solid transparent; background-color: transparent; - image: url(":ui/window/minimizeButton.png"); + image: url("@getImagePath(window/minimizeButton.png)"); } -QPushButton#minimizeButton:hover {image: url(":ui/window/minimizeButtonHover.png");} -QPushButton#minimizeButton:pressed {image: url(":ui/window/minimizeButtonPressed.png");} +QPushButton#minimizeButton:hover {image: url("@getImagePath(window/minimizeButtonHover.png)");} +QPushButton#minimizeButton:pressed {image: url("@getImagePath(window/minimizeButtonPressed.png)");} QPushButton#minimizeButton:focus {outline: none;} QPushButton#maximizeButton { border: 0px solid transparent; background-color: transparent; - image: url(":ui/window/maximizeButton.png"); + image: url("@getImagePath(window/maximizeButton.png"); } -QPushButton#maximizeButton:hover {image: url(":ui/window/maximizeButtonHover.png");} -QPushButton#maximizeButton:pressed {image: url(":ui/window/maximizeButtonPressed.png");} +QPushButton#maximizeButton:hover {image: url("@getImagePath(window/maximizeButtonHover.png)");} +QPushButton#maximizeButton:pressed {image: url("@getImagePath(window/maximizeButtonPressed.png)");} QPushButton#maximizeButton:focus {outline: none;} QPushButton#closeButton { border: 0px solid transparent; background-color: transparent; - image: url(":ui/window/closeButton.png"); + image: url("@getImagePath(window/closeButton.png"); } -QPushButton#closeButton:hover {image: url(":ui/window/closeButtonHover.png");} -QPushButton#closeButton:pressed {image: url(":ui/window/closeButtonPressed.png");} +QPushButton#closeButton:hover {image: url("@getImagePath(window/closeButtonHover.png)");} +QPushButton#closeButton:pressed {image: url("@getImagePath(window/closeButtonPressed.png)");} QPushButton#closeButton:focus {outline: none;} QPushButton#restoreButton { border: 0px solid transparent; background-color: transparent; - image: url(":ui/window/restoreButton.png"); + image: url("@getImagePath(window/restoreButton.png)"); } -QPushButton#restoreButton:hover {image: url(":ui/window/restoreButtonHover.png");} -QPushButton#restoreButton:pressed {image: url(":ui/window/restoreButtonPressed.png");} +QPushButton#restoreButton:hover {image: url("@getImagePath(window/restoreButtonHover.png)");} +QPushButton#restoreButton:pressed {image: url("@getImagePath(window/restoreButtonPressed.png)");} QPushButton#restoreButton:focus {outline: none;}