From 716ac2a0af09a46296b2bfad1f43a18459c8159c Mon Sep 17 00:00:00 2001 From: miruka Date: Fri, 17 Jul 2020 01:45:02 -0400 Subject: [PATCH] Refer to custom components to access their enums --- TODO.md | 2 +- src/gui/Base/HCheckBox.qml | 2 +- src/gui/Base/HLabeledItem.qml | 4 ++-- src/gui/Base/HNoticePage.qml | 2 +- src/gui/Base/HTextArea.qml | 6 +++--- src/gui/Base/HTextField.qml | 6 +++--- src/gui/Base/HToolTip.qml | 2 +- src/gui/DebugConsole.qml | 4 ++-- src/gui/Pages/AccountSettings/Account.qml | 4 ++-- src/gui/Pages/AccountSettings/Encryption.qml | 2 +- src/gui/Pages/AddAccount/Register.qml | 2 +- src/gui/Pages/AddAccount/Reset.qml | 2 +- src/gui/Pages/AddAccount/SignIn.qml | 2 +- src/gui/Pages/AddChat/CreateRoom.qml | 2 +- src/gui/Pages/AddChat/DirectChat.qml | 2 +- src/gui/Pages/AddChat/JoinRoom.qml | 2 +- src/gui/Pages/Chat/Banners/Banner.qml | 2 +- src/gui/Pages/Chat/FileTransfer/Transfer.qml | 2 +- src/gui/Popups/DetailsLabel.qml | 2 +- src/gui/Popups/InviteToRoomPopup.qml | 2 +- src/gui/Popups/PasswordPopup.qml | 4 ++-- src/gui/Popups/SummaryLabel.qml | 2 +- 22 files changed, 30 insertions(+), 30 deletions(-) diff --git a/TODO.md b/TODO.md index d58774f0..ce09f207 100644 --- a/TODO.md +++ b/TODO.md @@ -8,7 +8,6 @@ - fix local unread counters order - fix power level control button layout when apply button is loading -- @room? - publish room or alias control - open context menus centered on touch screens @@ -66,6 +65,7 @@ ## Interface +- Colorize "@room" in messages - Show scrollbars for a few seconds if there's content to scroll on when opening a page or popup - Device IP geolocation diff --git a/src/gui/Base/HCheckBox.qml b/src/gui/Base/HCheckBox.qml index a13fb8b4..c6499348 100644 --- a/src/gui/Base/HCheckBox.qml +++ b/src/gui/Base/HCheckBox.qml @@ -71,7 +71,7 @@ CheckBox { // Set a width on CheckBox for wrapping to work, // e.g. by using Layout.fillWidth - wrapMode: Text.Wrap + wrapMode: HLabel.Wrap leftPadding: box.indicator.width + box.spacing verticalAlignment: Text.AlignVCenter diff --git a/src/gui/Base/HLabeledItem.qml b/src/gui/Base/HLabeledItem.qml index 17565614..8bd21cd1 100644 --- a/src/gui/Base/HLabeledItem.qml +++ b/src/gui/Base/HLabeledItem.qml @@ -22,7 +22,7 @@ HColumnLayout { HLabel { id: label opacity: item.opacity - wrapMode: Text.Wrap + wrapMode: HLabel.Wrap Layout.fillWidth: true } @@ -77,7 +77,7 @@ HColumnLayout { id: errorLabel opacity: item.opacity visible: Layout.maximumHeight > 0 - wrapMode: Text.Wrap + wrapMode: HLabel.Wrap color: theme.colors.errorText Layout.maximumHeight: text ? implicitHeight : 0 diff --git a/src/gui/Base/HNoticePage.qml b/src/gui/Base/HNoticePage.qml index 6b62a0b1..9b4e8c15 100644 --- a/src/gui/Base/HNoticePage.qml +++ b/src/gui/Base/HNoticePage.qml @@ -15,7 +15,7 @@ HRowLayout { HLabel { id: noticeLabel horizontalAlignment: Text.AlignHCenter - wrapMode: Text.Wrap + wrapMode: HLabel.Wrap padding: theme.spacing / 2 leftPadding: theme.spacing rightPadding: leftPadding diff --git a/src/gui/Base/HTextArea.qml b/src/gui/Base/HTextArea.qml index f71a8768..48160f72 100644 --- a/src/gui/Base/HTextArea.qml +++ b/src/gui/Base/HTextArea.qml @@ -153,9 +153,9 @@ TextArea { bottomPadding: parent.bottomPadding wrapMode: - parent.wrapMode === TextEdit.Wrap ? Text.Wrap : - parent.wrapMode === TextEdit.WordWrap ? Text.WordWrap : - parent.wrapMode === TextEdit.WrapAnywhere ? Text.WrapAnywhere : + parent.wrapMode === TextEdit.Wrap ? HLabel.Wrap : + parent.wrapMode === TextEdit.WordWrap ? HLabel.WordWrap : + parent.wrapMode === TextEdit.WrapAnywhere ? HLabel.WrapAnywhere : Text.NoWrap font.family: parent.font.family diff --git a/src/gui/Base/HTextField.qml b/src/gui/Base/HTextField.qml index 5020e91b..65f698fc 100644 --- a/src/gui/Base/HTextField.qml +++ b/src/gui/Base/HTextField.qml @@ -135,9 +135,9 @@ TextField { bottomPadding: parent.bottomPadding wrapMode: - parent.wrapMode === TextField.Wrap ? Text.Wrap : - parent.wrapMode === TextField.WordWrap ? Text.WordWrap : - parent.wrapMode === TextField.WrapAnywhere ? Text.WrapAnywhere : + parent.wrapMode === TextField.Wrap ? HLabel.Wrap : + parent.wrapMode === TextField.WordWrap ? HLabel.WordWrap : + parent.wrapMode === TextField.WrapAnywhere ? HLabel.WrapAnywhere : Text.NoWrap font.family: parent.font.family diff --git a/src/gui/Base/HToolTip.qml b/src/gui/Base/HToolTip.qml index 8056de3c..04b50c6a 100644 --- a/src/gui/Base/HToolTip.qml +++ b/src/gui/Base/HToolTip.qml @@ -38,7 +38,7 @@ ToolTip { id: label color: theme.controls.toolTip.text text: toolTip.text - wrapMode: Text.Wrap + wrapMode: HLabel.Wrap leftPadding: theme.spacing / 1.5 rightPadding: leftPadding diff --git a/src/gui/DebugConsole.qml b/src/gui/DebugConsole.qml index 3f89a316..89ceeb59 100644 --- a/src/gui/DebugConsole.qml +++ b/src/gui/DebugConsole.qml @@ -162,7 +162,7 @@ HDrawer { HLabel { text: "> " + model.input - wrapMode: Text.Wrap + wrapMode: HLabel.Wrap color: theme.chat.message.quote font.family: theme.fontFamily.mono visible: Boolean(model.input) @@ -172,7 +172,7 @@ HDrawer { HLabel { text: "" + model.output - wrapMode: Text.Wrap + wrapMode: HLabel.Wrap color: model.error ? theme.colors.errorText : theme.colors.text font.family: theme.fontFamily.mono diff --git a/src/gui/Pages/AccountSettings/Account.qml b/src/gui/Pages/AccountSettings/Account.qml index 7fdc02f5..cb571e59 100644 --- a/src/gui/Pages/AccountSettings/Account.qml +++ b/src/gui/Pages/AccountSettings/Account.qml @@ -183,7 +183,7 @@ HFlickableColumnPage { theme.fontSize.big * avatar.width / 300, theme.fontSize.small, ) - wrapMode: Text.WordWrap + wrapMode: HLabel.WordWrap horizontalAlignment: Qt.AlignHCenter Layout.fillWidth: true @@ -204,7 +204,7 @@ HFlickableColumnPage { text: qsTr("User ID: %1") .arg(utils.coloredNameHtml(userId, userId, userId)) textFormat: Text.StyledText - wrapMode: Text.Wrap + wrapMode: HLabel.Wrap lineHeight: 1.1 Layout.fillWidth: true diff --git a/src/gui/Pages/AccountSettings/Encryption.qml b/src/gui/Pages/AccountSettings/Encryption.qml index 01e35f6b..de6de22d 100644 --- a/src/gui/Pages/AccountSettings/Encryption.qml +++ b/src/gui/Pages/AccountSettings/Encryption.qml @@ -44,7 +44,7 @@ HFlickableColumnPage { } HLabel { - wrapMode: Text.Wrap + wrapMode: HLabel.Wrap text: qsTr( "The decryption keys for messages received in encrypted rooms " + "until present time can be saved " + diff --git a/src/gui/Pages/AddAccount/Register.qml b/src/gui/Pages/AddAccount/Register.qml index ac8c993e..c51ccb83 100644 --- a/src/gui/Pages/AddAccount/Register.qml +++ b/src/gui/Pages/AddAccount/Register.qml @@ -21,7 +21,7 @@ HFlickableColumnPage { } HLabel { - wrapMode: Text.Wrap + wrapMode: HLabel.Wrap horizontalAlignment: Qt.AlignHCenter text: qsTr( "Not implemented yet\n\n" + diff --git a/src/gui/Pages/AddAccount/Reset.qml b/src/gui/Pages/AddAccount/Reset.qml index 42675c68..0a159e30 100644 --- a/src/gui/Pages/AddAccount/Reset.qml +++ b/src/gui/Pages/AddAccount/Reset.qml @@ -22,7 +22,7 @@ HFlickableColumnPage { } HLabel { - wrapMode: Text.Wrap + wrapMode: HLabel.Wrap horizontalAlignment: Qt.AlignHCenter text: qsTr( "Not implemented yet\n\n" + diff --git a/src/gui/Pages/AddAccount/SignIn.qml b/src/gui/Pages/AddAccount/SignIn.qml index 88cdce98..e3746e56 100644 --- a/src/gui/Pages/AddAccount/SignIn.qml +++ b/src/gui/Pages/AddAccount/SignIn.qml @@ -211,7 +211,7 @@ HFlickableColumnPage { HLabel { id: errorMessage - wrapMode: Text.Wrap + wrapMode: HLabel.Wrap horizontalAlignment: Text.AlignHCenter color: theme.colors.errorText diff --git a/src/gui/Pages/AddChat/CreateRoom.qml b/src/gui/Pages/AddChat/CreateRoom.qml index 15254699..a733f31c 100644 --- a/src/gui/Pages/AddChat/CreateRoom.qml +++ b/src/gui/Pages/AddChat/CreateRoom.qml @@ -140,7 +140,7 @@ HFlickableColumnPage { HLabel { id: errorMessage - wrapMode: Text.Wrap + wrapMode: HLabel.Wrap horizontalAlignment: Text.AlignHCenter color: theme.colors.errorText diff --git a/src/gui/Pages/AddChat/DirectChat.qml b/src/gui/Pages/AddChat/DirectChat.qml index 6bce4d20..6c426ca5 100644 --- a/src/gui/Pages/AddChat/DirectChat.qml +++ b/src/gui/Pages/AddChat/DirectChat.qml @@ -110,7 +110,7 @@ HFlickableColumnPage { HLabel { id: errorMessage - wrapMode: Text.Wrap + wrapMode: HLabel.Wrap horizontalAlignment: Text.AlignHCenter color: theme.colors.errorText diff --git a/src/gui/Pages/AddChat/JoinRoom.qml b/src/gui/Pages/AddChat/JoinRoom.qml index 08e563a5..6d048d56 100644 --- a/src/gui/Pages/AddChat/JoinRoom.qml +++ b/src/gui/Pages/AddChat/JoinRoom.qml @@ -93,7 +93,7 @@ HFlickableColumnPage { HLabel { id: errorMessage - wrapMode: Text.Wrap + wrapMode: HLabel.Wrap horizontalAlignment: Text.AlignHCenter color: theme.colors.errorText diff --git a/src/gui/Pages/Chat/Banners/Banner.qml b/src/gui/Pages/Chat/Banners/Banner.qml index bb51d0db..2aa2c7d7 100644 --- a/src/gui/Pages/Chat/Banners/Banner.qml +++ b/src/gui/Pages/Chat/Banners/Banner.qml @@ -55,7 +55,7 @@ Rectangle { HLabel { id: bannerLabel textFormat: Text.StyledText - wrapMode: Text.Wrap + wrapMode: HLabel.Wrap Layout.fillWidth: true Layout.leftMargin: bannerIcon.Layout.leftMargin diff --git a/src/gui/Pages/Chat/FileTransfer/Transfer.qml b/src/gui/Pages/Chat/FileTransfer/Transfer.qml index af6acd19..b41be0e3 100644 --- a/src/gui/Pages/Chat/FileTransfer/Transfer.qml +++ b/src/gui/Pages/Chat/FileTransfer/Transfer.qml @@ -59,7 +59,7 @@ HColumnLayout { model.filepath.replace(/^file:\/\//, "") elide: expand ? Text.ElideNone : Text.ElideRight - wrapMode: expand ? Text.Wrap : Text.NoWrap + wrapMode: expand ? HLabel.Wrap : Text.NoWrap text: cancelPending ? diff --git a/src/gui/Popups/DetailsLabel.qml b/src/gui/Popups/DetailsLabel.qml index 1bc54487..5789c906 100644 --- a/src/gui/Popups/DetailsLabel.qml +++ b/src/gui/Popups/DetailsLabel.qml @@ -5,7 +5,7 @@ import QtQuick.Layouts 1.12 import "../Base" HLabel { - wrapMode: Text.Wrap + wrapMode: HLabel.Wrap visible: Boolean(text) Layout.fillWidth: true diff --git a/src/gui/Popups/InviteToRoomPopup.qml b/src/gui/Popups/InviteToRoomPopup.qml index 56e9adbe..732b1b50 100644 --- a/src/gui/Popups/InviteToRoomPopup.qml +++ b/src/gui/Popups/InviteToRoomPopup.qml @@ -130,7 +130,7 @@ HColumnPopup { } visible: Layout.maximumHeight > 0 - wrapMode: Text.Wrap + wrapMode: HLabel.Wrap color: theme.colors.errorText text: invitingAllowed ? diff --git a/src/gui/Popups/PasswordPopup.qml b/src/gui/Popups/PasswordPopup.qml index 35e1e419..713b2d04 100644 --- a/src/gui/Popups/PasswordPopup.qml +++ b/src/gui/Popups/PasswordPopup.qml @@ -84,7 +84,7 @@ HFlickableColumnPopup { HTextField { id: passwordField - echoMode: TextInput.Password + echoMode: HTextField.Password focus: true error: passwordValid === false @@ -113,7 +113,7 @@ HFlickableColumnPopup { HLabel { id: errorMessage - wrapMode: Text.Wrap + wrapMode: HLabel.Wrap color: theme.colors.errorText visible: Layout.maximumHeight > 0 diff --git a/src/gui/Popups/SummaryLabel.qml b/src/gui/Popups/SummaryLabel.qml index 82d2c210..ea881ced 100644 --- a/src/gui/Popups/SummaryLabel.qml +++ b/src/gui/Popups/SummaryLabel.qml @@ -5,7 +5,7 @@ import QtQuick.Layouts 1.12 import "../Base" HLabel { - wrapMode: Text.Wrap + wrapMode: HLabel.Wrap font.bold: true visible: Boolean(text)