From d13e4db9d74aefc0bd08ca946b789155a11361fb Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Mon, 29 May 2017 14:57:07 +0200 Subject: Calendar: make locale property public This is useful to set a locale on a specific calendar, as opposed to using the application-wide default. plugins.qmltypes was also updated. [ChangeLog][Calendar] Added locale property, which affects which day is shown as the first day of the week, as well as date and day name localization. Task-number: QTBUG-60217 Change-Id: I113298a3f3b6dd407d26f3f55ed6973e73ab6a4c Reviewed-by: J-P Nurmi --- src/controls/Styles/Android/CalendarStyle.qml | 2 +- src/controls/Styles/Base/CalendarStyle.qml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/controls/Styles') diff --git a/src/controls/Styles/Android/CalendarStyle.qml b/src/controls/Styles/Android/CalendarStyle.qml index 449cc497..52b02bff 100644 --- a/src/controls/Styles/Android/CalendarStyle.qml +++ b/src/controls/Styles/Android/CalendarStyle.qml @@ -83,7 +83,7 @@ CalendarStyle { LabelStyle { id: dayOfWeek anchors.centerIn: parent - text: control.__locale.dayName(styleData.dayOfWeek, control.dayOfWeekFormat) + text: control.locale.dayName(styleData.dayOfWeek, control.dayOfWeekFormat) focused: control.activeFocus window_focused: control.Window.active styleDef: AndroidStyle.styleDef.calendarViewStyle.CalendarView_weekDayTextAppearance diff --git a/src/controls/Styles/Base/CalendarStyle.qml b/src/controls/Styles/Base/CalendarStyle.qml index 862c5f43..12cb3a4b 100644 --- a/src/controls/Styles/Base/CalendarStyle.qml +++ b/src/controls/Styles/Base/CalendarStyle.qml @@ -320,7 +320,7 @@ Style { color: gridVisible ? "#fcfcfc" : "transparent" implicitHeight: Math.round(TextSingleton.implicitHeight * 2.25) Label { - text: control.__locale.dayName(styleData.dayOfWeek, control.dayOfWeekFormat) + text: control.locale.dayName(styleData.dayOfWeek, control.dayOfWeekFormat) anchors.centerIn: parent } } @@ -397,8 +397,8 @@ Style { active: control.navigationBarVisible property QtObject styleData: QtObject { - readonly property string title: control.__locale.standaloneMonthName(control.visibleMonth) - + new Date(control.visibleYear, control.visibleMonth, 1).toLocaleDateString(control.__locale, " yyyy") + readonly property string title: control.locale.standaloneMonthName(control.visibleMonth) + + new Date(control.visibleYear, control.visibleMonth, 1).toLocaleDateString(control.locale, " yyyy") } } @@ -413,7 +413,7 @@ Style { Repeater { id: repeater model: CalendarHeaderModel { - locale: control.__locale + locale: control.locale } Loader { id: dayOfWeekDelegateLoader -- cgit v1.2.1