C++ / fmt (pull_request) Failing after 5s
C++ / build (pull_request) Failing after 9s
C++ / clang-tidy (pull_request) Failing after 11s
JS/TS / fmt (pull_request) Successful in 10s
JS/TS / lint (pull_request) Successful in 8s
Python / static (pull_request) Successful in 28s
Rust / build (pull_request) Successful in 50s
Python / verify (pull_request) Successful in 1m38s
Rust / fmt (pull_request) Successful in 27s
Rust / clippy (pull_request) Successful in 53s
143 lines
2.5 KiB
QML
143 lines
2.5 KiB
QML
import QtQuick
|
|
import ZShell.Config
|
|
import qs.Components
|
|
import qs.Services
|
|
|
|
TextAreaBase {
|
|
id: root
|
|
|
|
readonly property alias bg: bg
|
|
readonly property alias sendIcon: sendIcon
|
|
readonly property alias glow: glow
|
|
|
|
property bool fastGlow: false
|
|
|
|
signal buttonPressed
|
|
|
|
bottomPadding: Tokens.padding.large
|
|
leftPadding: Tokens.padding.extraLarge
|
|
rightPadding: sendIcon.width + sendIcon.anchors.rightMargin + Tokens.spacing.small
|
|
topPadding: Tokens.padding.large
|
|
wrapMode: TextAreaBase.Wrap
|
|
|
|
onFastGlowChanged: {
|
|
if (fastGlow) {
|
|
resetAnim.stop();
|
|
boostAnim.restart();
|
|
} else {
|
|
boostAnim.stop();
|
|
resetAnim.restart();
|
|
}
|
|
}
|
|
|
|
background: CustomRect {
|
|
id: bg
|
|
|
|
anchors.fill: parent
|
|
color: Colors.tPalette.m3surfaceContainer
|
|
radius: Tokens.rounding.extraLarge
|
|
|
|
GeminiGlow {
|
|
id: glow
|
|
glowSize: 32
|
|
z: 5
|
|
|
|
opacity: root.activeFocus ? 1 : 0
|
|
visible: opacity > 0
|
|
|
|
Behavior on opacity {
|
|
Anim {}
|
|
}
|
|
|
|
SequentialAnimation {
|
|
id: boostAnim
|
|
|
|
NumberAnimation {
|
|
target: glow
|
|
property: "speed"
|
|
to: 4.0
|
|
duration: 250
|
|
easing.type: Easing.OutCubic
|
|
}
|
|
NumberAnimation {
|
|
target: glow
|
|
property: "speed"
|
|
to: 2.25
|
|
duration: 1500
|
|
easing.type: Easing.InOutQuad
|
|
}
|
|
}
|
|
|
|
// Ease back down to normal once fastGlow is false
|
|
NumberAnimation {
|
|
id: resetAnim
|
|
target: glow
|
|
property: "speed"
|
|
to: 1.0
|
|
duration: 800
|
|
easing.type: Easing.InOutQuad
|
|
}
|
|
}
|
|
|
|
StateLayer {
|
|
id: stateLayer
|
|
|
|
cursorShape: Qt.IBeamCursor
|
|
enabled: !root.activeFocus
|
|
manualPressOverride: tapHandler.pressed
|
|
|
|
onClicked: root.forceActiveFocus()
|
|
}
|
|
}
|
|
|
|
onPressed: {
|
|
if (stateLayer.enabled)
|
|
stateLayer.press(stateLayer.mouseX, stateLayer.mouseY);
|
|
}
|
|
|
|
CustomText {
|
|
id: placeholder
|
|
|
|
anchors.left: parent.left
|
|
anchors.leftMargin: root.leftPadding
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
color: root.placeholderTextColor
|
|
font: root.font
|
|
opacity: root.text ? 0 : 1
|
|
text: root.placeholderText
|
|
|
|
Behavior on opacity {
|
|
Anim {
|
|
type: Anim.DefaultEffects
|
|
}
|
|
}
|
|
}
|
|
|
|
IconButton {
|
|
id: sendIcon
|
|
|
|
anchors.right: parent.right
|
|
anchors.rightMargin: Tokens.padding.small
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
enabled: root.text
|
|
icon: "upward_arrow"
|
|
opacity: root.text ? 1 : 0
|
|
radius: Tokens.rounding.full
|
|
radiusMorph: false
|
|
stateLayer.hoverEnabled: enabled
|
|
type: IconButton.Text
|
|
|
|
Behavior on opacity {
|
|
Anim {
|
|
type: Anim.DefaultEffects
|
|
}
|
|
}
|
|
|
|
onClicked: root.buttonPressed()
|
|
}
|
|
|
|
TapHandler {
|
|
id: tapHandler
|
|
}
|
|
}
|