mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 22:35:14 +02:00
Merge pull request #16222 from zfox23/simplifiedGoToIteration
BUGZ-1529: Iteration on JumpTo Field visuals/interaction states
This commit is contained in:
commit
a472e723e2
2 changed files with 20 additions and 4 deletions
|
@ -24,6 +24,8 @@ TextField {
|
||||||
property string rightGlyph: ""
|
property string rightGlyph: ""
|
||||||
property alias bottomBorderVisible: bottomRectangle.visible
|
property alias bottomBorderVisible: bottomRectangle.visible
|
||||||
property alias backgroundColor: textFieldBackground.color
|
property alias backgroundColor: textFieldBackground.color
|
||||||
|
property string unfocusedPlaceholderText
|
||||||
|
property bool blankPlaceholderTextOnFocus: true
|
||||||
|
|
||||||
color: simplifiedUI.colors.text.white
|
color: simplifiedUI.colors.text.white
|
||||||
font.family: "Graphik Medium"
|
font.family: "Graphik Medium"
|
||||||
|
@ -47,6 +49,19 @@ TextField {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onFocusChanged: {
|
||||||
|
if (!root.blankPlaceholderTextOnFocus) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (focus) {
|
||||||
|
root.unfocusedPlaceholderText = root.placeholderText;
|
||||||
|
root.placeholderText = "";
|
||||||
|
} else {
|
||||||
|
root.placeholderText = root.unfocusedPlaceholderText;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
id: textFieldBackground
|
id: textFieldBackground
|
||||||
color: Qt.rgba(0, 0, 0, 0);
|
color: Qt.rgba(0, 0, 0, 0);
|
||||||
|
|
|
@ -372,12 +372,13 @@ Rectangle {
|
||||||
readonly property string shortPlaceholderText: "Jump to..."
|
readonly property string shortPlaceholderText: "Jump to..."
|
||||||
readonly property string longPlaceholderText: "Type the name of a location to quickly jump there..."
|
readonly property string longPlaceholderText: "Type the name of a location to quickly jump there..."
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
width: Math.min(parent.width, 600)
|
width: Math.min(parent.width, 445)
|
||||||
height: parent.height - 11
|
height: 35
|
||||||
leftPadding: 8
|
leftPadding: 8
|
||||||
rightPadding: 8
|
rightPadding: 8
|
||||||
bottomBorderVisible: false
|
bottomBorderVisible: false
|
||||||
backgroundColor: "#313131"
|
backgroundColor: "#1D1D1D"
|
||||||
|
font.pixelSize: 14
|
||||||
placeholderText: width - leftPadding - rightPadding < goToTextFieldMetrics.width ? shortPlaceholderText : longPlaceholderText
|
placeholderText: width - leftPadding - rightPadding < goToTextFieldMetrics.width ? shortPlaceholderText : longPlaceholderText
|
||||||
clip: true
|
clip: true
|
||||||
selectByMouse: true
|
selectByMouse: true
|
||||||
|
@ -386,8 +387,8 @@ Rectangle {
|
||||||
if (goToTextField.length > 0) {
|
if (goToTextField.length > 0) {
|
||||||
AddressManager.handleLookupString(goToTextField.text);
|
AddressManager.handleLookupString(goToTextField.text);
|
||||||
goToTextField.text = "";
|
goToTextField.text = "";
|
||||||
parent.forceActiveFocus();
|
|
||||||
}
|
}
|
||||||
|
parent.forceActiveFocus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue