mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 06:44:06 +02:00
Style basic text field
This commit is contained in:
parent
98eb94ecef
commit
1a331fcdac
1 changed files with 18 additions and 13 deletions
|
@ -1,11 +1,22 @@
|
|||
//
|
||||
// EditablePreference.qml
|
||||
//
|
||||
// Created by Bradley Austin Davis on 18 Jan 2016
|
||||
// Copyright 2016 High Fidelity, Inc.
|
||||
//
|
||||
// Distributed under the Apache License, Version 2.0.
|
||||
// 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 "../../dialogs"
|
||||
import "../../controls-uit"
|
||||
|
||||
Preference {
|
||||
id: root
|
||||
property real spacing: 8
|
||||
height: labelText.height + dataTextField.height + spacing
|
||||
height: dataTextField.controlHeight + spacing
|
||||
|
||||
Component.onCompleted: {
|
||||
dataTextField.text = preference.value;
|
||||
|
@ -16,22 +27,16 @@ Preference {
|
|||
preference.save();
|
||||
}
|
||||
|
||||
Text {
|
||||
id: labelText
|
||||
color: enabled ? "black" : "gray"
|
||||
text: root.label
|
||||
}
|
||||
|
||||
TextField {
|
||||
id: dataTextField
|
||||
placeholderText: preference.placeholderText
|
||||
style: TextFieldStyle { renderType: Text.QtRendering }
|
||||
label: root.label
|
||||
colorScheme: hifi.colorSchemes.dark
|
||||
|
||||
anchors {
|
||||
top: labelText.bottom
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
topMargin: root.spacing
|
||||
rightMargin: root.spacing
|
||||
bottomMargin: spacing
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue