aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@theqtcompany.com>2015-06-23 23:40:43 +0200
committerJ-P Nurmi <jpnurmi@theqtcompany.com>2015-06-23 21:48:54 +0000
commit6be049cd9ab30dae1e30668e3d032fe4ec04cefe (patch)
tree9f396627ec721f81eae2de2a8f087655c7d23641 /src/imports
parent37875ee82ad8306e8a74008a19068e65ee9897d4 (diff)
Kill CalendarDelegate
The default CalendarView delegate implementation will be included in the "Customizing CalendarView" docs. That should be enough to get started, so we avoid exposing such type and committing to its API for now. Hiding it from the API allows also a bit simpler implementation => getting rid of the wrapper item reduces the total amount of items in a CalendarView from 87 to 45. Change-Id: Idac693347df72377b3bb518fb1bab505d20d6f12 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Diffstat (limited to 'src/imports')
-rw-r--r--src/imports/calendar/CalendarDelegate.qml60
-rw-r--r--src/imports/calendar/CalendarView.qml10
-rw-r--r--src/imports/calendar/calendar.pro1
-rw-r--r--src/imports/calendar/qmldir1
4 files changed, 7 insertions, 65 deletions
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