Fix whitespace

This commit is contained in:
Salt 2025-01-12 04:34:42 -06:00
parent 490b329d64
commit 05cc785b60

View File

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