Warning, /office/klevernotes/src/contents/ui/textEditor/components/NotesMapEntry.qml is written in an unsupported language. File is not indexed.

0001 // SPDX-License-Identifier: GPL-2.0-or-later
0002 // SPDX-FileCopyrightText: 2023 Louis Schul <schul9louis@gmail.com>
0003 
0004 import QtQuick 2.15
0005 import QtQuick.Controls 2.15 as Controls
0006 import QtQuick.Layouts 1.15
0007 
0008 import org.kde.kirigami 2.19 as Kirigami
0009 import org.kde.kirigamiaddons.formcard 1.0 as FormCard
0010 
0011 FormCard.AbstractFormDelegate {
0012     id: root
0013 
0014     readonly property string title: model.title
0015     readonly property string notePath: model.notePath
0016     readonly property string displayedPath: model.displayedPath
0017     readonly property string exists: model.exists
0018     readonly property string header: model.header
0019     readonly property bool headerExists: model.headerExists
0020     readonly property int headerLevel: model.headerLevel
0021     
0022     readonly property int elemWidth: Math.round((root.width - arrow.width - root.horizontalPadding * 2 - Kirigami.Units.smallSpacing * 3) / 5) 
0023 
0024     width: parent.width //prevent binding loop on implicitWidth
0025     
0026     contentItem: RowLayout {
0027 
0028         spacing: Kirigami.Units.smallSpacing 
0029 
0030         Controls.Label {
0031             text: root.title
0032             elide: Text.ElideRight
0033             Layout.preferredWidth: root.elemWidth * 2
0034         }
0035 
0036         Controls.Label {
0037             text: root.displayedPath
0038             elide: Text.ElideRight
0039             color: root.exists === "Yes" ? Kirigami.Theme.positiveTextColor : Kirigami.Theme.negativeTextColor
0040             Layout.preferredWidth: root.elemWidth * 2
0041         }
0042 
0043         Controls.Label {
0044             text: root.header
0045             elide: Text.ElideRight
0046             color: root.headerExists ? Kirigami.Theme.positiveTextColor : Kirigami.Theme.negativeTextColor
0047             Layout.preferredWidth: root.elemWidth
0048         }
0049 
0050         FormCard.FormArrow {
0051             id: arrow
0052             Layout.leftMargin: Kirigami.Units.smallSpacing
0053             Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
0054             Layout.preferredWidth: Kirigami.Units.gridUnit
0055             direction: Qt.RightArrow
0056         }
0057     }
0058 }