mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 00:58:58 +08:00
Add Cura.TextField
CURA-6435
This commit is contained in:
parent
8e9a934035
commit
76947df6c1
47
resources/qml/Widgets/TextField.qml
Normal file
47
resources/qml/Widgets/TextField.qml
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
// Copyright (c) 2019 Ultimaker B.V.
|
||||||
|
// Cura is released under the terms of the LGPLv3 or higher.
|
||||||
|
|
||||||
|
import QtQuick 2.10
|
||||||
|
import QtQuick.Controls 2.3
|
||||||
|
|
||||||
|
import UM 1.3 as UM
|
||||||
|
import Cura 1.1 as Cura
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// Cura-style TextField
|
||||||
|
//
|
||||||
|
TextField
|
||||||
|
{
|
||||||
|
id: textField
|
||||||
|
|
||||||
|
UM.I18nCatalog { id: catalog; name: "cura" }
|
||||||
|
|
||||||
|
property int controlWidth: UM.Theme.getSize("setting_control").width
|
||||||
|
property int controlHeight: UM.Theme.getSize("setting_control").height
|
||||||
|
|
||||||
|
hoverEnabled: true
|
||||||
|
selectByMouse: true
|
||||||
|
font: UM.Theme.getFont("default")
|
||||||
|
renderType: Text.NativeRendering
|
||||||
|
|
||||||
|
background: Rectangle
|
||||||
|
{
|
||||||
|
anchors.fill: parent
|
||||||
|
anchors.margins: Math.round(UM.Theme.getSize("default_lining").width)
|
||||||
|
radius: UM.Theme.getSize("setting_control_radius").width
|
||||||
|
|
||||||
|
border.color:
|
||||||
|
{
|
||||||
|
if (!textField.enabled)
|
||||||
|
{
|
||||||
|
return UM.Theme.getColor("setting_control_disabled_border")
|
||||||
|
}
|
||||||
|
if (textField.hovered || textField.activeFocus)
|
||||||
|
{
|
||||||
|
return UM.Theme.getColor("setting_control_border_highlight")
|
||||||
|
}
|
||||||
|
return UM.Theme.getColor("setting_control_border")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -32,6 +32,7 @@ ComboBox 1.0 ComboBox.qml
|
|||||||
NotificationIcon 1.0 NotificationIcon.qml
|
NotificationIcon 1.0 NotificationIcon.qml
|
||||||
RadioButton 1.0 RadioButton.qml
|
RadioButton 1.0 RadioButton.qml
|
||||||
TabButton 1.0 TabButton.qml
|
TabButton 1.0 TabButton.qml
|
||||||
|
TextField 1.0 TextField.qml
|
||||||
|
|
||||||
|
|
||||||
# Cura/MachineSettings
|
# Cura/MachineSettings
|
||||||
|
Loading…
x
Reference in New Issue
Block a user