Warning, /utilities/kirogi/src/ui/components/VirtualHorizon.qml is written in an unsupported language. File is not indexed.

0001 /*
0002  * Copyright 2019 Eike Hein <hein@kde.org>
0003  *
0004  * This program is free software; you can redistribute it and/or
0005  * modify it under the terms of the GNU General Public License as
0006  * published by the Free Software Foundation; either version 2 of
0007  * the License or (at your option) version 3 or any later version
0008  * accepted by the membership of KDE e.V. (or its successor approved
0009  * by the membership of KDE e.V.), which shall act as a proxy
0010  * defined in Section 14 of version 3 of the license.
0011  *
0012  * This program is distributed in the hope that it will be useful,
0013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0015  * GNU General Public License for more details.
0016  *
0017  * You should have received a copy of the GNU General Public License
0018  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
0019  */
0020 
0021 import QtQuick 2.12
0022 import QtQuick.Window 2.12
0023 
0024 import org.kde.kirigami 2.6 as Kirigami
0025 
0026 Item {
0027     property alias roll: rollBar.rotation
0028 
0029     height: width
0030 
0031     clip: true
0032     antialiasing: true
0033 
0034     Item {
0035         anchors.fill: parent
0036 
0037         id: rollBar
0038 
0039         Behavior on rotation { NumberAnimation { duration: Kirigami.Units.shortDuration } }
0040 
0041         Rectangle {
0042             x: leftBar.x + 1
0043             y: leftBar.y + 1
0044 
0045             width: leftBar.width
0046             height: leftBar.height
0047 
0048             color: "grey"
0049 
0050             antialiasing: true
0051         }
0052 
0053         Rectangle {
0054             id: leftBar
0055 
0056             anchors.verticalCenter: parent.verticalCenter
0057             anchors.left: parent.left
0058 
0059             width: parent.width * 0.25
0060             height: 2
0061 
0062             color: "white"
0063 
0064             antialiasing: true
0065         }
0066 
0067         Rectangle {
0068             x: rightBar.x + 1
0069             y: rightBar.y + 1
0070 
0071             width: rightBar.width
0072             height: rightBar.height
0073 
0074             color: "grey"
0075 
0076             antialiasing: true
0077         }
0078 
0079         Rectangle {
0080             id: rightBar
0081 
0082             anchors.verticalCenter: parent.verticalCenter
0083             anchors.right: parent.right
0084 
0085             width: parent.width * 0.25
0086             height: 2
0087 
0088             color: "white"
0089 
0090             antialiasing: true
0091         }
0092     }
0093 
0094     // Clip circle to create semi-circle effect
0095     Item {
0096         anchors.centerIn: parent
0097         width: parent.width
0098         height: width * 0.3
0099         clip: true
0100 
0101         Rectangle {
0102             id: circle
0103 
0104             width: parent.width
0105             height: width
0106             radius: width / 2
0107 
0108             anchors.centerIn: parent
0109 
0110             color: "transparent"
0111 
0112             border.width: 2
0113             border.color: "white"
0114 
0115             antialiasing: true
0116         }
0117     }
0118 }