Warning, /libraries/kirigami-addons/src/dateandtime/private/ClockElement.qml is written in an unsupported language. File is not indexed.

0001 /*
0002  *   SPDX-FileCopyrightText: 2019 Dimitris Kardarakos <dimkard@posteo.net>
0003  *
0004  *   SPDX-License-Identifier: LGPL-2.0-or-later
0005  */
0006 
0007 import QtQuick 2.12
0008 import QtQuick.Controls 2.5 as Controls2
0009 import org.kde.kirigami 2.15 as Kirigami
0010 import QtQuick.Layouts 1.11
0011 
0012         
0013 Controls2.ToolButton { 
0014     id: hoursButton
0015 
0016     property int selectedValue
0017     property string type
0018     
0019     checkable: true
0020     checked: index == selectedValue
0021     autoExclusive: true       
0022     text: index == selectedValue ? ( (type == "hours" && index == 0) ? 12 : index )
0023                                  : ( (type == "hours") ? ( index == 0 ? 12 : ( (index % 3 == 0) ? index : ".") ) : (index % 15 == 0) ? index : ".")
0024     contentItem: Controls2.Label {
0025         text: hoursButton.text
0026         color: index <= parent.selectedValue ? Kirigami.Theme.activeTextColor : Kirigami.Theme.textColor
0027         horizontalAlignment: Text.AlignHCenter
0028         verticalAlignment: Text.AlignVCenter
0029     }
0030     
0031     background: Rectangle {
0032         implicitHeight: Kirigami.Units.gridUnit
0033         implicitWidth: height
0034         radius: width*0.5
0035         color: parent.checked ? Kirigami.Theme.activeBackgroundColor : "transparent"
0036     }                 
0037 }
0038