Warning, /plasma/plasma-desktop/kcms/keyboard/tastenbrett/qml/KeyCap.qml is written in an unsupported language. File is not indexed.
0001 /*
0002 SPDX-FileCopyrightText: 2019 Harald Sitter <sitter@kde.org>
0003
0004 SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0005 */
0006
0007 import QtQuick 2.12
0008
0009 Item {
0010 property QtObject key
0011
0012 // NB: we scale height only by a portion of the available space if
0013 // some of the levels aren't there. Visually it looks weird when some
0014 // labels are full center, so let's still bias them towards an edge, but
0015 // increase the height ever so slightly
0016
0017 KeyCapLabel {
0018 id: topLeft
0019 width: topRight.text == "" ? parent.width : parent.width / 2.0
0020 horizontalAlignment: Text.AlignLeft
0021 height: (bottomLeft.text == "" && bottomRight.text == "") ? parent.height / 1.7 : parent.height /2.0
0022 anchors.top: parent.top
0023 anchors.left: parent.left
0024 text: key.cap.topLeft
0025 }
0026 KeyCapLabel {
0027 id: topRight
0028 width: parent.width /2.0
0029 horizontalAlignment: Text.AlignRight
0030 height: parent.height /2.0
0031 anchors.top: parent.top
0032 anchors.right: parent.right
0033 text: key.cap.topRight
0034 }
0035 KeyCapLabel {
0036 id: bottomLeft
0037 width: bottomRight.text == "" ? parent.width : parent.width / 2.0
0038 horizontalAlignment: Text.AlignLeft
0039 height: (topLeft.text == "" && topRight.text == "") ? parent.height / 1.7 : parent.height /2.0
0040 anchors.bottom: parent.bottom
0041 anchors.left: parent.left
0042 text: key.cap.bottomLeft
0043 }
0044 KeyCapLabel {
0045 id: bottomRight
0046 width: parent.width /2.0
0047 horizontalAlignment: Text.AlignRight
0048 height: parent.height /2.0
0049 anchors.bottom: parent.bottom
0050 anchors.right: parent.right
0051 text: key.cap.bottomRight
0052 }
0053 }