diff --git a/applets/calendar/package/contents/config/config.qml b/applets/calendar/package/contents/config/config.qml --- a/applets/calendar/package/contents/config/config.qml +++ b/applets/calendar/package/contents/config/config.qml @@ -25,7 +25,7 @@ ConfigModel { ConfigCategory { name: i18n("General") - icon: "preferences-system-time" + icon: "preferences-desktop-plasma" source: "configGeneral.qml" } // ConfigCategory { diff --git a/applets/calendar/package/contents/ui/configGeneral.qml b/applets/calendar/package/contents/ui/configGeneral.qml --- a/applets/calendar/package/contents/ui/configGeneral.qml +++ b/applets/calendar/package/contents/ui/configGeneral.qml @@ -18,54 +18,46 @@ * along with this program. If not, see */ -import QtQuick 2.0 -import QtQuick.Controls 1.0 as QtControls -import QtQuick.Layouts 1.0 as QtLayouts +import QtQuick 2.5 +import QtQuick.Controls 2.5 as QtControls +import org.kde.kirigami 2.5 as Kirigami -Item { +Kirigami.FormLayout { id: generalPage - - width: childrenRect.width - height: childrenRect.height + + anchors.left: parent.left + anchors.right: parent.right property alias cfg_showWeekNumbers: showWeekNumbers.checked property string cfg_compactDisplay - QtLayouts.ColumnLayout { - anchors.left: parent.left - QtControls.CheckBox { - id: showWeekNumbers - text: i18n("Show week numbers in Calendar") - } - QtLayouts.RowLayout { - QtControls.Label { - text: i18nc("What information is shown in the calendar icon", "Icon:") - } + QtControls.CheckBox { + id: showWeekNumbers + + Kirigami.FormData.label: i18n("Calendar version:") + + text: i18n("Show week numbers") + } + - QtControls.ComboBox { - id: compactDisplayCombo - QtLayouts.Layout.minimumWidth: units.gridUnit * 7 // horrible default sizing in ComboBox - model: [{ - text: i18nc("Show the number of the day (eg. 31) in the icon", "Day in month"), - value: "d" - }, { - text: i18nc("Show the week number (eg. 50) in the icon", "Week number"), - value: "w" - }] - onActivated: { - cfg_compactDisplay = compactDisplayCombo.model[index].value - } + Item { + Kirigami.FormData.isSection: true + } + + + QtControls.RadioButton { + Kirigami.FormData.label: i18nc("What information is shown in the calendar icon", "Compact version:") + + text: i18nc("Show the number of the day (eg. 31) in the icon", "Show day of the month") + + checked: cfg_compactDisplay == "d" + onCheckedChanged: if (checked) cfg_compactDisplay = "d" + } + QtControls.RadioButton { + text: i18nc("Show the week number (eg. 50) in the icon", "Show week number") - Component.onCompleted: { - for (var i = 0, length = model.length; i < length; ++i) { - if (model[i].value === cfg_compactDisplay) { - currentIndex = i - return - } - } - } - } - } + checked: cfg_compactDisplay == "w" + onCheckedChanged: if (checked) cfg_compactDisplay = "w" } }