mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 11:17:34 +02:00
integrate onscreen keyboard
This commit is contained in:
parent
5381dce8d8
commit
c7570dbf83
3 changed files with 105 additions and 60 deletions
|
@ -10,6 +10,23 @@ Rectangle {
|
||||||
id: root
|
id: root
|
||||||
width: 480
|
width: 480
|
||||||
height: 706
|
height: 706
|
||||||
|
|
||||||
|
property bool keyboardEnabled: true
|
||||||
|
property bool keyboardRaised: false
|
||||||
|
property bool punctuationMode: false
|
||||||
|
|
||||||
|
HifiControls.Keyboard {
|
||||||
|
id: keyboard
|
||||||
|
z: 100
|
||||||
|
raised: parent.keyboardEnabled && parent.keyboardRaised
|
||||||
|
numeric: parent.punctuationMode
|
||||||
|
anchors {
|
||||||
|
left: parent.left
|
||||||
|
right: parent.right
|
||||||
|
bottom: parent.bottom
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
color: style.colors.white
|
color: style.colors.white
|
||||||
property string getAvatarsMethod: 'getAvatars'
|
property string getAvatarsMethod: 'getAvatars'
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,10 @@ Rectangle {
|
||||||
color: Qt.rgba(0, 0, 0, 0.5);
|
color: Qt.rgba(0, 0, 0, 0.5);
|
||||||
z: 999;
|
z: 999;
|
||||||
|
|
||||||
|
property bool keyboardEnabled: true
|
||||||
|
property bool keyboardRaised: false
|
||||||
|
property bool punctuationMode: false
|
||||||
|
|
||||||
property string titleText: 'Create Favorite'
|
property string titleText: 'Create Favorite'
|
||||||
property string favoriteNameText: favoriteName.text
|
property string favoriteNameText: favoriteName.text
|
||||||
property string avatarImageUrl: null
|
property string avatarImageUrl: null
|
||||||
|
@ -85,83 +89,90 @@ Rectangle {
|
||||||
height: childrenRect.height
|
height: childrenRect.height
|
||||||
|
|
||||||
anchors.top: title.bottom
|
anchors.top: title.bottom
|
||||||
anchors.topMargin: 10
|
anchors.topMargin: 20
|
||||||
anchors.left: parent.left;
|
anchors.left: parent.left;
|
||||||
anchors.leftMargin: 30;
|
anchors.leftMargin: 30;
|
||||||
anchors.right: parent.right;
|
anchors.right: parent.right;
|
||||||
anchors.rightMargin: 30;
|
anchors.rightMargin: 30;
|
||||||
|
|
||||||
Item {
|
AvatarThumbnail {
|
||||||
id: bodyRow
|
id: avatarThumbnail
|
||||||
height: childrenRect.height
|
avatarUrl: avatarImageUrl
|
||||||
|
onAvatarUrlChanged: {
|
||||||
anchors.left: parent.left
|
console.debug('CreateFavoritesDialog: onAvatarUrlChanged: ', avatarUrl);
|
||||||
anchors.right: parent.right
|
|
||||||
|
|
||||||
AvatarThumbnail {
|
|
||||||
avatarUrl: avatarImageUrl
|
|
||||||
onAvatarUrlChanged: {
|
|
||||||
console.debug('CreateFavoritesDialog: onAvatarUrlChanged: ', avatarUrl);
|
|
||||||
}
|
|
||||||
|
|
||||||
wearablesCount: avatarWearablesCount
|
|
||||||
}
|
}
|
||||||
|
|
||||||
InputTextStyle4 {
|
wearablesCount: avatarWearablesCount
|
||||||
id: favoriteName
|
}
|
||||||
anchors.right: parent.right
|
|
||||||
width: 184
|
|
||||||
height: 40
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
placeholderText: "Enter Favorite Name"
|
|
||||||
|
|
||||||
RalewayRegular {
|
InputTextStyle4 {
|
||||||
id: wrongName
|
id: favoriteName
|
||||||
anchors.top: parent.bottom;
|
anchors.right: parent.right
|
||||||
anchors.topMargin: 2
|
height: 40
|
||||||
|
anchors.left: avatarThumbnail.right
|
||||||
|
anchors.leftMargin: 44
|
||||||
|
anchors.verticalCenter: avatarThumbnail.verticalCenter
|
||||||
|
placeholderText: "Enter Favorite Name"
|
||||||
|
|
||||||
anchors.right: parent.right;
|
RalewayRegular {
|
||||||
text: 'Favorite name exists'
|
id: wrongName
|
||||||
size: 15
|
anchors.top: parent.bottom;
|
||||||
color: 'red'
|
anchors.topMargin: 2
|
||||||
visible: {
|
|
||||||
for(var i = 0; i < avatars.count; ++i) {
|
anchors.right: parent.right;
|
||||||
var avatarName = avatars.get(i).name;
|
text: 'Favorite name exists'
|
||||||
if(avatarName === favoriteName.text) {
|
size: 15
|
||||||
return true;
|
color: 'red'
|
||||||
}
|
visible: {
|
||||||
|
for(var i = 0; i < avatars.count; ++i) {
|
||||||
|
var avatarName = avatars.get(i).name;
|
||||||
|
if(avatarName === favoriteName.text) {
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DialogButtons {
|
HifiControlsUit.Keyboard {
|
||||||
anchors.top: bodyRow.bottom
|
id: keyboard
|
||||||
anchors.topMargin: 20
|
raised: root.keyboardEnabled && root.keyboardRaised
|
||||||
anchors.left: parent.left
|
numeric: root.punctuationMode
|
||||||
anchors.right: parent.right
|
anchors {
|
||||||
|
top: avatarThumbnail.bottom
|
||||||
yesButton.enabled: favoriteNameText !== ''
|
topMargin: 20
|
||||||
yesText: root.button2text
|
left: parent.left
|
||||||
noText: root.button1text
|
right: parent.right
|
||||||
|
|
||||||
onYesClicked: function() {
|
|
||||||
if(onSaveClicked) {
|
|
||||||
onSaveClicked();
|
|
||||||
} else {
|
|
||||||
root.close();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onNoClicked: function() {
|
DialogButtons {
|
||||||
if(onCancelClicked) {
|
anchors.top: contentContainer.bottom
|
||||||
onCancelClicked();
|
anchors.topMargin: 20
|
||||||
} else {
|
anchors.left: parent.left
|
||||||
root.close();
|
anchors.right: parent.right
|
||||||
}
|
anchors.rightMargin: 30
|
||||||
|
|
||||||
|
yesButton.enabled: favoriteNameText !== ''
|
||||||
|
yesText: root.button2text
|
||||||
|
noText: root.button1text
|
||||||
|
|
||||||
|
onYesClicked: function() {
|
||||||
|
if(onSaveClicked) {
|
||||||
|
onSaveClicked();
|
||||||
|
} else {
|
||||||
|
root.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onNoClicked: function() {
|
||||||
|
if(onCancelClicked) {
|
||||||
|
onCancelClicked();
|
||||||
|
} else {
|
||||||
|
root.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,10 @@ Rectangle {
|
||||||
color: Qt.rgba(0, 0, 0, 0.5);
|
color: Qt.rgba(0, 0, 0, 0.5);
|
||||||
z: 999;
|
z: 999;
|
||||||
|
|
||||||
|
property bool keyboardEnabled: true
|
||||||
|
property bool keyboardRaised: false
|
||||||
|
property bool punctuationMode: false
|
||||||
|
|
||||||
property string titleText: ''
|
property string titleText: ''
|
||||||
property string bodyText: ''
|
property string bodyText: ''
|
||||||
property alias inputText: input;
|
property alias inputText: input;
|
||||||
|
@ -147,6 +151,19 @@ Rectangle {
|
||||||
anchors.left: parent.left;
|
anchors.left: parent.left;
|
||||||
anchors.right: parent.right;
|
anchors.right: parent.right;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HifiControlsUit.Keyboard {
|
||||||
|
id: keyboard
|
||||||
|
z: 100
|
||||||
|
raised: root.keyboardEnabled && root.keyboardRaised
|
||||||
|
numeric: root.punctuationMode
|
||||||
|
anchors {
|
||||||
|
top: input.bottom
|
||||||
|
topMargin: 20
|
||||||
|
left: parent.left
|
||||||
|
right: parent.right
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DialogButtons {
|
DialogButtons {
|
||||||
|
|
Loading…
Reference in a new issue