mirror of
https://github.com/overte-org/overte.git
synced 2025-04-26 06:36:08 +02:00
Style snapshots section
This commit is contained in:
parent
d255ad3805
commit
a25702535b
3 changed files with 27 additions and 24 deletions
|
@ -19,12 +19,16 @@ TextField {
|
||||||
|
|
||||||
property int colorScheme: hifi.colorSchemes.light
|
property int colorScheme: hifi.colorSchemes.light
|
||||||
property string label: ""
|
property string label: ""
|
||||||
|
property real controlHeight: height + (textFieldLabel.visible ? textFieldLabel.height : 0)
|
||||||
|
|
||||||
|
placeholderText: textField.placeholderText
|
||||||
|
|
||||||
FontLoader { id: firaSansSemiBold; source: "../../fonts/FiraSans-SemiBold.ttf"; }
|
FontLoader { id: firaSansSemiBold; source: "../../fonts/FiraSans-SemiBold.ttf"; }
|
||||||
font.family: firaSansSemiBold.name
|
font.family: firaSansSemiBold.name
|
||||||
font.pixelSize: hifi.fontSizes.textFieldInput
|
font.pixelSize: hifi.fontSizes.textFieldInput
|
||||||
height: implicitHeight + 4 // Make surrounding box higher so that highlight is vertically centered.
|
height: implicitHeight + 4 // Make surrounding box higher so that highlight is vertically centered.
|
||||||
placeholderText: textField.label // Instead of separate label (see below).
|
|
||||||
|
y: textFieldLabel.visible ? textFieldLabel.height : 0
|
||||||
|
|
||||||
style: TextFieldStyle {
|
style: TextFieldStyle {
|
||||||
textColor: textField.colorScheme == hifi.colorSchemes.light
|
textColor: textField.colorScheme == hifi.colorSchemes.light
|
||||||
|
@ -44,9 +48,8 @@ TextField {
|
||||||
padding.right: hifi.dimensions.textPadding
|
padding.right: hifi.dimensions.textPadding
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
// Separate label instead of placeholderText.
|
|
||||||
RalewaySemibold {
|
RalewaySemibold {
|
||||||
|
id: textFieldLabel
|
||||||
text: textField.label
|
text: textField.label
|
||||||
size: hifi.fontSizes.inputLabel
|
size: hifi.fontSizes.inputLabel
|
||||||
color: hifi.colors.lightGrayText
|
color: hifi.colors.lightGrayText
|
||||||
|
@ -55,5 +58,4 @@ TextField {
|
||||||
anchors.bottomMargin: 4
|
anchors.bottomMargin: 4
|
||||||
visible: label != ""
|
visible: label != ""
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,16 +1,24 @@
|
||||||
|
//
|
||||||
|
// BrowsablePreference.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 2.5
|
||||||
import QtQuick.Controls 1.4
|
|
||||||
import QtQuick.Controls.Styles 1.4
|
|
||||||
|
|
||||||
import "../../dialogs"
|
import "../../dialogs"
|
||||||
|
import "../../controls-uit"
|
||||||
|
|
||||||
Preference {
|
Preference {
|
||||||
id: root
|
id: root
|
||||||
property alias buttonText: button.text
|
|
||||||
property alias text: dataTextField.text
|
property alias text: dataTextField.text
|
||||||
property alias placeholderText: dataTextField.placeholderText
|
property alias placeholderText: dataTextField.placeholderText
|
||||||
property real spacing: 8
|
property real spacing: 0
|
||||||
height: labelText.height + Math.max(dataTextField.height, button.height) + spacing
|
height: Math.max(dataTextField.controlHeight, button.height) + spacing
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
dataTextField.text = preference.value;
|
dataTextField.text = preference.value;
|
||||||
|
@ -21,24 +29,19 @@ Preference {
|
||||||
preference.save();
|
preference.save();
|
||||||
}
|
}
|
||||||
|
|
||||||
Text {
|
|
||||||
id: labelText
|
|
||||||
color: enabled ? "black" : "gray"
|
|
||||||
text: root.label
|
|
||||||
}
|
|
||||||
|
|
||||||
TextField {
|
TextField {
|
||||||
id: dataTextField
|
id: dataTextField
|
||||||
placeholderText: root.placeholderText
|
|
||||||
text: preference.value
|
|
||||||
style: TextFieldStyle { renderType: Text.QtRendering }
|
|
||||||
anchors {
|
anchors {
|
||||||
top: labelText.bottom
|
|
||||||
left: parent.left
|
left: parent.left
|
||||||
right: button.left
|
right: button.left
|
||||||
topMargin: root.spacing
|
rightMargin: hifi.dimensions.contentSpacing.x
|
||||||
rightMargin: root.spacing
|
bottomMargin: spacing
|
||||||
}
|
}
|
||||||
|
|
||||||
|
label: root.label
|
||||||
|
placeholderText: root.placeholderText
|
||||||
|
colorScheme: hifi.colorSchemes.dark
|
||||||
}
|
}
|
||||||
|
|
||||||
Component {
|
Component {
|
||||||
|
@ -57,6 +60,5 @@ Preference {
|
||||||
dataTextField.text = fileDialogHelper.urlToPath(fileUrl);
|
dataTextField.text = fileDialogHelper.urlToPath(fileUrl);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -167,8 +167,7 @@ Window {
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
focus: true
|
focus: true
|
||||||
colorScheme: hifi.colorSchemes.dark
|
colorScheme: hifi.colorSchemes.dark
|
||||||
//placeholderText: "filter"
|
placeholderText: "filter"
|
||||||
label: "Filter"
|
|
||||||
onTextChanged: scriptsModel.filterRegExp = new RegExp("^.*" + text + ".*$", "i")
|
onTextChanged: scriptsModel.filterRegExp = new RegExp("^.*" + text + ".*$", "i")
|
||||||
Component.onCompleted: scriptsModel.filterRegExp = new RegExp("^.*$", "i")
|
Component.onCompleted: scriptsModel.filterRegExp = new RegExp("^.*$", "i")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue