Warning, /plasma/plasma-desktop/applets/kimpanel/package/contents/ui/ConfigAppearance.qml is written in an unsupported language. File is not indexed.
0001 /*
0002 SPDX-FileCopyrightText: 2014 Weng Xuetian <wengxt@gmail.com>
0003
0004 SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006
0007 import QtQuick 2.5
0008 import QtQuick.Controls 2.5 as QQC2
0009 import QtQuick.Dialogs 6.3 as QtDialogs
0010 import QtQuick.Layouts 1.0
0011 import org.kde.plasma.plasmoid 2.0
0012
0013 import org.kde.kirigami 2.20 as Kirigami
0014 import org.kde.plasma.core as PlasmaCore
0015 import org.kde.kcmutils as KCM
0016
0017 KCM.SimpleKCM {
0018 property bool cfg_vertical_lookup_table
0019 property bool cfg_use_default_font
0020 property font cfg_font
0021 property bool cfg_scaleIconsToFit
0022
0023 Kirigami.FormLayout {
0024 QQC2.ButtonGroup { id: layoutRadioGroup }
0025 QQC2.ButtonGroup { id: scaleRadioGroup }
0026
0027 QQC2.RadioButton {
0028 id: verticalLayoutRadioButton
0029 Kirigami.FormData.label: i18n("Input method list:")
0030 text: i18n("Vertical")
0031 checked: cfg_vertical_lookup_table == true
0032 onToggled: cfg_vertical_lookup_table = checked
0033 QQC2.ButtonGroup.group: layoutRadioGroup
0034 }
0035 QQC2.RadioButton {
0036 text: i18n("Horizontal")
0037 checked: cfg_vertical_lookup_table == false
0038 onToggled: cfg_vertical_lookup_table = !checked
0039 QQC2.ButtonGroup.group: layoutRadioGroup
0040 }
0041
0042 RowLayout {
0043 Kirigami.FormData.label: i18n("Font:")
0044
0045 QQC2.CheckBox {
0046 id: useCustomFont
0047 checked: !cfg_use_default_font
0048 onClicked: cfg_use_default_font = !checked
0049 text: i18n("Use custom:")
0050 }
0051
0052 QQC2.TextField {
0053 enabled: useCustomFont.checked
0054 readOnly: true
0055 text: i18nc("The selected font family and font size", font.family + " " + font.pointSize + "pt")
0056 font: cfg_font
0057 Layout.fillHeight: true
0058 }
0059
0060 QQC2.Button {
0061 enabled: useCustomFont.checked
0062 icon.name: "document-edit"
0063 onClicked: fontDialog.open();
0064
0065 QQC2.ToolTip {
0066 visible: parent.hovered
0067 text: i18n("Select Font…")
0068 }
0069 }
0070 }
0071
0072 QQC2.RadioButton {
0073 Kirigami.FormData.label: i18nc("The arrangement of icons in the Panel", "Panel icon size:")
0074 text: i18n("Small")
0075 checked: cfg_scaleIconsToFit == false
0076 onToggled: cfg_scaleIconsToFit = !checked
0077 QQC2.ButtonGroup.group: scaleRadioGroup
0078 }
0079 QQC2.RadioButton {
0080 id: automaticScaleRadioButton
0081 text: Plasmoid.formFactor === PlasmaCore.Types.Horizontal ? i18n("Scale with Panel height")
0082 : i18n("Scale with Panel width")
0083 checked: cfg_scaleIconsToFit == true
0084 onToggled: cfg_scaleIconsToFit = checked
0085 QQC2.ButtonGroup.group: scaleRadioGroup
0086 }
0087
0088 QtDialogs.FontDialog {
0089 id: fontDialog
0090 title: i18nc("@title:window", "Select Font")
0091
0092 font: !cfg_font || cfg_font.family === "" ? Kirigami.Theme.defaultFont : cfg_font
0093
0094 onAccepted: {
0095 cfg_font = font
0096 }
0097 }
0098 }
0099 }