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.
|
@ -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
|
||||
|
|
124
res.qrc
|
@ -44,70 +44,70 @@
|
|||
<file>img/taskbar/light/taskbar_offline.svg</file>
|
||||
<file>img/taskbar/light/taskbar_event.svg</file>
|
||||
<file>img/transfer.svg</file>
|
||||
<file>ui/fileTransferWidget/fileDone.svg</file>
|
||||
<file>ui/chatArea/chatArea.css</file>
|
||||
<file>ui/chatArea/chatHead.css</file>
|
||||
<file>ui/chatArea/innerStyle.css</file>
|
||||
<file>ui/chatArea/scrollBarUpArrow.svg</file>
|
||||
<file>ui/chatArea/scrollBarDownArrow.svg</file>
|
||||
<file>ui/chatArea/scrollBarLeftArrow.svg</file>
|
||||
<file>ui/chatArea/scrollBarRightArrow.svg</file>
|
||||
<file>ui/chatForm/buttons.css</file>
|
||||
<file>ui/chatForm/fullScreenButtons.css</file>
|
||||
<file>ui/chatForm/callButton.svg</file>
|
||||
<file>ui/chatForm/labels.css</file>
|
||||
<file>ui/chatForm/micButton.svg</file>
|
||||
<file>ui/chatForm/micButtonRed.svg</file>
|
||||
<file>ui/chatForm/videoButton.svg</file>
|
||||
<file>ui/chatForm/videoButtonRed.svg</file>
|
||||
<file>ui/chatForm/volButton.svg</file>
|
||||
<file>ui/chatForm/volButtonRed.svg</file>
|
||||
<file>ui/chatForm/videoPreview.svg</file>
|
||||
<file>ui/chatForm/videoPreviewRed.svg</file>
|
||||
<file>ui/chatForm/emoteButton.svg</file>
|
||||
<file>ui/chatForm/fileButton.svg</file>
|
||||
<file>ui/chatForm/screenshotButton.svg</file>
|
||||
<file>ui/chatForm/searchCalendarButton.svg</file>
|
||||
<file>ui/chatForm/searchDownButton.svg</file>
|
||||
<file>ui/chatForm/searchHideButton.svg</file>
|
||||
<file>ui/chatForm/searchSettingsButton.svg</file>
|
||||
<file>ui/chatForm/searchUpButton.svg</file>
|
||||
<file>ui/chatForm/sendButton.svg</file>
|
||||
<file>ui/chatForm/exitFullScreenButton.svg</file>
|
||||
<file>ui/emoticonWidget/dot_page.svg</file>
|
||||
<file>ui/emoticonWidget/dot_page_current.svg</file>
|
||||
<file>ui/emoticonWidget/dot_page_hover.svg</file>
|
||||
<file>ui/emoticonWidget/emoticonWidget.css</file>
|
||||
<file>ui/fileTransferWidget/fileTransferWidget.css</file>
|
||||
<file>ui/friendList/friendList.css</file>
|
||||
<file>ui/msgEdit/msgEdit.css</file>
|
||||
<file>ui/settings/mainContent.css</file>
|
||||
<file>ui/settings/mainHead.css</file>
|
||||
<file>ui/statusButton/statusButton.css</file>
|
||||
<file>ui/statusButton/menu_indicator.svg</file>
|
||||
<file>ui/window/general.css</file>
|
||||
<file>ui/window/profile.css</file>
|
||||
<file>ui/window/statusPanel.css</file>
|
||||
<file>ui/window/window.css</file>
|
||||
<file>ui/chatArea/info.svg</file>
|
||||
<file>ui/chatArea/spinner.svg</file>
|
||||
<file>ui/chatArea/typing.svg</file>
|
||||
<file>ui/chatArea/error.svg</file>
|
||||
<file>ui/fileTransferInstance/no.svg</file>
|
||||
<file>ui/fileTransferInstance/pause.svg</file>
|
||||
<file>ui/fileTransferInstance/yes.svg</file>
|
||||
<file>ui/fileTransferInstance/dir.svg</file>
|
||||
<file>ui/fileTransferInstance/arrow_white.svg</file>
|
||||
<file>ui/fileTransferInstance/browse.svg</file>
|
||||
<file>ui/fileTransferInstance/filetransferWidget.css</file>
|
||||
<file>ui/acceptCall/acceptCall.svg</file>
|
||||
<file>ui/rejectCall/rejectCall.svg</file>
|
||||
<file>themes/default/fileTransferWidget/fileDone.svg</file>
|
||||
<file>themes/default/chatArea/chatArea.css</file>
|
||||
<file>themes/default/chatArea/chatHead.css</file>
|
||||
<file>themes/default/chatArea/innerStyle.css</file>
|
||||
<file>themes/default/chatArea/scrollBarUpArrow.svg</file>
|
||||
<file>themes/default/chatArea/scrollBarDownArrow.svg</file>
|
||||
<file>themes/default/chatArea/scrollBarLeftArrow.svg</file>
|
||||
<file>themes/default/chatArea/scrollBarRightArrow.svg</file>
|
||||
<file>themes/default/chatForm/buttons.css</file>
|
||||
<file>themes/default/chatForm/fullScreenButtons.css</file>
|
||||
<file>themes/default/chatForm/callButton.svg</file>
|
||||
<file>themes/default/chatForm/labels.css</file>
|
||||
<file>themes/default/chatForm/micButton.svg</file>
|
||||
<file>themes/default/chatForm/micButtonRed.svg</file>
|
||||
<file>themes/default/chatForm/videoButton.svg</file>
|
||||
<file>themes/default/chatForm/videoButtonRed.svg</file>
|
||||
<file>themes/default/chatForm/volButton.svg</file>
|
||||
<file>themes/default/chatForm/volButtonRed.svg</file>
|
||||
<file>themes/default/chatForm/videoPreview.svg</file>
|
||||
<file>themes/default/chatForm/videoPreviewRed.svg</file>
|
||||
<file>themes/default/chatForm/emoteButton.svg</file>
|
||||
<file>themes/default/chatForm/fileButton.svg</file>
|
||||
<file>themes/default/chatForm/screenshotButton.svg</file>
|
||||
<file>themes/default/chatForm/searchCalendarButton.svg</file>
|
||||
<file>themes/default/chatForm/searchDownButton.svg</file>
|
||||
<file>themes/default/chatForm/searchHideButton.svg</file>
|
||||
<file>themes/default/chatForm/searchSettingsButton.svg</file>
|
||||
<file>themes/default/chatForm/searchUpButton.svg</file>
|
||||
<file>themes/default/chatForm/sendButton.svg</file>
|
||||
<file>themes/default/chatForm/exitFullScreenButton.svg</file>
|
||||
<file>themes/default/emoticonWidget/dot_page.svg</file>
|
||||
<file>themes/default/emoticonWidget/dot_page_current.svg</file>
|
||||
<file>themes/default/emoticonWidget/dot_page_hover.svg</file>
|
||||
<file>themes/default/emoticonWidget/emoticonWidget.css</file>
|
||||
<file>themes/default/fileTransferWidget/fileTransferWidget.css</file>
|
||||
<file>themes/default/friendList/friendList.css</file>
|
||||
<file>themes/default/msgEdit/msgEdit.css</file>
|
||||
<file>themes/default/settings/mainContent.css</file>
|
||||
<file>themes/default/settings/mainHead.css</file>
|
||||
<file>themes/default/statusButton/statusButton.css</file>
|
||||
<file>themes/default/statusButton/menu_indicator.svg</file>
|
||||
<file>themes/default/window/general.css</file>
|
||||
<file>themes/default/window/profile.css</file>
|
||||
<file>themes/default/window/statusPanel.css</file>
|
||||
<file>themes/default/window/window.css</file>
|
||||
<file>themes/default/chatArea/info.svg</file>
|
||||
<file>themes/default/chatArea/spinner.svg</file>
|
||||
<file>themes/default/chatArea/typing.svg</file>
|
||||
<file>themes/default/chatArea/error.svg</file>
|
||||
<file>themes/default/fileTransferInstance/no.svg</file>
|
||||
<file>themes/default/fileTransferInstance/pause.svg</file>
|
||||
<file>themes/default/fileTransferInstance/yes.svg</file>
|
||||
<file>themes/default/fileTransferInstance/dir.svg</file>
|
||||
<file>themes/default/fileTransferInstance/arrow_white.svg</file>
|
||||
<file>themes/default/fileTransferInstance/browse.svg</file>
|
||||
<file>themes/default/fileTransferInstance/filetransferWidget.css</file>
|
||||
<file>themes/default/acceptCall/acceptCall.svg</file>
|
||||
<file>themes/default/rejectCall/rejectCall.svg</file>
|
||||
<file>img/login_logo.svg</file>
|
||||
<file>ui/notificationEdge/notificationEdge.css</file>
|
||||
<file>ui/loginScreen/loginScreen.css</file>
|
||||
<file>themes/default/notificationEdge/notificationEdge.css</file>
|
||||
<file>themes/default/loginScreen/loginScreen.css</file>
|
||||
<file>img/others/logout-icon.svg</file>
|
||||
<file>img/caps_lock.svg</file>
|
||||
<file>ui/contentDialog/contentDialog.css</file>
|
||||
<file>ui/tooliconsZone/tooliconsZone.css</file>
|
||||
<file>themes/default/contentDialog/contentDialog.css</file>
|
||||
<file>themes/default/tooliconsZone/tooliconsZone.css</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include "content/spinner.h"
|
||||
#include "content/text.h"
|
||||
#include "content/timestamp.h"
|
||||
#include "src/widget/style.h"
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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"));
|
||||
}
|
||||
|
|
|
@ -297,7 +297,7 @@
|
|||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../res.qrc">
|
||||
<normaloff>:/ui/fileTransferInstance/no.svg</normaloff>:/ui/fileTransferInstance/no.svg</iconset>
|
||||
<normaloff>:themes/default/fileTransferInstance/no.svg</normaloff>:themes/default/fileTransferInstance/no.svg</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
|
@ -383,7 +383,7 @@
|
|||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../res.qrc">
|
||||
<normaloff>:/ui/fileTransferInstance/no.svg</normaloff>:/ui/fileTransferInstance/no.svg</iconset>
|
||||
<normaloff>:themes/default/fileTransferInstance/no.svg</normaloff>:themes/default/fileTransferInstance/no.svg</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
|
@ -421,7 +421,7 @@
|
|||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../res.qrc">
|
||||
<normaloff>:/ui/fileTransferInstance/no.svg</normaloff>:/ui/fileTransferInstance/no.svg</iconset>
|
||||
<normaloff>:themes/default/fileTransferInstance/no.svg</normaloff>:themes/default/fileTransferInstance/no.svg</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
#include "notificationicon.h"
|
||||
#include "../pixmapcache.h"
|
||||
#include "src/widget/style.h"
|
||||
|
||||
#include <QGraphicsScene>
|
||||
#include <QPainter>
|
||||
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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")));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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{},
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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 <QFileInfo>
|
||||
#include <QWindow>
|
||||
|
||||
FilesForm::FilesForm()
|
||||
: QObject()
|
||||
, doneIcon(":/ui/fileTransferWidget/fileDone.svg")
|
||||
, doneIcon(Style::getImagePath("fileTransferWidget/fileDone.svg"))
|
||||
{
|
||||
head = new QWidget();
|
||||
QFont bold;
|
||||
|
|
|
@ -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"));
|
||||
}
|
||||
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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<void(QComboBox::*)(int)>(&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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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<unsigned long>(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);
|
||||
}
|
||||
|
||||
|
|
|
@ -22,11 +22,13 @@
|
|||
#include "src/widget/gui.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QDir>
|
||||
#include <QFile>
|
||||
#include <QFontInfo>
|
||||
#include <QMap>
|
||||
#include <QPainter>
|
||||
#include <QRegularExpression>
|
||||
#include <QStringBuilder>
|
||||
#include <QStyle>
|
||||
#include <QSvgRenderer>
|
||||
#include <QWidget>
|
||||
|
@ -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<QColor> Style::themeColorColors = {QColor(), QColor("#004aa4"), QColor("#97ba00"),
|
||||
QColor("#c23716"), QColor("#4617b5")};
|
||||
|
||||
|
@ -98,7 +125,8 @@ std::map<std::pair<const QString, const QFont>, const QString> Style::stylesheet
|
|||
|
||||
const QString Style::getStylesheet(const QString& filename, const QFont& baseFont)
|
||||
{
|
||||
const std::pair<const QString, const QFont> cacheKey(filename, baseFont);
|
||||
const QString fullPath = getThemePath() + filename;
|
||||
const std::pair<const QString, const QFont> 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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
|
||||
#include "callconfirmwidget.h"
|
||||
#include "src/widget/style.h"
|
||||
#include "src/widget/widget.h"
|
||||
#include <QDialogButtonBox>
|
||||
#include <QHBoxLayout>
|
||||
|
@ -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());
|
||||
|
||||
|
|
|
@ -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()) {
|
||||
|
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 894 B After Width: | Height: | Size: 894 B |
Before Width: | Height: | Size: 904 B After Width: | Height: | Size: 904 B |
Before Width: | Height: | Size: 902 B After Width: | Height: | Size: 902 B |
Before Width: | Height: | Size: 897 B After Width: | Height: | Size: 897 B |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 9.1 KiB After Width: | Height: | Size: 9.1 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
|
@ -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;
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
|
@ -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)");
|
||||
}
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 482 B After Width: | Height: | Size: 482 B |
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
|
@ -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;
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
|
@ -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
|
|
@ -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;
|
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 888 B After Width: | Height: | Size: 888 B |
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 5.3 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
@ -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;
|
Before Width: | Height: | Size: 482 B After Width: | Height: | Size: 482 B |
|
@ -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;
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 862 B After Width: | Height: | Size: 862 B |
|
@ -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;
|
|
@ -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;
|
|
@ -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;}
|