Skip to content
Snippets Groups Projects
Commit 6ceba6a7 authored by Ming Rui Zhang's avatar Ming Rui Zhang
Browse files

profilepage: improvments on ui

1. Remove the "Select file" button during the camera picture-taking process
2. Add missing cancel (x) button during the first step of the camera picture-taking process
3. Disable all interactive components when the account creation is unfinished

Gitlab: #486
Change-Id: I91e279052aecdd9327f59e9a1377c344d9052323
parent 9d6fe53f
No related branches found
No related tags found
No related merge requests found
......@@ -56,7 +56,10 @@ Item {
}
function focusOnPreviousPhotoBoothItem () {
importButton.forceActiveFocus()
if (isPreviewing)
clearButton.forceActiveFocus()
else
importButton.forceActiveFocus()
}
onVisibleChanged: {
......@@ -231,28 +234,35 @@ Item {
Layout.alignment: Qt.AlignHCenter
visible: LRCInstance.currentAccountAvatarSet
visible: isPreviewing || LRCInstance.currentAccountAvatarSet
radius: JamiTheme.primaryRadius
source: JamiResources.round_close_24dp_svg
toolTipText: JamiStrings.clearAvatar
toolTipText: isPreviewing ? JamiStrings.stopTakingPhoto :
JamiStrings.clearAvatar
imageColor: JamiTheme.textColor
KeyNavigation.tab: importButton
KeyNavigation.up: takePhotoButton
KeyNavigation.down: KeyNavigation.tab
Keys.onPressed: function (keyEvent) {
if (keyEvent.matches(StandardKey.InsertParagraphSeparator)) {
clicked()
takePhotoButton.forceActiveFocus()
keyEvent.accepted = true
} else if (keyEvent.matches(StandardKey.MoveToNextLine) ||
keyEvent.key === Qt.Key_Tab) {
if (isPreviewing) {
root.focusOnNextItem()
} else
importButton.forceActiveFocus()
keyEvent.accepted = true
}
}
onClicked: {
stopBooth()
AccountAdapter.setCurrentAccountAvatarBase64()
if (!isPreviewing)
AccountAdapter.setCurrentAccountAvatarBase64()
}
}
......@@ -265,6 +275,8 @@ Item {
Layout.alignment: Qt.AlignHCenter
visible: !isPreviewing
radius: JamiTheme.primaryRadius
source: JamiResources.round_folder_24dp_svg
toolTipText: JamiStrings.importFromFile
......
......@@ -422,6 +422,7 @@ Item {
// PhotoBoothView
property string chooseAvatarImage: qsTr("Choose a picture as avatar")
property string importFromFile: qsTr("Import avatar from image file")
property string stopTakingPhoto: qsTr("Stop taking photo")
property string clearAvatar: qsTr("Clear avatar image")
property string takePhoto: qsTr("Take photo")
......
......@@ -103,6 +103,7 @@ Rectangle {
Layout.alignment: Qt.AlignCenter
enabled: !saveProfileBtn.spinnerTriggered
imageId: createdAccountId
avatarSize: 200
......@@ -134,6 +135,7 @@ Rectangle {
focus: visible
selectByMouse: true
enabled: !saveProfileBtn.spinnerTriggered
placeholderText: {
if (WizardViewStepModel.accountCreationOption !==
WizardViewStepModel.AccountCreationOption.CreateRendezVous)
......
......@@ -1514,6 +1514,56 @@ WizardView {
keyClick(Qt.Key_Enter)
compare(takePhotoButton.focus, true)
// Taking photo focus test
setAvatarWidget.isPreviewing = true
keyClick(Qt.Key_Tab)
compare(photoboothViewClearButton.focus, true)
keyClick(Qt.Key_Tab)
compare(aliasEdit.focus, true)
keyClick(Qt.Key_Tab)
compare(saveProfileBtn.focus, true)
keyClick(Qt.Key_Tab)
compare(skipProfileSavingButton.focus, true)
keyClick(Qt.Key_Tab)
compare(takePhotoButton.focus, true)
keyClick(Qt.Key_Down)
compare(photoboothViewClearButton.focus, true)
keyClick(Qt.Key_Down)
compare(aliasEdit.focus, true)
keyClick(Qt.Key_Down)
compare(saveProfileBtn.focus, true)
keyClick(Qt.Key_Down)
compare(skipProfileSavingButton.focus, true)
keyClick(Qt.Key_Down)
compare(takePhotoButton.focus, true)
keyClick(Qt.Key_Up)
compare(skipProfileSavingButton.focus, true)
keyClick(Qt.Key_Up)
compare(saveProfileBtn.focus, true)
keyClick(Qt.Key_Up)
compare(aliasEdit.focus, true)
keyClick(Qt.Key_Up)
compare(photoboothViewClearButton.focus, true)
keyClick(Qt.Key_Up)
compare(takePhotoButton.focus, true)
setAvatarWidget.isPreviewing = false
WizardViewStepModel.nextStep()
var showBackup = (WizardViewStepModel.accountCreationOption ===
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment