Kirigami-addons

ClockElement.qml
1/*
2 * SPDX-FileCopyrightText: 2019 Dimitris Kardarakos <dimkard@posteo.net>
3 *
4 * SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6
7import QtQuick 2.12
8import QtQuick.Controls 2.5 as Controls2
9import org.kde.kirigami 2.15 as Kirigami
10import QtQuick.Layouts 1.11
11
12Controls2.ToolButton {
13 id: hoursButton
14
15 property int selectedValue
16 property string type
17
18 checkable: true
19 checked: index == selectedValue
20 autoExclusive: true
21 text: index == selectedValue ? ( (type == "hours" && index == 0) ? 12 : index )
22 : ( (type == "hours") ? ( index == 0 ? 12 : ( (index % 3 == 0) ? index : ".") ) : (index % 15 == 0) ? index : ".")
23 contentItem: Controls2.Label {
24 text: hoursButton.text
25 color: index <= parent.selectedValue ? Kirigami.Theme.activeTextColor : Kirigami.Theme.textColor
26 horizontalAlignment: Text.AlignHCenter
27 verticalAlignment: Text.AlignVCenter
28 }
29
30 background: Rectangle {
31 implicitHeight: Kirigami.Units.gridUnit
32 implicitWidth: height
33 radius: width*0.5
34 color: parent.checked ? Kirigami.Theme.activeBackgroundColor : "transparent"
35 }
36}
37
Type type(const QSqlDatabase &db)
AlignHCenter
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:16:11 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.