chore: cleanup, fix warning, remove dead code

This commit is contained in:
Lukáš Tinkl 2022-09-23 00:01:29 +02:00 committed by Lukáš Tinkl
parent 2681542a98
commit 54c73b0be7
9 changed files with 15 additions and 34 deletions

View File

@ -1,15 +1,12 @@
import QtQuick 2.13 import QtQuick 2.14
import QtQuick.Layouts 1.14
import StatusQ.Controls 0.1 import StatusQ.Controls 0.1
import StatusQ.Core 0.1 import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1 import StatusQ.Core.Theme 0.1
StatusBaseText { StatusBaseText {
id: timestampLabe;
property alias tooltip: tooltip property alias tooltip: tooltip
Layout.alignment: Qt.AlignVCenter
color: Theme.palette.baseColor1 color: Theme.palette.baseColor1
font.pixelSize: 10 font.pixelSize: 10
visible: !!text visible: !!text

View File

@ -96,27 +96,19 @@ Item {
StatusButton { StatusButton {
visible: (root.panelType === CommunityMembersTabPanel.TabType.BannedMembers) && isHovered && canBeBanned visible: (root.panelType === CommunityMembersTabPanel.TabType.BannedMembers) && isHovered && canBeBanned
text: qsTr("Unban") text: qsTr("Unban")
type: StatusBaseButton.Type.Normal
size: StatusBaseButton.Size.Large
onClicked: root.unbanUserClicked(model.pubKey) onClicked: root.unbanUserClicked(model.pubKey)
width: 95
height: 44
}, },
StatusButton { StatusButton {
visible: (root.panelType === CommunityMembersTabPanel.TabType.PendingRequests || visible: (root.panelType === CommunityMembersTabPanel.TabType.PendingRequests ||
root.panelType === CommunityMembersTabPanel.TabType.DeclinedRequests) && isHovered root.panelType === CommunityMembersTabPanel.TabType.DeclinedRequests) && isHovered
text: qsTr("Accept") text: qsTr("Accept")
type: StatusBaseButton.Type.Normal
size: StatusBaseButton.Size.Large
icon.name: "checkmark-circle" icon.name: "checkmark-circle"
icon.color: Theme.palette.successColor1 icon.color: Theme.palette.successColor1
normalColor: Theme.palette.successColor2 normalColor: Theme.palette.successColor2
hoverColor: Theme.palette.successColor3 hoverColor: Theme.palette.successColor3
textColor: Theme.palette.successColor1 textColor: Theme.palette.successColor1
onClicked: root.acceptRequestToJoin(model.requestToJoinId) onClicked: root.acceptRequestToJoin(model.requestToJoinId)
width: 124
height: 44
}, },
StatusButton { StatusButton {
@ -126,8 +118,6 @@ Item {
icon.name: "close-circle" icon.name: "close-circle"
icon.color: Style.current.danger icon.color: Style.current.danger
onClicked: root.declineRequestToJoin(model.requestToJoinId) onClicked: root.declineRequestToJoin(model.requestToJoinId)
width: 118
height: 44
} }
] ]

View File

@ -25,8 +25,6 @@ StatusModal {
property bool isEdit: false property bool isEdit: false
readonly property int maxCategoryNameLength: 24 readonly property int maxCategoryNameLength: 24
readonly property var categoryNameValidator: Utils.Validate.NoEmpty
| Utils.Validate.TextLength
onOpened: { onOpened: {
if(isEdit){ if(isEdit){
@ -138,7 +136,7 @@ StatusModal {
components: [ components: [
StatusCheckBox { StatusCheckBox {
id: channelItemCheckbox id: channelItemCheckbox
checked: root.isEdit ? model.categoryId == root.categoryId : false checked: root.isEdit ? model.categoryId === root.categoryId : false
onCheckedChanged: { onCheckedChanged: {
if(checked){ if(checked){
var idx = root.channels.indexOf(model.itemId) var idx = root.channels.indexOf(model.itemId)

View File

@ -155,7 +155,7 @@ StatusPopupMenu {
StatusMenuItem { StatusMenuItem {
objectName: "clearHistoryMenuItem" objectName: "clearHistoryMenuItem"
text: qsTr("Clear history") text: qsTr("Clear History")
icon.name: "close-circle" icon.name: "close-circle"
onTriggered: { onTriggered: {
root.clearChatHistory(root.chatId) root.clearChatHistory(root.chatId)
@ -225,12 +225,11 @@ StatusPopupMenu {
return qsTr("Leave group") return qsTr("Leave group")
} }
return root.chatType === Constants.chatType.oneToOne ? return root.chatType === Constants.chatType.oneToOne ?
qsTr("Delete chat") : qsTr("Delete Chat") :
qsTr("Leave chat") qsTr("Leave Chat")
} }
icon.name: root.chatType === Constants.chatType.oneToOne || root.isCommunityChat ? "delete" : "arrow-right" icon.name: root.chatType === Constants.chatType.oneToOne || root.isCommunityChat ? "delete" : "arrow-left"
icon.width: root.chatType === Constants.chatType.oneToOne || root.isCommunityChat ? 18 : 14 icon.width: root.chatType === Constants.chatType.oneToOne || root.isCommunityChat ? 18 : 14
iconRotation: root.chatType === Constants.chatType.oneToOne || root.isCommunityChat ? 0 : 180
type: StatusMenuItem.Type.Danger type: StatusMenuItem.Type.Danger
onTriggered: { onTriggered: {

View File

@ -51,19 +51,19 @@ Item {
Connections { Connections {
target: root.messageStore.messageModule target: root.messageStore.messageModule
onMessageSuccessfullySent: { function onMessageSuccessfullySent() {
chatLogView.scrollToBottom(true) chatLogView.scrollToBottom(true)
} }
onSendingMessageFailed: { function onSendingMessageFailed() {
sendingMsgFailedPopup.open(); sendingMsgFailedPopup.open()
} }
onScrollMessagesUp: { function onScrollMessagesUp() {
chatLogView.positionViewAtEnd() chatLogView.positionViewAtEnd()
} }
onScrollToMessage: { function onScrollToMessage(messageIndex) {
chatLogView.positionViewAtIndex(messageIndex, ListView.Center); chatLogView.positionViewAtIndex(messageIndex, ListView.Center);
chatLogView.itemAtIndex(messageIndex).startMessageFoundAnimation(); chatLogView.itemAtIndex(messageIndex).startMessageFoundAnimation();
} }

View File

@ -814,7 +814,7 @@ Item {
Connections { Connections {
target: mainModule target: mainModule
onActiveSectionChanged: { function onActiveSectionChanged() {
Global.closeCreateChatView() Global.closeCreateChatView()
} }
} }
@ -823,7 +823,7 @@ Item {
Connections { Connections {
target: rootStore.mainModuleInst target: rootStore.mainModuleInst
onMailserverNotWorking: { function onMailserverNotWorking() {
if (!appLayout.mailserverNotWorkingPopup) { if (!appLayout.mailserverNotWorkingPopup) {
appLayout.mailserverNotWorkingPopup = Global.openPopup(mailserverNotWorkingPopupComponent); appLayout.mailserverNotWorkingPopup = Global.openPopup(mailserverNotWorkingPopupComponent);
} }

View File

@ -1,7 +1,5 @@
import QtQuick 2.13 import QtQuick 2.13
import QtQuick.Controls 2.13 import QtQuick.Controls 2.13
import QtQuick.Layouts 1.13
import QtGraphicalEffects 1.13
import utils 1.0 import utils 1.0
import shared.controls 1.0 import shared.controls 1.0
@ -45,7 +43,6 @@ StatusModal {
StatusBaseText { StatusBaseText {
id: descriptionText id: descriptionText
text: qsTr("Nicknames help you identify others in Status. Only you can see the nicknames youve added") text: qsTr("Nicknames help you identify others in Status. Only you can see the nicknames youve added")
font.pixelSize: 15
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
color: Theme.palette.baseColor1 color: Theme.palette.baseColor1
width: parent.width width: parent.width

View File

@ -61,7 +61,7 @@ StatusPopupMenu {
readonly property bool isContact: { readonly property bool isContact: {
return root.selectedUserPublicKey !== "" && !!contactDetails.isContact return root.selectedUserPublicKey !== "" && !!contactDetails.isContact
} }
readonly property bool isBlockedContact: d.contactDetails && d.contactDetails.isBlocked readonly property bool isBlockedContact: !!d.contactDetails && d.contactDetails.isBlocked
readonly property int outgoingVerificationStatus: { readonly property int outgoingVerificationStatus: {
if (root.selectedUserPublicKey === "" || root.isMe || !root.isContact) { if (root.selectedUserPublicKey === "" || root.isMe || !root.isContact) {

View File

@ -278,7 +278,7 @@ Loader {
Connections { Connections {
enabled: d.isMessageActive enabled: d.isMessageActive
target: root.messageContextMenu target: root.messageContextMenu
onClosed: { function onClosed() {
d.setMessageActive(root.messageId, false) d.setMessageActive(root.messageId, false)
} }
} }