Warning, /office/klevernotes/src/contents/ui/settings/FontPicker.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.Layouts 1.15
0006 
0007 import org.kde.kirigami 2.19 as Kirigami
0008 import org.kde.kirigamiaddons.formcard 1.0 as FormCard
0009 
0010 import org.kde.Klever 1.0
0011 
0012 FormCard.FormTextFieldDelegate {
0013     required property font configFont
0014 
0015     property font newFont
0016     property var fontInfo
0017 
0018     Kirigami.Theme.colorSet: Kirigami.Theme.View
0019     Kirigami.Theme.inherit: false
0020 
0021     Layout.margins: 0
0022 
0023     onConfigFontChanged: {
0024         setInfo()
0025     }
0026     Component.onCompleted: {
0027         setInfo()
0028     }
0029 
0030     MouseArea {
0031         anchors.fill: parent
0032         onClicked: {
0033             fontDialog.caller = parent
0034             fontDialog.open()
0035         }
0036     }
0037 
0038     function setInfo() {
0039         fontInfo = KleverUtility.fontInfo(configFont)
0040 
0041         font.family = fontInfo.family
0042         text = fontInfo.family + " " + fontInfo.pointSize + "pt"
0043     }
0044 }