52 lines
1.8 KiB
QML
52 lines
1.8 KiB
QML
/*
|
|
Speed Climbing Stopwatch - Simple Stopwatch for Climbers
|
|
Copyright (C) 2018 Itsblue Development - Dorian Zeder
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
it under the terms of the GNU Affero General Public License as published
|
|
by the Free Software Foundation, version 3 of the License.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU Affero General Public License for more details.
|
|
|
|
You should have received a copy of the GNU Affero General Public License
|
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
import QtQuick 2.0
|
|
|
|
Rectangle {
|
|
property bool checked: parent.checked
|
|
property bool down: parent.down
|
|
property int set_height: parent.font.pixelSize * 1.4
|
|
implicitWidth: set_height * 1.84
|
|
implicitHeight: set_height
|
|
x: parent.width - width - parent.rightPadding
|
|
y: parent.height / 2 - height / 2
|
|
radius: implicitHeight * 0.5
|
|
color: parent.checked ? "#17a81a" : "transparent"
|
|
border.color: parent.checked ? "#17a81a" : "#cccccc"
|
|
Behavior on color{
|
|
ColorAnimation{
|
|
duration: 200
|
|
}
|
|
}
|
|
|
|
Rectangle {
|
|
x: parent.checked ? parent.width - width : 0
|
|
width: parent.height
|
|
height: parent.height
|
|
radius: height * 0.5
|
|
color: parent.down ? "#cccccc" : "#ffffff"
|
|
border.color: parent.checked ? (parent.down ? "#17a81a" : "#21be2b") : "#999999"
|
|
Behavior on x{
|
|
NumberAnimation {
|
|
property: "x"
|
|
duration: 200
|
|
easing.type: Easing.InOutQuad
|
|
}
|
|
}
|
|
}
|
|
}
|