Fix whitespace
This commit is contained in:
parent
490b329d64
commit
05cc785b60
@ -25,138 +25,138 @@
|
|||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
|
|
||||||
FocusScope {
|
FocusScope {
|
||||||
id: container
|
id: container
|
||||||
width: 80; height: 30
|
width: 80; height: 30
|
||||||
|
|
||||||
property alias borderWidth: txtMain.borderWidth
|
property alias borderWidth: txtMain.borderWidth
|
||||||
property alias color: txtMain.color
|
property alias color: txtMain.color
|
||||||
property alias borderColor: txtMain.borderColor
|
property alias borderColor: txtMain.borderColor
|
||||||
property alias focusColor: txtMain.focusColor
|
property alias focusColor: txtMain.focusColor
|
||||||
property alias hoverColor: txtMain.hoverColor
|
property alias hoverColor: txtMain.hoverColor
|
||||||
property alias radius: txtMain.radius
|
property alias radius: txtMain.radius
|
||||||
property alias font: txtMain.font
|
property alias font: txtMain.font
|
||||||
property alias textColor: txtMain.textColor
|
property alias textColor: txtMain.textColor
|
||||||
property alias echoMode: txtMain.echoMode
|
property alias echoMode: txtMain.echoMode
|
||||||
property alias text: txtMain.text
|
property alias text: txtMain.text
|
||||||
|
|
||||||
property alias image: img.source
|
property alias image: img.source
|
||||||
property double imageFadeIn: 300
|
property double imageFadeIn: 300
|
||||||
property double imageFadeOut: 200
|
property double imageFadeOut: 200
|
||||||
|
|
||||||
property alias tooltipEnabled: tooltip.visible
|
property alias tooltipEnabled: tooltip.visible
|
||||||
property alias tooltipText: tooltipText.text
|
property alias tooltipText: tooltipText.text
|
||||||
property alias tooltipFG: tooltipText.color
|
property alias tooltipFG: tooltipText.color
|
||||||
property alias tooltipBG: tooltip.color
|
property alias tooltipBG: tooltip.color
|
||||||
|
|
||||||
SaltTextBox {
|
SaltTextBox {
|
||||||
id: txtMain
|
id: txtMain
|
||||||
width: parent.width; height: parent.height
|
width: parent.width; height: parent.height
|
||||||
font.pixelSize: 14
|
font.pixelSize: 14
|
||||||
|
|
||||||
echoMode: TextInput.Password
|
echoMode: TextInput.Password
|
||||||
|
|
||||||
focus: true
|
focus: true
|
||||||
}
|
}
|
||||||
|
|
||||||
Image {
|
Image {
|
||||||
id: img
|
id: img
|
||||||
opacity: 0
|
opacity: 0
|
||||||
state: keyboard.capsLock ? "activated" : ""
|
state: keyboard.capsLock ? "activated" : ""
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
fillMode: Image.PreserveAspectFit
|
fillMode: Image.PreserveAspectFit
|
||||||
|
|
||||||
smooth: true
|
smooth: true
|
||||||
height: parent.height * 0.8
|
height: parent.height * 0.8
|
||||||
|
|
||||||
source: "warning.png"
|
source: "warning.png"
|
||||||
sourceSize.width: width
|
sourceSize.width: width
|
||||||
sourceSize.height: height
|
sourceSize.height: height
|
||||||
|
|
||||||
anchors.rightMargin: 0.3 * width
|
anchors.rightMargin: 0.3 * width
|
||||||
|
|
||||||
states: [
|
states: [
|
||||||
State {
|
State {
|
||||||
name: "activated"
|
name: "activated"
|
||||||
PropertyChanges { target: img; opacity: 1; }
|
PropertyChanges { target: img; opacity: 1; }
|
||||||
},
|
},
|
||||||
State {
|
State {
|
||||||
name: ""
|
name: ""
|
||||||
PropertyChanges { target: img; opacity: 0; }
|
PropertyChanges { target: img; opacity: 0; }
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
transitions: [
|
transitions: [
|
||||||
Transition {
|
Transition {
|
||||||
to: "activated"
|
to: "activated"
|
||||||
NumberAnimation { target: img; property: "opacity"; from: 0; to: 1; duration: imageFadeIn; }
|
NumberAnimation { target: img; property: "opacity"; from: 0; to: 1; duration: imageFadeIn; }
|
||||||
},
|
},
|
||||||
|
|
||||||
Transition {
|
Transition {
|
||||||
to: ""
|
to: ""
|
||||||
NumberAnimation { target: img; property: "opacity"; from: 1; to: 0; duration: imageFadeOut; }
|
NumberAnimation { target: img; property: "opacity"; from: 1; to: 0; duration: imageFadeOut; }
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
id: hoverArea
|
id: hoverArea
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
cursorShape: Qt.ArrowCursor
|
cursorShape: Qt.ArrowCursor
|
||||||
|
|
||||||
onEntered: {
|
onEntered: {
|
||||||
tooltip.x = mouseX + img.x + 10
|
tooltip.x = mouseX + img.x + 10
|
||||||
tooltip.y = mouseY + 10
|
tooltip.y = mouseY + 10
|
||||||
}
|
}
|
||||||
|
|
||||||
onPositionChanged: {
|
onPositionChanged: {
|
||||||
tooltip.x = mouseX + img.x + 10
|
tooltip.x = mouseX + img.x + 10
|
||||||
tooltip.y = mouseY + 10
|
tooltip.y = mouseY + 10
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: tooltip
|
id: tooltip
|
||||||
color: "lightblue"
|
color: "lightblue"
|
||||||
border.color: "black"
|
border.color: "black"
|
||||||
border.width: 1
|
border.width: 1
|
||||||
|
|
||||||
width: 1.1 * tooltipText.implicitWidth
|
width: 1.1 * tooltipText.implicitWidth
|
||||||
height: 1.4 * tooltipText.implicitHeight
|
height: 1.4 * tooltipText.implicitHeight
|
||||||
radius: 2
|
radius: 2
|
||||||
opacity: 0
|
opacity: 0
|
||||||
|
|
||||||
state: hoverArea.containsMouse && img.state == "activated" ? "activated" : ""
|
state: hoverArea.containsMouse && img.state == "activated" ? "activated" : ""
|
||||||
|
|
||||||
states: [
|
states: [
|
||||||
State {
|
State {
|
||||||
name: "activated"
|
name: "activated"
|
||||||
PropertyChanges { target: tooltip; opacity: 1 }
|
PropertyChanges { target: tooltip; opacity: 1 }
|
||||||
},
|
},
|
||||||
State {
|
State {
|
||||||
name: ""
|
name: ""
|
||||||
PropertyChanges { target: tooltip; opacity: 0 }
|
PropertyChanges { target: tooltip; opacity: 0 }
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
transitions: [
|
transitions: [
|
||||||
Transition {
|
Transition {
|
||||||
to: "activated"
|
to: "activated"
|
||||||
NumberAnimation { target: tooltip; property: "opacity"; from: 0; to: 1; duration: imageFadeIn; }
|
NumberAnimation { target: tooltip; property: "opacity"; from: 0; to: 1; duration: imageFadeIn; }
|
||||||
},
|
},
|
||||||
|
|
||||||
Transition {
|
Transition {
|
||||||
to: ""
|
to: ""
|
||||||
NumberAnimation { target: tooltip; property: "opacity"; from: 1; to: 0; duration: imageFadeOut; }
|
NumberAnimation { target: tooltip; property: "opacity"; from: 1; to: 0; duration: imageFadeOut; }
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
id: tooltipText
|
id: tooltipText
|
||||||
anchors.centerIn: parent;
|
anchors.centerIn: parent;
|
||||||
text: textConstants.capslockWarning
|
text: textConstants.capslockWarning
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user