mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-10 05:00:20 +02:00
Focus fix; Switch to QQC2
This commit is contained in:
parent
50e709c738
commit
5563edd957
2 changed files with 138 additions and 133 deletions
|
@ -8,9 +8,8 @@
|
|||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
|
||||
import QtQuick 2.5
|
||||
import QtQuick.Controls 1.4
|
||||
import QtQuick.Controls.Styles 1.4
|
||||
import QtQuick 2.9
|
||||
import QtQuick.Controls 2.2
|
||||
import QtGraphicalEffects 1.0
|
||||
|
||||
import "../styles-uit"
|
||||
|
@ -28,7 +27,6 @@ Item {
|
|||
property alias dropdownHeight: dropdownContainer.height;
|
||||
property alias text: textField.text;
|
||||
property alias primaryFilterChoices: filterBarModel;
|
||||
property alias textFieldFocused: textField.activeFocus;
|
||||
property int primaryFilter_index: -1;
|
||||
property string primaryFilter_filterName: "";
|
||||
property string primaryFilter_displayName: "";
|
||||
|
@ -94,9 +92,7 @@ Item {
|
|||
}
|
||||
}
|
||||
|
||||
style: TextFieldStyle {
|
||||
id: style;
|
||||
textColor: {
|
||||
color: {
|
||||
if (isLightColorScheme) {
|
||||
if (textField.activeFocus) {
|
||||
hifi.colors.black
|
||||
|
@ -117,6 +113,7 @@ Item {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
id: mainFilterBarRectangle;
|
||||
|
||||
|
@ -187,13 +184,14 @@ Item {
|
|||
Rectangle {
|
||||
z: 999;
|
||||
id: primaryFilterContainer;
|
||||
color: hifi.colors.lightGray;
|
||||
color: textField.activeFocus ? hifi.colors.blueHighlight : hifi.colors.lightGray;
|
||||
width: primaryFilterTextMetrics.tightBoundingRect.width + 14;
|
||||
height: parent.height - 8;
|
||||
anchors.verticalCenter: parent.verticalCenter;
|
||||
anchors.left: searchButtonContainer.right;
|
||||
anchors.leftMargin: 4;
|
||||
visible: primaryFilterText.text !== "";
|
||||
radius: 4;
|
||||
|
||||
FiraSansRegular {
|
||||
id: primaryFilterText;
|
||||
|
@ -204,6 +202,13 @@ Item {
|
|||
verticalAlignment: Text.AlignVCenter;
|
||||
size: hifi.fontSizes.textFieldInput;
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent;
|
||||
onClicked: {
|
||||
textField.forceActiveFocus();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// "Clear" button
|
||||
|
@ -228,12 +233,11 @@ Item {
|
|||
}
|
||||
}
|
||||
|
||||
placeholderTextColor: isFaintGrayColorScheme ? hifi.colors.lightGrayText : hifi.colors.lightGray
|
||||
//placeholderTextColor: isFaintGrayColorScheme ? hifi.colors.lightGrayText : hifi.colors.lightGray
|
||||
selectedTextColor: hifi.colors.black
|
||||
selectionColor: hifi.colors.primaryHighlight
|
||||
padding.left: 44 + (root.primaryFilter_index === -1 ? 0 : primaryFilterTextMetrics.tightBoundingRect.width + 24);
|
||||
padding.right: 44
|
||||
}
|
||||
leftPadding: 44 + (root.primaryFilter_index === -1 ? 0 : primaryFilterTextMetrics.tightBoundingRect.width + 24);
|
||||
rightPadding: 44;
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
|
|
|
@ -37,6 +37,7 @@ Rectangle {
|
|||
property bool isDebuggingFirstUseTutorial: false;
|
||||
property int pendingItemCount: 0;
|
||||
property string installedApps;
|
||||
property bool keyboardRaised: false;
|
||||
// Style
|
||||
color: hifi.colors.white;
|
||||
Connections {
|
||||
|
@ -610,7 +611,7 @@ Rectangle {
|
|||
|
||||
HifiControlsUit.Keyboard {
|
||||
id: keyboard;
|
||||
raised: HMD.mounted && filterBar.textFieldFocused;
|
||||
raised: HMD.mounted && parent.keyboardRaised;
|
||||
numeric: parent.punctuationMode;
|
||||
anchors {
|
||||
bottom: parent.bottom;
|
||||
|
|
Loading…
Reference in a new issue