@ -21,11 +21,12 @@
* /
import QtQuick 2.0
import QtQuick . Controls 1.0 as QtControls
import QtQuick . Controls 2.3 as QtControls
import QtQuick . Layouts 1.0 as QtLayouts
import org . kde . plasma . calendar 2.0 as PlasmaCalendar
import org . kde . kirigami 2.5 as Kirigami
Item {
QtLayouts . ColumnLayout {
id: appearancePage
width: childrenRect . width
height: childrenRect . height
@ -43,7 +44,7 @@ Item {
property alias cfg_showDate: showDate . checked
property string cfg_dateFormat: "shortDate"
property alias cfg_use24hFormat: use24hFormat . checkedState
property alias cfg_use24hFormat: use24hFormat . checked
onCfg_fontFamilyChanged: {
/ / H A C K b y t h e t i m e w e p o p u l a t e o u r m o d e l a n d / o r t h e C o m b o B o x i s f i n i s h e d t h e v a l u e i s s t i l l u n d e f i n e d
@ -72,107 +73,92 @@ Item {
}
}
QtLayouts . Column Layout {
anchors.left: parent . left
Kirigami . Form Layout {
QtLayouts.Layout.fillWidth: true
QtControls . GroupBox {
QtLayouts.Layout.fillWidth: true
title: i18n ( "Information" )
flat: true
QtLayouts . ColumnLayout {
QtControls . CheckBox {
id: showDate
text: i18n ( "Show date" )
}
QtControls . CheckBox {
id: showDate
Kirigami.FormData.label: i18n ( "Information:" )
text: i18n ( "Show date" )
}
QtControls . CheckBox {
id: showSeconds
text: i18n ( "Show seconds" )
}
QtControls . CheckBox {
id: showSeconds
text: i18n ( "Show seconds" )
}
QtControls . CheckBox {
id: use24hFormat
text: i18nc ( "Checkbox label; means 24h clock format, without am/pm" , "Use 24-hour Clock" )
}
QtControls . CheckBox {
id: use24hFormat
text: i18nc ( "Checkbox label; means 24h clock format, without am/pm" , "Use 24-hour Clock" )
}
QtControls . CheckBox {
id: showLocalTimezone
text: i18n ( "Show local time zone" )
}
QtControls . CheckBox {
id: showLocalTimezone
text: i18n ( "Show local time zone" )
}
QtControls . Label {
text : i18n ( "Display time zone as:" )
}
QtLayouts . ColumnLayout {
Kirigami.FormData.label : i18n ( "Display time zone as:" )
Kirigami.FormData.buddyFor: timezoneCityRadio
QtControls . GroupBox {
QtLayouts.Layout.fillWidth: true
flat: true
QtLayouts . ColumnLayout {
QtControls . RadioButton {
id: timezoneCityRadio
text: i18n ( "Time zone city" )
}
QtControls . ExclusiveGroup { id: timezoneDisplayType }
QtControls . RadioButton {
id: timezoneCodeRadio
text: i18n ( "Time zone code" )
}
}
QtControls . RadioButton {
id: timezoneCityRadio
text: i18n ( "Time zone city" )
exclusiveGroup: timezoneDisplayType
}
Item {
Kirigami.FormData.isSection: true
}
QtControls . RadioButton {
id: timezoneCodeRadio
text: i18n ( "Time zone code" )
exclusiveGroup: timezoneDisplayType
}
}
QtControls . ComboBox {
id: dateFormat
Kirigami.FormData.label: i18n ( "Date format:" )
enabled: showDate . checked
textRole: "label"
model: [
{
'label' : i18n ( "Long Date" ) ,
'name' : "longDate"
} ,
{
'label' : i18n ( "Short Date" ) ,
'name' : "shortDate"
} ,
{
'label' : i18n ( "ISO Date" ) ,
'name' : "isoDate"
}
]
onCurrentIndexChanged: cfg_dateFormat = model [ currentIndex ] [ "name" ]
QtLayouts . RowLayout {
QtControls . Label {
text: i18n ( "Date format:" )
}
QtControls . ComboBox {
id: dateFormat
enabled: showDate . checked
textRole: "label"
model: [
{
'label' : i18n ( "Long Date" ) ,
'name' : "longDate"
} ,
{
'label' : i18n ( "Short Date" ) ,
'name' : "shortDate"
} ,
{
'label' : i18n ( "ISO Date" ) ,
'name' : "isoDate"
}
]
onCurrentIndexChanged: cfg_dateFormat = model [ currentIndex ] [ "name" ]
Component.onCompleted: {
for ( var i = 0 ; i < model . length ; i ++ ) {
if ( model [ i ] [ "name" ] == plasmoid . configuration . dateFormat ) {
dateFormat . currentIndex = i ;
}
}
}
Component.onCompleted: {
for ( var i = 0 ; i < model . length ; i ++ ) {
if ( model [ i ] [ "name" ] == plasmoid . configuration . dateFormat ) {
dateFormat . currentIndex = i ;
}
}
}
}
Item {
Kirigami.FormData.isSection: true
}
QtLayouts . RowLayout {
QtLayouts.Layout.fillWidth: true
QtControls . Label {
text: i18n ( "Font style:" )
}
Kirigami.FormData.label: i18n ( "Font style:" )
QtControls . ComboBox {
id: fontFamilyComboBox
QtLayouts.Layout.fillWidth: true
currentIndex: 0
/ / C o m b o B o x ' s s i z i n g i s j u s t u t t e r l y b r o k e n
QtLayouts.Layout.minimumWidth: units . gridUnit * 10
model: fontsModel
@ -190,21 +176,28 @@ Item {
QtControls . Button {
id: boldCheckBox
tooltip: i18n ( "Bold text" )
iconName: "format-text-bold"
QtControls . ToolTip {
text: i18n ( "Bold text" )
}
icon.name: "format-text-bold"
checkable: true
Accessible.name: tooltip
}
QtControls . Button {
id: italicCheckBox
tooltip: i18n ( "Italic text" )
iconName: "format-text-italic"
QtControls . ToolTip {
text: i18n ( "Italic text" )
}
icon.name: "format-text-italic"
checkable: true
Accessible.name: tooltip
}
}
}
Item {
QtLayouts.Layout.fillHeight: true
}
Component.onCompleted: {
if ( plasmoid . configuration . displayTimezoneAsCode ) {