From d1715500f7fcdae1287bbec4447c0a8a00bae8bc Mon Sep 17 00:00:00 2001 From: TriKriSta Date: Sun, 31 Mar 2019 17:57:17 +0300 Subject: [PATCH] style: use css files for toxId --- res.qrc | 2 ++ src/widget/form/addfriendform.cpp | 3 ++- themes/dark/addFriendForm/toxId.css | 3 +++ themes/default/addFriendForm/toxId.css | 3 +++ 4 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 themes/dark/addFriendForm/toxId.css create mode 100644 themes/default/addFriendForm/toxId.css diff --git a/res.qrc b/res.qrc index c650a8e35..b626a0840 100644 --- a/res.qrc +++ b/res.qrc @@ -105,6 +105,7 @@ themes/dark/fileTransferInstance/filetransferWidget.css themes/dark/genericChatForm/genericChatForm.css themes/dark/acceptCall/acceptCall.svg + themes/dark/addFriendForm/toxId.css themes/dark/rejectCall/rejectCall.svg themes/dark/notificationEdge/notificationEdge.css themes/dark/loginScreen/loginScreen.css @@ -169,6 +170,7 @@ themes/default/fileTransferInstance/filetransferWidget.css themes/default/genericChatForm/genericChatForm.css themes/default/acceptCall/acceptCall.svg + themes/default/addFriendForm/toxId.css themes/default/rejectCall/rejectCall.svg img/login_logo.svg themes/default/notificationEdge/notificationEdge.css diff --git a/src/widget/form/addfriendform.cpp b/src/widget/form/addfriendform.cpp index 0fcc9e4ab..c7d61309c 100644 --- a/src/widget/form/addfriendform.cpp +++ b/src/widget/form/addfriendform.cpp @@ -25,6 +25,7 @@ #include "src/widget/contentlayout.h" #include "src/widget/gui.h" #include "src/widget/tool/croppinglabel.h" +#include "src/widget/style.h" #include "src/widget/translator.h" #include #include @@ -294,7 +295,7 @@ void AddFriendForm::onIdChanged(const QString& id) isValidId ? QStringLiteral("%1 (%2)") : QStringLiteral("%1 (%2)"); toxIdLabel.setText(labelText.arg(toxIdText, toxIdComment)); toxId.setStyleSheet(isValidOrEmpty ? QStringLiteral("") - : QStringLiteral("QLineEdit { background-color: #FFC1C1; }")); + : Style::getStylesheet("addFriendForm/toxId.css")); toxId.setToolTip(isValidOrEmpty ? QStringLiteral("") : tr("Invalid Tox ID format")); sendButton.setEnabled(isValidId); diff --git a/themes/dark/addFriendForm/toxId.css b/themes/dark/addFriendForm/toxId.css new file mode 100644 index 000000000..073a2ca38 --- /dev/null +++ b/themes/dark/addFriendForm/toxId.css @@ -0,0 +1,3 @@ +QLineEdit { + background-color: #8a3f3a; +} diff --git a/themes/default/addFriendForm/toxId.css b/themes/default/addFriendForm/toxId.css new file mode 100644 index 000000000..b1e4fd772 --- /dev/null +++ b/themes/default/addFriendForm/toxId.css @@ -0,0 +1,3 @@ +QLineEdit { + background-color: #FFC1C1; +}