TextField moved. Fixed sound on hovering check box

This commit is contained in:
vladest 2017-12-30 19:55:52 +01:00
parent f5f19ea67f
commit c953251cfe
3 changed files with 79 additions and 65 deletions

View file

@ -36,7 +36,7 @@ Original.CheckBox {
onHoveredChanged: {
if (hovered) {
tabletInterface.playSound(TabletEnums.ButtonHover);
Tablet.playSound(TabletEnums.ButtonHover);
}
}

View file

@ -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.7
import QtQuick.Controls 2.2
import "../styles-uit"
import "../controls-uit" as HifiControls
@ -27,8 +26,7 @@ TextField {
property bool hasRoundedBorder: false
property bool error: false;
property bool hasClearButton: false;
placeholderText: textField.placeholderText
property alias textColor: textField.color
FontLoader { id: firaSansSemiBold; source: "../../fonts/FiraSans-SemiBold.ttf"; }
font.family: firaSansSemiBold.name
@ -53,8 +51,22 @@ TextField {
}
}
style: TextFieldStyle {
textColor: {
Text {
id: placeholder
x: textField.leftPadding
y: textField.topPadding
width: textField.width - (textField.leftPadding + textField.rightPadding)
height: textField.height - (textField.topPadding + textField.bottomPadding)
text: textField.placeholderText
font: textField.font
color: textField.placeholderTextColor
verticalAlignment: textField.verticalAlignment
visible: !textField.length && !textField.preeditText && (!textField.activeFocus || textField.horizontalAlignment !== Qt.AlignHCenter)
elide: Text.ElideRight
}
color: {
if (isLightColorScheme) {
if (textField.activeFocus) {
hifi.colors.black
@ -75,6 +87,7 @@ TextField {
}
}
}
background: Rectangle {
color: {
if (isLightColorScheme) {
@ -129,12 +142,13 @@ TextField {
}
}
}
placeholderTextColor: isFaintGrayColorScheme ? hifi.colors.lightGrayText : hifi.colors.lightGray
property color placeholderTextColor: isFaintGrayColorScheme ? hifi.colors.lightGrayText : hifi.colors.lightGray
selectedTextColor: hifi.colors.black
selectionColor: hifi.colors.primaryHighlight
padding.left: (isSearchField ? textField.height - 2 : 0) + hifi.dimensions.textPadding
padding.right: (hasClearButton ? textField.height - 2 : 0) + hifi.dimensions.textPadding
}
leftPadding: (isSearchField ? textField.height - 2 : 0) + hifi.dimensions.textPadding
rightPadding: (hasClearButton ? textField.height - 2 : 0) + hifi.dimensions.textPadding
HifiControls.Label {
id: textFieldLabel

Binary file not shown.