chore: fix qml warnings in a couple of components

This commit is contained in:
Jonathan Rainville 2020-09-23 14:01:33 -04:00 committed by Iuri Matias
parent c36f1f82cd
commit eb7b9c2383
7 changed files with 41 additions and 66 deletions

View File

@ -5,72 +5,42 @@ import "../../../../imports"
import "../../../../shared"
import "./"
Popup {
ModalPopup {
function doRename(){
chatsModel.renameGroup(groupName.text)
popup.close();
}
id: popup
modal: true
height: 210
Overlay.modal: Rectangle {
color: "#60000000"
}
//% "Group name"
title: qsTrId("group-name")
onOpened: {
groupName.forceActiveFocus(Qt.MouseFocusReason)
groupName.text = chatsModel.activeChannel.name
}
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
parent: Overlay.overlay
x: Math.round((parent.width - width) / 2)
y: Math.round((parent.height - height) / 2)
width: 480
height: 159
background: Rectangle {
color: Style.current.white
radius: 8
Input {
id: groupName
anchors.left: parent.left
anchors.leftMargin: Style.current.padding
anchors.right: parent.right
anchors.rightMargin: Style.current.padding
//% "Group name"
placeholderText: qsTrId("group-name")
Keys.onEnterPressed: doRename()
Keys.onReturnPressed: doRename()
}
padding: 0
contentItem: Item {
StyledText {
id: groupTitleLabel
//% "Group name"
text: qsTrId("group-name")
anchors.top: parent.top
anchors.left: parent.left
font.pixelSize: 13
anchors.leftMargin: 16
anchors.topMargin: Style.current.padding
anchors.bottomMargin: Style.current.padding
}
Input {
id: groupName
anchors.top: groupTitleLabel.bottom
anchors.topMargin: 7
anchors.left: parent.left
anchors.leftMargin: Style.current.padding
anchors.right: parent.right
anchors.rightMargin: Style.current.padding
//% "Group name"
placeholderText: qsTrId("group-name")
Keys.onEnterPressed: doRename()
Keys.onReturnPressed: doRename()
}
StyledButton {
id: saveBtn
anchors.top: groupName.bottom
anchors.topMargin: 22
anchors.right: parent.right
anchors.rightMargin: Style.current.padding
//% "Save"
label: qsTrId("save")
onClicked : doRename()
}
}
footer: StyledButton {
id: saveBtn
height: 44
anchors.bottom: parent.bottom
anchors.right: parent.right
//% "Save"
label: qsTrId("save")
onClicked : doRename()
}
}

View File

@ -13,7 +13,7 @@ ModalPopup {
Loader {
active: popup.opened
width: parent.width
height: item.height
height: item ? item.height : 0
sourceComponent: Component {
id: seedComponent

View File

@ -168,8 +168,6 @@ Item {
StyledText {
anchors.top: addContactSearchInput.bottom
anchors.topMargin: Style.current.padding
anchors.horizontalCenter: parent.horizontalCenter
font.pixelSize: 12
color: Style.current.darkGrey
@ -181,8 +179,6 @@ Item {
StyledText {
id: contactUsername
text: profileModel.contactToAddUsername + " • "
anchors.top: addContactSearchInput.bottom
anchors.topMargin: Style.current.padding
font.pixelSize: 12
color: Style.current.darkGrey
visible: !!profileModel.contactToAddPubKey

View File

@ -7,10 +7,8 @@ import "../../../../shared/status"
Item {
id: soundsContainer
anchors.right: parent.right
anchors.rightMargin: contentMargin
anchors.left: parent.left
anchors.leftMargin: contentMargin
Layout.fillHeight: true
Layout.fillWidth: true
StyledText {
id: element5
@ -28,7 +26,9 @@ Item {
id: labelVolume
anchors.top: element5.bottom
anchors.topMargin: Style.current.bigPadding
text: qsTrId("Sound volume") + " " + volume.value
anchors.left: parent.left
anchors.leftMargin: 24
text: qsTr("Sound volume") + " " + volume.value
font.pixelSize: 15
}
@ -36,6 +36,8 @@ Item {
id: volume
anchors.top: labelVolume.bottom
anchors.topMargin: Style.current.padding
anchors.left: parent.left
anchors.leftMargin: 24
minimumValue: 0.0
maximumValue: 1.0
value: appSettings.volume
@ -46,3 +48,9 @@ Item {
}
}
/*##^##
Designer {
D{i:0;autoSize:true;height:480;width:640}
}
##^##*/

View File

@ -350,6 +350,7 @@ DISTFILES += \
shared/AssetAndAmountInput.qml \
shared/CopyToClipBoardButton.qml \
shared/GasSelector.qml \
shared/GasValidator.qml \
shared/RoundedImage.qml \
shared/SearchBox.qml \
shared/Select.qml \

View File

@ -42,7 +42,7 @@ Item {
gasTotal += selectedAmount
}
const currAcctGasAsset = Utils.findAssetBySymbol(selectedAccount.assets, "ETH")
if (currAcctGasAsset.value < gasTotal) {
if (currAcctGasAsset && currAcctGasAsset.value < gasTotal) {
isValid = false
txtValidationError.text = notEnoughEthForGasMessage
}

View File

@ -19,8 +19,8 @@ Popup {
}
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
parent: Overlay.overlay
x: Math.round((parent.width - width) / 2)
y: Math.round((parent.height - height) / 2)
x: Math.round(((parent ? parent.width : 0) - width) / 2)
y: Math.round(((parent ? parent.height : 0) - height) / 2)
width: 480
height: 510 // TODO find a way to make this dynamic
background: Rectangle {