Warning, /plasma/plasma-workspace/kcms/fonts/ui/FontWidget.qml is written in an unsupported language. File is not indexed.
0001 /*
0002 SPDX-FileCopyrightText: 2015 Antonis Tsiapaliokas <antonis.tsiapaliokas@kde.org>
0003 SPDX-FileCopyrightText: 2017 Marco Martin <mart@kde.org>
0004
0005 SPDX-License-Identifier: LGPL-2.0-only
0006 */
0007
0008 import QtQuick 2.1
0009 import QtQuick.Layouts 1.1
0010 import QtQuick.Controls 2.0 as QtControls
0011 import org.kde.kirigami 2.3 as Kirigami
0012 import org.kde.kcmutils
0013
0014 FocusScope {
0015 id: root
0016 property string label
0017 property alias tooltipText: tooltip.text
0018 property string category
0019 property font font
0020 Kirigami.FormData.label: root.label
0021 activeFocusOnTab: true
0022
0023 implicitWidth: layout.implicitWidth
0024 implicitHeight: layout.implicitHeight
0025
0026 RowLayout {
0027 id: layout
0028
0029 QtControls.TextField {
0030 readOnly: true
0031 Kirigami.Theme.inherit: true
0032 text: i18nc("%1 is the name of a font type, %2 is the size in points (pt). Ex: Noto Sans 10pt", "%1 %2pt", root.font.family, root.font.pointSize)
0033 font: root.font
0034 }
0035
0036 QtControls.Button {
0037 icon.name: "document-edit"
0038 Layout.fillHeight: true
0039 Kirigami.MnemonicData.enabled: false
0040 focus: true
0041 onClicked: {
0042 fontDialog.adjustAllFonts = false
0043 kcm.adjustFont(root.font, root.category)
0044 }
0045 QtControls.ToolTip {
0046 id: tooltip
0047 }
0048 }
0049 }
0050 }
0051