/*SPDX-FileCopyrightText: 2019 Harald Sitter <sitter@kde.org>SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL*/import QtQuickItem {property QtObject keyproperty bool complexShape: false// Reduce visual impact for 3rd/4th-level symbolsproperty real higherLevelOpacity: 0.4// NB: we scale height only by a portion of the available space if// some of the levels aren't there. Visually it looks weird when some// labels are full center, so let's still bias them towards an edge, but// increase the height ever so slightlyKeyCapLabel {id: topLeftwidth: topRight.text == "" ? parent.width : parent.width / 2.0horizontalAlignment: parent.complexShape ? Text.Center : Text.AlignLeftheight: (bottomLeft.text == "" && bottomRight.text == "") ? parent.height / 1.7 : parent.height /2.0anchors.top: parent.topanchors.left: parent.lefttext: key.cap.topLeft}KeyCapLabel {id: topRightwidth: parent.width /2.0horizontalAlignment: Text.AlignRightheight: parent.height /2.0anchors.top: parent.topanchors.right: parent.righttext: key.cap.topRightopacity: higherLevelOpacity}KeyCapLabel {id: bottomLeftwidth: bottomRight.text == "" ? parent.width : parent.width / 2.0horizontalAlignment: parent.complexShape ? Text.Center : Text.AlignLeftheight: (topLeft.text == "" && topRight.text == "") ? parent.height / 1.7 : parent.height /2.0anchors.bottom: parent.bottomanchors.left: parent.lefttext: key.cap.bottomLeft}KeyCapLabel {id: bottomRightwidth: parent.width /2.0horizontalAlignment: Text.AlignRightheight: parent.height /2.0anchors.bottom: parent.bottomanchors.right: parent.righttext: key.cap.bottomRightopacity: higherLevelOpacity}}