~pkunal-parmar/ubuntu-calendar-app/MakeEditorVisible

« back to all changes in this revision

Viewing changes to TimeLineHeader.qml

  • Committer: Nekhelesh Ramananthan
  • Date: 2014-09-19 09:54:47 UTC
  • mto: (455.5.4 3-Improve-DayView)
  • mto: This revision was merged to the branch mainline in revision 460.
  • Revision ID: krnekhelesh@gmail.com-20140919095447-60duemtr22cdvc95
Tweaked TimeLineHeader.qml

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
 * You should have received a copy of the GNU General Public License
16
16
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
17
 */
18
 
import QtQuick 2.0
 
18
 
 
19
import QtQuick 2.3
19
20
import Ubuntu.Components 1.1
20
 
 
21
 
import "dateExt.js" as DateExt
22
21
import "ViewType.js" as ViewType
23
22
 
24
23
PathViewBase {
29
28
    interactive: false
30
29
    model:3
31
30
 
32
 
    height: units.gu(8)
 
31
    height: units.gu(4)
33
32
    width: parent.width
34
33
 
35
34
    property var date;
36
35
 
37
36
    signal dateSelected(var date);
38
37
 
39
 
    DayHeaderBackground{
40
 
        height: FontUtils.sizeToPixels("medium") + units.gu(1.5)
41
 
    }
42
 
 
43
38
    delegate: TimeLineHeaderComponent{
44
39
        type: header.type
45
40
 
47
42
 
48
43
        width: {
49
44
            if( type == ViewType.ViewTypeWeek ) {
50
 
                 parent.width
 
45
                parent.width
51
46
            } else if( type == ViewType.ViewTypeDay && isCurrentItem ){
52
47
                (header.width/7) * 5
53
48
            } else {
55
50
            }
56
51
        }
57
52
 
58
 
        startDay: {
59
 
            (type == ViewType.ViewTypeWeek) ?
60
 
                date.addDays(7*header.indexType(index)) :
61
 
                date.addDays(1*header.indexType(index));
62
 
        }
 
53
        startDay: type == ViewType.ViewTypeWeek ? date.addDays(7*header.indexType(index))
 
54
                                                : date.addDays(1*header.indexType(index))
63
55
 
64
56
        onDateSelected: {
65
57
            header.dateSelected(date);