diff options
-rw-r--r-- | examples/quick/calendar/main.qml | 6 | ||||
-rw-r--r-- | src/imports/calendar/CalendarDelegate.qml | 60 | ||||
-rw-r--r-- | src/imports/calendar/CalendarView.qml | 10 | ||||
-rw-r--r-- | src/imports/calendar/calendar.pro | 1 | ||||
-rw-r--r-- | src/imports/calendar/qmldir | 1 |
5 files changed, 12 insertions, 66 deletions
diff --git a/examples/quick/calendar/main.qml b/examples/quick/calendar/main.qml index 82d71ecb..759e93a8 100644 --- a/examples/quick/calendar/main.qml +++ b/examples/quick/calendar/main.qml @@ -124,12 +124,16 @@ ApplicationWindow { onClicked: calendar.selectedDate = date - delegate: CalendarDelegate { + delegate: Text { text: model.day width: delegate.contentItem.width / 7 height: delegate.contentItem.height / 6 opacity: model.month === delegate.month ? 1 : 0 color: model.today ? Theme.accentColor : Theme.textColor + minimumPointSize: 8 + fontSizeMode: Text.Fit + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter Rectangle { z: -1 anchors.centerIn: parent diff --git a/src/imports/calendar/CalendarDelegate.qml b/src/imports/calendar/CalendarDelegate.qml deleted file mode 100644 index dde7360f..00000000 --- a/src/imports/calendar/CalendarDelegate.qml +++ /dev/null @@ -1,60 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Calendar module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.6 -import QtQuick.Controls 2.0 -import QtQuick.Calendar 2.0 - -Item { - property alias text: label.text - property alias color: label.color - property real padding - - implicitWidth: label.implicitWidth * 3 - implicitHeight: label.implicitHeight * 3 - - Text { - id: label - x: padding - y: padding - width: parent.width - 2 * padding - height: parent.height - 2 * padding - minimumPointSize: 8 - fontSizeMode: Text.Fit - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - } -} diff --git a/src/imports/calendar/CalendarView.qml b/src/imports/calendar/CalendarView.qml index 6bf11b8f..42d8e76f 100644 --- a/src/imports/calendar/CalendarView.qml +++ b/src/imports/calendar/CalendarView.qml @@ -49,9 +49,13 @@ AbstractCalendarView { Accessible.name: title //! [delegate] - delegate: CalendarDelegate { - width: grid.width ? grid.width / 7 : implicitWidth - height: grid.height ? grid.height / 6 : implicitHeight + delegate: Text { + width: grid.width ? grid.width / 7 : implicitWidth * 3 + height: grid.height ? grid.height / 6 : implicitHeight * 3 + minimumPointSize: 8 + fontSizeMode: Text.Fit + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter opacity: model.month === control.month ? 1 : 0 color: model.today ? control.Theme.accentColor : control.Theme.textColor text: model.day diff --git a/src/imports/calendar/calendar.pro b/src/imports/calendar/calendar.pro index 69981d51..b8318672 100644 --- a/src/imports/calendar/calendar.pro +++ b/src/imports/calendar/calendar.pro @@ -9,7 +9,6 @@ OTHER_FILES += \ qmldir QML_FILES = \ - CalendarDelegate.qml \ CalendarView.qml \ DayOfWeekRow.qml \ WeekNumberColumn.qml diff --git a/src/imports/calendar/qmldir b/src/imports/calendar/qmldir index af87241f..7a72edee 100644 --- a/src/imports/calendar/qmldir +++ b/src/imports/calendar/qmldir @@ -1,7 +1,6 @@ module QtQuick.Calendar plugin qtquickcalendar2plugin classname QtQuickCalendar2Plugin -CalendarDelegate 2.0 CalendarDelegate.qml CalendarView 2.0 CalendarView.qml DayOfWeekRow 2.0 DayOfWeekRow.qml WeekNumberColumn 2.0 WeekNumberColumn.qml |