summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@digia.com>2014-07-17 15:38:29 +0200
committerMitch Curtis <mitch.curtis@digia.com>2014-07-17 16:09:45 +0200
commit8ac9c0c3dfcec06f4d39b8616c2bf2b8048f694c (patch)
tree83632e70382de5e6f36b5be6b9a664e5076c78f3
parente417afed5835e6f9c3c6a623d778f581bc959d1c (diff)
downloadqtquickcontrols-8ac9c0c3dfcec06f4d39b8616c2bf2b8048f694c.tar.gz
Improve implicit size of Calendar on high DPI devices.
Task-number: QTBUG-39473 Change-Id: Ibfb1c040efd9744ba6c8bc56affcdf90a807b046 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
-rw-r--r--examples/quick/controls/calendar/qml/main.qml7
-rw-r--r--src/controls/Styles/Base/CalendarStyle.qml12
2 files changed, 12 insertions, 7 deletions
diff --git a/examples/quick/controls/calendar/qml/main.qml b/examples/quick/controls/calendar/qml/main.qml
index feb21852..579937ea 100644
--- a/examples/quick/controls/calendar/qml/main.qml
+++ b/examples/quick/controls/calendar/qml/main.qml
@@ -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"
diff --git a/src/controls/Styles/Base/CalendarStyle.qml b/src/controls/Styles/Base/CalendarStyle.qml
index 56978ded..15a80d9b 100644
--- a/src/controls/Styles/Base/CalendarStyle.qml
+++ b/src/controls/Styles/Base/CalendarStyle.qml
@@ -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