Warning, /education/kstars/kstars/kstarslite/qml/modules/KSTabBarArrow.qml is written in an unsupported language. File is not indexed.
0001 // SPDX-FileCopyrightText: 2016 Artem Fedoskin <afedoskin3@gmail.com>
0002 // SPDX-License-Identifier: GPL-2.0-or-later
0003
0004 import QtQuick 2.6
0005 import QtQuick.Layouts 1.2
0006 import QtQuick.Controls 2.0
0007 import "../constants" 1.0
0008
0009 Button {
0010 z: 1
0011 id: arrow
0012 property string imgSource
0013 property Item tabBar
0014 property int flickSpeed: 1000
0015 state: "Invisible"
0016
0017 width:image.width*1.5
0018 Image {
0019 id: image
0020 opacity: 0.6
0021 anchors{
0022 verticalCenter: parent.verticalCenter
0023 horizontalCenter: parent.horizontalCenter
0024 }
0025 source: imgSource
0026 }
0027
0028 background: Rectangle {
0029 color: "grey"
0030 opacity: 0.6
0031 }
0032
0033 onPressedChanged: {
0034 if(pressed) {
0035 arrow.background.opacity = 0.3
0036 tabBar.contentItem.flick(flickSpeed,0)
0037 } else {
0038 arrow.background.opacity = 0.6
0039 }
0040 }
0041
0042 states: [
0043 State {
0044 name: "Visible"
0045 PropertyChanges{target: arrow; opacity: 1.0}
0046 PropertyChanges{target: arrow; visible: true}
0047 },
0048 State {
0049 name:"Invisible"
0050 PropertyChanges{target: arrow; opacity: 0.0}
0051 PropertyChanges{target: arrow; visible: false}
0052 }
0053 ]
0054
0055 transitions: [
0056 Transition {
0057 from: "Visible"
0058 to: "Invisible"
0059
0060 SequentialAnimation{
0061 NumberAnimation {
0062 target: arrow
0063 property: "opacity"
0064 duration: arrow
0065 easing.type: Easing.InOutQuad
0066 }
0067 NumberAnimation {
0068 target: arrow
0069 property: "visible"
0070 duration: 50
0071 }
0072 }
0073 },
0074 Transition {
0075 from: "Invisible"
0076 to: "Visible"
0077 SequentialAnimation{
0078 NumberAnimation {
0079 target: arrow
0080 property: "visible"
0081 duration: 0
0082 }
0083 NumberAnimation {
0084 target: arrow
0085 property: "opacity"
0086 duration: 200
0087 easing.type: Easing.InOutQuad
0088 }
0089 }
0090 }
0091 ]
0092 }