~carla-sella/ubuntu-calendar-app/fix-dayview-default-view

400.1.1 by mihirsoni-123
Added copyright header comments in all the pages
1
/*
400.1.2 by mihirsoni-123
updated copyright year
2
 * Copyright (C) 2013-2014 Canonical Ltd
400.1.1 by mihirsoni-123
Added copyright header comments in all the pages
3
 *
4
 * This file is part of Ubuntu Calendar App
5
 *
6
 * Ubuntu Calendar App is free software: you can redistribute it and/or modify
7
 * it under the terms of the GNU General Public License version 3 as
8
 * published by the Free Software Foundation.
9
 *
10
 * Ubuntu Calendar App is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
 */
455.4.4 by Nekhelesh Ramananthan
Improved week views
18
19
import QtQuick 2.3
422.5.1 by Akiva Avraham
Upgraded component library imports
20
import Ubuntu.Components 1.1
114.2.2 by Kunal Parmar
added missing file
21
221.2.3 by Jason Gerlowski
Consolidate MouseArea's in HeaderDateComponent
22
Item {
114.2.2 by Kunal Parmar
added missing file
23
    id: root
24
455.4.4 by Nekhelesh Ramananthan
Improved week views
25
    // Property to set the day and date
114.2.2 by Kunal Parmar
added missing file
26
    property var date;
27
455.4.4 by Nekhelesh Ramananthan
Improved week views
28
    // Property to set the font color of the day label
114.2.2 by Kunal Parmar
added missing file
29
    property alias dayColor: dayLabel.color
30
455.4.4 by Nekhelesh Ramananthan
Improved week views
31
    // Property to set the time format of the day label
32
    property int dayFormat: Locale.ShortFormat
33
34
    // Signal fired when pressing on the date
35
    signal dateSelected(var date)
36
37
    width: dayLabel.paintedWidth
38
    height: dateContainer.height
114.2.2 by Kunal Parmar
added missing file
39
221.2.3 by Jason Gerlowski
Consolidate MouseArea's in HeaderDateComponent
40
    Column {
455.4.4 by Nekhelesh Ramananthan
Improved week views
41
        id: dateContainer
604.1.1 by carla-sella
Completed test_default_view.
42
        objectName: "dateContainer"
455.4.4 by Nekhelesh Ramananthan
Improved week views
43
44
        width: dayLabel.paintedWidth
45
        spacing: units.gu(0.2)
46
47
        anchors.centerIn: parent
221.2.3 by Jason Gerlowski
Consolidate MouseArea's in HeaderDateComponent
48
49
        Label{
50
            id: dayLabel
455.4.4 by Nekhelesh Ramananthan
Improved week views
51
            objectName: "dayLabel"
52
            text: Qt.locale().standaloneDayName(date.getDay(), dayFormat)
550.3.1 by Kunal Parmar
new day and week view
53
            font.bold: true
221.2.3 by Jason Gerlowski
Consolidate MouseArea's in HeaderDateComponent
54
        }
55
56
        Label{
57
            id: dateLabel
58
            objectName: "dateLabel"
59
            text: date.getDate();
455.4.4 by Nekhelesh Ramananthan
Improved week views
60
            color: dayLabel.color
61
            anchors.horizontalCenter: dayLabel.horizontalCenter
221.2.1 by Jason Gerlowski
Clicking on a day in 'Week' tab brings up that day in 'Day' tab
62
        }
114.2.2 by Kunal Parmar
added missing file
63
    }
64
221.2.3 by Jason Gerlowski
Consolidate MouseArea's in HeaderDateComponent
65
    MouseArea {
66
        anchors.fill: parent
67
        onClicked: {
68
            root.dateSelected(date);
221.2.1 by Jason Gerlowski
Clicking on a day in 'Week' tab brings up that day in 'Day' tab
69
        }
114.2.2 by Kunal Parmar
added missing file
70
    }
71
}