From 7e96a17f3b0a2081073671efae8595d28e1b7181 Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Fri, 19 Jun 2020 14:21:02 -0400 Subject: [PATCH] fix: add StyledTextEdit and TextField to use the font --- ui/app/AppLayouts/Chat/ChatColumn/ChatInput.qml | 2 +- ui/app/AppLayouts/Chat/ChatColumn/Message.qml | 6 +++--- ui/app/AppLayouts/Chat/ChatColumn/TopBar.qml | 2 +- ui/app/AppLayouts/Chat/ContactsColumn/Channel.qml | 5 +++-- ui/app/AppLayouts/Chat/components/GroupInfoPopup.qml | 2 +- ui/app/AppLayouts/Chat/components/ProfilePopup.qml | 2 +- ui/app/AppLayouts/Node/NodeLayout.qml | 2 +- ui/app/AppLayouts/Wallet/LeftTab.qml | 2 +- ui/nim-status-client.pro | 2 ++ ui/shared/Input.qml | 2 +- ui/shared/StyledTextEdit.qml | 6 ++++++ ui/shared/StyledTextField.qml | 7 +++++++ ui/shared/TextWithLabel.qml | 2 +- ui/shared/qmldir | 2 ++ 14 files changed, 31 insertions(+), 13 deletions(-) create mode 100644 ui/shared/StyledTextEdit.qml create mode 100644 ui/shared/StyledTextField.qml diff --git a/ui/app/AppLayouts/Chat/ChatColumn/ChatInput.qml b/ui/app/AppLayouts/Chat/ChatColumn/ChatInput.qml index b72bd9a916..c670e68a86 100644 --- a/ui/app/AppLayouts/Chat/ChatColumn/ChatInput.qml +++ b/ui/app/AppLayouts/Chat/ChatColumn/ChatInput.qml @@ -48,7 +48,7 @@ Rectangle { } } - TextField { + StyledTextField { id: txtData text: "" padding: 0 diff --git a/ui/app/AppLayouts/Chat/ChatColumn/Message.qml b/ui/app/AppLayouts/Chat/ChatColumn/Message.qml index 0495080434..9cacd9e9a6 100644 --- a/ui/app/AppLayouts/Chat/ChatColumn/Message.qml +++ b/ui/app/AppLayouts/Chat/ChatColumn/Message.qml @@ -172,7 +172,7 @@ Item { } } - TextEdit { + StyledTextEdit { id: chatName text: userName anchors.leftMargin: 20 @@ -227,7 +227,7 @@ Item { z: -1 } - TextEdit { + StyledTextEdit { id: chatText text: message anchors.left: parent.left @@ -258,7 +258,7 @@ Item { visible: contentType == Constants.stickerType } - TextEdit { + StyledTextEdit { id: chatTime color: Theme.darkGrey text: timestamp diff --git a/ui/app/AppLayouts/Chat/ChatColumn/TopBar.qml b/ui/app/AppLayouts/Chat/ChatColumn/TopBar.qml index 261026b704..ec54e046a5 100644 --- a/ui/app/AppLayouts/Chat/ChatColumn/TopBar.qml +++ b/ui/app/AppLayouts/Chat/ChatColumn/TopBar.qml @@ -23,7 +23,7 @@ Rectangle { channelIdenticon: chatsModel.activeChannel.identicon } - TextEdit { + StyledTextEdit { id: channelName width: 80 height: 20 diff --git a/ui/app/AppLayouts/Chat/ContactsColumn/Channel.qml b/ui/app/AppLayouts/Chat/ContactsColumn/Channel.qml index 20d6a75b1a..dc41934bbc 100644 --- a/ui/app/AppLayouts/Chat/ContactsColumn/Channel.qml +++ b/ui/app/AppLayouts/Chat/ContactsColumn/Channel.qml @@ -8,7 +8,7 @@ Rectangle { property string name: "channelName" property string lastMessage: "My latest message\n with a return" property string timestamp: "20/2/2020" - property string unviewedMessagesCount: "2" + property string unviewedMessagesCount: "7" property string chatType: Constants.chatTypePublic property string searchStr: "" @@ -110,7 +110,8 @@ Rectangle { visible: unviewedMessagesCount > 0 StyledText { id: contactNumberChats - text: wrapper.unviewedMessagesCount + text: wrapper.unviewedMessagesCount < 100 ? wrapper.unviewedMessagesCount : "99" + font.pixelSize: 12 anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter color: "white" diff --git a/ui/app/AppLayouts/Chat/components/GroupInfoPopup.qml b/ui/app/AppLayouts/Chat/components/GroupInfoPopup.qml index 2de30e7bc9..6588ffa954 100644 --- a/ui/app/AppLayouts/Chat/components/GroupInfoPopup.qml +++ b/ui/app/AppLayouts/Chat/components/GroupInfoPopup.qml @@ -32,7 +32,7 @@ ModalPopup { } } - TextEdit { + StyledTextEdit { id: groupName text: chatsModel.activeChannel.name anchors.top: parent.top diff --git a/ui/app/AppLayouts/Chat/components/ProfilePopup.qml b/ui/app/AppLayouts/Chat/components/ProfilePopup.qml index 77acae53db..7e5601e64a 100644 --- a/ui/app/AppLayouts/Chat/components/ProfilePopup.qml +++ b/ui/app/AppLayouts/Chat/components/ProfilePopup.qml @@ -39,7 +39,7 @@ ModalPopup { } } - TextEdit { + StyledTextEdit { id: profileName text: userName anchors.top: parent.top diff --git a/ui/app/AppLayouts/Node/NodeLayout.qml b/ui/app/AppLayouts/Node/NodeLayout.qml index bb7461c5cd..1e875e10e6 100644 --- a/ui/app/AppLayouts/Node/NodeLayout.qml +++ b/ui/app/AppLayouts/Node/NodeLayout.qml @@ -99,7 +99,7 @@ SplitView { } } - TextField { + StyledTextField { id: txtData text: "" leftPadding: 0 diff --git a/ui/app/AppLayouts/Wallet/LeftTab.qml b/ui/app/AppLayouts/Wallet/LeftTab.qml index a8f0ea2740..e0804f41fa 100644 --- a/ui/app/AppLayouts/Wallet/LeftTab.qml +++ b/ui/app/AppLayouts/Wallet/LeftTab.qml @@ -52,7 +52,7 @@ Item { anchors.topMargin: Theme.padding height: walletAmountValue.height + totalValue.height - TextEdit { + StyledTextEdit { id: walletAmountValue color: "black" text: walletModel.totalFiatBalance diff --git a/ui/nim-status-client.pro b/ui/nim-status-client.pro index b93247b71a..d053cc62e7 100644 --- a/ui/nim-status-client.pro +++ b/ui/nim-status-client.pro @@ -208,6 +208,8 @@ DISTFILES += \ shared/RoundedIcon.qml \ shared/StyledText.qml \ shared/StyledTextArea.qml \ + shared/StyledTextEdit.qml \ + shared/StyledTextField.qml \ shared/TextWithLabel.qml \ shared/qmldir diff --git a/ui/shared/Input.qml b/ui/shared/Input.qml index 3c48b23d42..3b18d506e3 100644 --- a/ui/shared/Input.qml +++ b/ui/shared/Input.qml @@ -49,7 +49,7 @@ Item { anchors.topMargin: inputBox.hasLabel ? inputBox.labelMargin : 0 anchors.right: parent.right anchors.left: parent.left - TextField { + StyledTextField { id: inputValue visible: !inputBox.isTextArea && !inputBox.isSelect placeholderText: inputBox.placeholderText diff --git a/ui/shared/StyledTextEdit.qml b/ui/shared/StyledTextEdit.qml new file mode 100644 index 0000000000..368ebd0bba --- /dev/null +++ b/ui/shared/StyledTextEdit.qml @@ -0,0 +1,6 @@ +import QtQuick 2.13 +import "../imports" + +TextEdit { + font.family: Theme.fontRegular.name +} diff --git a/ui/shared/StyledTextField.qml b/ui/shared/StyledTextField.qml new file mode 100644 index 0000000000..b9ca26b923 --- /dev/null +++ b/ui/shared/StyledTextField.qml @@ -0,0 +1,7 @@ +import QtQuick 2.13 +import QtQuick.Controls 2.13 +import "../imports" + +TextField { + font.family: Theme.fontRegular.name +} diff --git a/ui/shared/TextWithLabel.qml b/ui/shared/TextWithLabel.qml index 64ff35ed29..7685aee948 100644 --- a/ui/shared/TextWithLabel.qml +++ b/ui/shared/TextWithLabel.qml @@ -25,7 +25,7 @@ Item { color: Theme.darkGrey } - TextEdit { + StyledTextEdit { id: textItem text: inputBox.text selectByMouse: true diff --git a/ui/shared/qmldir b/ui/shared/qmldir index 6daf29dd7e..b8acdc5dc4 100644 --- a/ui/shared/qmldir +++ b/ui/shared/qmldir @@ -10,4 +10,6 @@ SearchBox 1.0 SearchBox.qml Select 1.0 Select.qml StyledTextArea 1.0 StyledTextArea.qml StyledText 1.0 StyledText.qml +StyledTextField 1.0 StyledTextField.qml +StyledTextEdit 1.0 StyledTextEdit.qml RoundImage 1.0 RoundImage.qml