Commit e39aed6f authored by Nate Graham's avatar Nate Graham 🔩

[Calendar] Port settings window to QQC2+Kirigami FormLayout and modernize UI

Summary:
- Port to QQC2+Kirigami FormLayout style
- Adjust some strings to be more natural
- Use radio buttons instead of a two-item combobox

Test Plan:
Everything works.

{F6793395}

Reviewers: #vdg, #plasma, filipf

Reviewed By: #vdg, filipf

Subscribers: filipf, plasma-devel

Tags: #plasma

Maniphest Tasks: T10586

Differential Revision: https://phabricator.kde.org/D20829
parent 9b24060c
......@@ -25,7 +25,7 @@ import org.kde.plasma.configuration 2.0
ConfigModel {
ConfigCategory {
name: i18n("General")
icon: "preferences-system-time"
icon: "preferences-desktop-plasma"
source: "configGeneral.qml"
}
// ConfigCategory {
......
......@@ -18,54 +18,46 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*/
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"
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment