Changeset View
Changeset View
Standalone View
Standalone View
applets/kimpanel/package/contents/ui/ConfigAppearance.qml
Show All 10 Lines | |||||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | 12 | * GNU General Public License for more details. | ||
13 | * | 13 | * | ||
14 | * You should have received a copy of the GNU General Public License | 14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | 15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA. | 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA. | ||
17 | */ | 17 | */ | ||
18 | 18 | | |||
19 | import QtQuick 2.0 | 19 | import QtQuick 2.5 | ||
20 | import QtQuick.Controls 1.0 as QtControls | 20 | import QtQuick.Controls 2.5 as QQC2 | ||
21 | import QtQuick.Dialogs 1.1 as QtDialogs | 21 | import QtQuick.Dialogs 1.1 as QtDialogs | ||
22 | import QtQuick.Layouts 1.0 | 22 | import QtQuick.Layouts 1.0 | ||
23 | 23 | | |||
24 | import org.kde.kirigami 2.5 as Kirigami | ||||
24 | import org.kde.plasma.core 2.0 as PlasmaCore | 25 | import org.kde.plasma.core 2.0 as PlasmaCore | ||
25 | import org.kde.plasma.components 2.0 as PlasmaComponents | 26 | import org.kde.plasma.components 2.0 as PlasmaComponents | ||
26 | import org.kde.plasma.extras 2.0 as PlasmaExtras | 27 | import org.kde.plasma.extras 2.0 as PlasmaExtras | ||
27 | 28 | | |||
28 | Item { | 29 | Kirigami.FormLayout { | ||
29 | id: iconsPage | 30 | id: iconsPage | ||
30 | implicitWidth: pageColumn.implicitWidth | | |||
31 | implicitHeight: pageColumn.implicitHeight | | |||
32 | 31 | | |||
33 | property alias cfg_vertical_lookup_table: verticalLookupTable.checked | 32 | property alias cfg_vertical_lookup_table: verticalLookupTable.checked | ||
34 | property alias cfg_use_default_font: useDefaultFont.checked | 33 | property bool cfg_use_default_font | ||
35 | property font cfg_font | 34 | property font cfg_font | ||
36 | 35 | | |||
37 | onCfg_fontChanged: { | 36 | QQC2.CheckBox { | ||
38 | if (cfg_font.family === '') { | | |||
39 | cfg_font = theme.defaultFont | | |||
40 | } | | |||
41 | fontDialog.font = cfg_font | | |||
42 | } | | |||
43 | | ||||
44 | ColumnLayout { | | |||
45 | id: pageColumn | | |||
46 | width: parent.width | | |||
47 | | ||||
48 | QtControls.CheckBox { | | |||
49 | id: verticalLookupTable | 37 | id: verticalLookupTable | ||
50 | text: i18n("Vertical List") | 38 | Kirigami.FormData.label: i18n("Input method list:") | ||
51 | } | 39 | text: i18n("Vertical") | ||
52 | | ||||
53 | QtControls.CheckBox { | | |||
54 | id: useDefaultFont | | |||
55 | text: i18n("Use Default Font") | | |||
56 | } | 40 | } | ||
57 | 41 | | |||
58 | RowLayout { | 42 | RowLayout { | ||
59 | width: parent.width | 43 | Kirigami.FormData.label: i18n("Font:") | ||
60 | 44 | | |||
ngraham: A list of what? Maybe make it explicit in the label. | |||||
61 | QtControls.Label { | 45 | QQC2.CheckBox { | ||
62 | text: i18n("Custom Font:") | 46 | id: useCustomFont | ||
47 | checked: !cfg_use_default_font | ||||
48 | onClicked: cfg_use_default_font = !checked | ||||
49 | text: i18n("Use custom:") | ||||
63 | } | 50 | } | ||
64 | 51 | | |||
65 | QtControls.TextField { | 52 | QQC2.TextField { | ||
66 | id: fontPreviewLabel | 53 | enabled: useCustomFont.checked | ||
67 | Layout.fillWidth: true | | |||
68 | enabled: !cfg_use_default_font | | |||
69 | anchors.verticalCenter: parent.verticalCenter | | |||
70 | readOnly: true | 54 | readOnly: true | ||
55 | text: i18nc("The selected font family and font size", font.family + " " + font.pointSize + "pt") | ||||
71 | font: cfg_font | 56 | font: cfg_font | ||
72 | text: cfg_font.family + ' ' + cfg_font.pointSize | 57 | Layout.fillHeight: true | ||
73 | } | 58 | } | ||
74 | 59 | | |||
75 | QtControls.Button { | 60 | QQC2.Button { | ||
76 | id: fontButton | 61 | enabled: useCustomFont.checked | ||
77 | enabled: !cfg_use_default_font | 62 | icon.name: "document-edit" | ||
ngraham: Is this necessary? I thought `true` was the default for this. | |||||
78 | text: i18n("Select Font") | | |||
79 | onClicked: fontDialog.open(); | 63 | onClicked: fontDialog.open(); | ||
This should be translated with i18nc() (the correct order of elements may be different in other languages) ngraham: This should be translated with `i18nc()` (the correct order of elements may be different in… | |||||
64 | | ||||
65 | QQC2.ToolTip { | ||||
66 | visible: parent.hovered | ||||
67 | text: i18n("Select Font...") | ||||
80 | } | 68 | } | ||
81 | } | 69 | } | ||
82 | } | 70 | } | ||
83 | 71 | | |||
84 | QtDialogs.FontDialog { | 72 | QtDialogs.FontDialog { | ||
85 | id: fontDialog | 73 | id: fontDialog | ||
86 | title: i18nc("@title:window", "Select Font") | 74 | title: i18nc("@title:window", "Select Font") | ||
87 | 75 | | |||
76 | font: !cfg_font || cfg_font.family === "" ? theme.defaultFont : cfg_font | ||||
77 | | ||||
88 | onAccepted: { | 78 | onAccepted: { | ||
89 | cfg_font = font | 79 | cfg_font = font | ||
90 | } | 80 | } | ||
91 | } | 81 | } | ||
92 | } | 82 | } |
A list of what? Maybe make it explicit in the label.