2021-03-14 04:45:20 +03:00
|
|
|
// SPDX-FileCopyrightText: 2021 Nheko Contributors
|
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
2021-02-23 19:06:21 +03:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.13
|
2021-03-14 03:24:26 +03:00
|
|
|
import QtQuick.Layouts 1.13
|
2021-02-23 19:06:21 +03:00
|
|
|
|
2021-03-06 21:48:24 +03:00
|
|
|
TextField {
|
2021-02-23 19:06:21 +03:00
|
|
|
id: input
|
2021-03-06 21:48:24 +03:00
|
|
|
|
2021-03-14 03:24:26 +03:00
|
|
|
palette: colors
|
2021-02-23 19:06:21 +03:00
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
id: blueBar
|
|
|
|
|
|
|
|
anchors.top: parent.bottom
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
2021-02-23 19:37:45 +03:00
|
|
|
color: colors.highlight
|
2021-02-23 19:06:21 +03:00
|
|
|
height: 1
|
|
|
|
width: parent.width
|
2021-03-14 03:24:26 +03:00
|
|
|
|
2021-02-23 19:06:21 +03:00
|
|
|
Rectangle {
|
|
|
|
id: blackBar
|
|
|
|
|
|
|
|
anchors.verticalCenter: blueBar.verticalCenter
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
2021-03-14 03:24:26 +03:00
|
|
|
height: parent.height + 1
|
2021-02-23 19:06:21 +03:00
|
|
|
width: 0
|
2021-02-23 19:37:45 +03:00
|
|
|
color: colors.text
|
2021-03-14 03:24:26 +03:00
|
|
|
|
2021-02-23 19:06:21 +03:00
|
|
|
states: State {
|
2021-03-14 03:24:26 +03:00
|
|
|
name: "focused"
|
|
|
|
when: input.activeFocus == true
|
|
|
|
|
2021-02-23 19:06:21 +03:00
|
|
|
PropertyChanges {
|
|
|
|
target: blackBar
|
|
|
|
width: blueBar.width
|
|
|
|
}
|
2021-03-14 03:24:26 +03:00
|
|
|
|
2021-02-23 19:06:21 +03:00
|
|
|
}
|
2021-03-14 03:24:26 +03:00
|
|
|
|
2021-02-23 19:06:21 +03:00
|
|
|
transitions: Transition {
|
|
|
|
from: ""
|
|
|
|
to: "focused"
|
|
|
|
reversible: true
|
|
|
|
|
2021-03-14 03:24:26 +03:00
|
|
|
NumberAnimation {
|
2021-02-23 19:06:21 +03:00
|
|
|
target: blackBar
|
|
|
|
properties: "width"
|
|
|
|
duration: 500
|
|
|
|
easing.type: Easing.InOutQuad
|
2021-03-14 03:24:26 +03:00
|
|
|
alwaysRunToEnd: true
|
2021-02-23 19:06:21 +03:00
|
|
|
}
|
2021-03-14 03:24:26 +03:00
|
|
|
|
2021-02-23 19:06:21 +03:00
|
|
|
}
|
2021-03-14 03:24:26 +03:00
|
|
|
|
2021-02-23 19:06:21 +03:00
|
|
|
}
|
2021-03-14 03:24:26 +03:00
|
|
|
|
2021-02-23 19:06:21 +03:00
|
|
|
}
|
2021-03-14 03:24:26 +03:00
|
|
|
|
|
|
|
background: Rectangle {
|
|
|
|
color: colors.base
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|