Commit 8ac9c0c3 authored by Mitch Curtis's avatar Mitch Curtis
Browse files

Improve implicit size of Calendar on high DPI devices.


Task-number: QTBUG-39473
Change-Id: Ibfb1c040efd9744ba6c8bc56affcdf90a807b046
Reviewed-by: default avatarJ-P Nurmi <jpnurmi@digia.com>
Showing with 12 additions and 7 deletions
......@@ -40,6 +40,7 @@
import QtQuick 2.2
import QtQuick.Controls 1.2
import QtQuick.Controls.Private 1.0
import QtQuick.Controls.Styles 1.1
import org.qtproject.examples.calendar 1.0
......@@ -53,6 +54,10 @@ ApplicationWindow {
title: "Calendar Example"
SystemPalette {
id: systemPalette
}
SqlEventModel {
id: eventModel
}
......@@ -163,7 +168,7 @@ ApplicationWindow {
style: CalendarStyle {
dayDelegate: Item {
readonly property color sameMonthDateTextColor: "#444"
readonly property color selectedDateColor: Qt.platform.os === "osx" ? "#3778d0" : __syspal.highlight
readonly property color selectedDateColor: Qt.platform.os === "osx" ? "#3778d0" : systemPalette.highlight
readonly property color selectedDateTextColor: "white"
readonly property color differentMonthDateTextColor: "#bbb"
readonly property color invalidDatecolor: "#dddddd"
......
......@@ -166,8 +166,8 @@ Style {
*/
property Component background: Rectangle {
color: "#fff"
implicitWidth: 250
implicitHeight: 250
implicitWidth: Math.max(250, Math.round(TextSingleton.implicitHeight * 14))
implicitHeight: Math.max(250, Math.round(TextSingleton.implicitHeight * 14))
}
/*!
......@@ -183,7 +183,7 @@ Style {
\endtable
*/
property Component navigationBar: Rectangle {
height: 41
height: Math.round(TextSingleton.implicitHeight * 2.73)
color: "#f9f9f9"
Rectangle {
......@@ -212,7 +212,7 @@ Style {
text: styleData.title
elide: Text.ElideRight
horizontalAlignment: Text.AlignHCenter
font.pointSize: 14
font.pixelSize: TextSingleton.implicitHeight * 1.25
anchors.verticalCenter: parent.verticalCenter
anchors.left: previousMonth.right
anchors.leftMargin: 2
......@@ -313,7 +313,7 @@ Style {
*/
property Component dayOfWeekDelegate: Rectangle {
color: gridVisible ? "#fcfcfc" : "transparent"
implicitHeight: 40
implicitHeight: Math.round(TextSingleton.implicitHeight * 2.25)
Label {
text: control.__locale.dayName(styleData.dayOfWeek, control.dayOfWeekFormat)
anchors.centerIn: parent
......@@ -334,7 +334,7 @@ Style {
\endtable
*/
property Component weekNumberDelegate: Rectangle {
implicitWidth: 30
implicitWidth: Math.round(TextSingleton.implicitHeight * 2)
Label {
text: styleData.weekNumber
anchors.centerIn: parent
......
Supports Markdown
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