~ubuntu-branches/ubuntu/oneiric/kdepim/oneiric-updates

« back to all changes in this revision

Viewing changes to mobile/mail/NewMailPage.qml

  • Committer: Package Import Robot
  • Author(s): Philip Muškovac
  • Date: 2011-06-28 19:33:24 UTC
  • mfrom: (0.2.13) (0.1.13 sid)
  • Revision ID: package-import@ubuntu.com-20110628193324-8yvjs8sdv9rdoo6c
Tags: 4:4.7.0-0ubuntu1
* New upstream release
  - update install files
  - add missing kdepim-doc package to control file
  - Fix Vcs lines
  - kontact breaks/replaces korganizer << 4:4.6.80
  - tighten the dependency of kdepim-dev on libkdepim4 to fix lintian error

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
    Copyright (c) 2010 Volker Krause <vkrause@kde.org>
 
3
    Copyright (c) 2010 Bertjan Broeksema <broeksema@kde.org>
 
4
    Copyright (C) 2010 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com
 
5
    Copyright (c) 2010 Andras Mantia <amantia@kdab.com>
 
6
 
 
7
    This library is free software; you can redistribute it and/or modify it
 
8
    under the terms of the GNU Library General Public License as published by
 
9
    the Free Software Foundation; either version 2 of the License, or (at your
 
10
    option) any later version.
 
11
 
 
12
    This library is distributed in the hope that it will be useful, but WITHOUT
 
13
    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 
14
    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
 
15
    License for more details.
 
16
 
 
17
    You should have received a copy of the GNU Library General Public License
 
18
    along with this library; see the file COPYING.LIB.  If not, write to the
 
19
    Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 
20
    02110-1301, USA.
 
21
*/
 
22
 
 
23
import Qt 4.7 as QML
 
24
import org.kde 4.5
 
25
import org.kde.pim.mobileui 4.5 as KPIM
 
26
 
 
27
QML.Rectangle { // work around strange anchoring behaviour inside Loader
 
28
  id : root
 
29
  anchors.fill: parent
 
30
  color: "white"
 
31
  z: 10
 
32
 
 
33
  QML.MouseArea {
 
34
    anchors.fill : parent
 
35
    onClicked : {} // do nothing
 
36
  }
 
37
 
 
38
  QML.Rectangle {
 
39
    anchors.right : parent.right
 
40
    anchors.rightMargin : 70
 
41
    anchors.left : parent. left
 
42
    anchors.leftMargin : 70
 
43
    anchors.top : parent.top
 
44
    anchors.topMargin : 70
 
45
    color: "lightgray"
 
46
 
 
47
    QML.Column {
 
48
      anchors.fill: parent
 
49
      KPIM.DecoratedListView {
 
50
        anchors.fill: parent
 
51
        model: _emailTemplateModel
 
52
        focus: true
 
53
        delegate: [
 
54
          KPIM.Button2 {
 
55
            width: parent.width
 
56
            buttonText : display
 
57
            onClicked : {
 
58
              application.newMessageFromTemplate( index );
 
59
              root.parent.visible = false
 
60
            }
 
61
          }
 
62
        ]
 
63
      }
 
64
 
 
65
      KPIM.Button2 {
 
66
        width: parent.width
 
67
        buttonText : KDE.i18n( "Discard" )
 
68
        onClicked : {
 
69
          root.parent.visible = false
 
70
        }
 
71
      }
 
72
    }
 
73
 
 
74
    QML.Component.onCompleted: {
 
75
      height = Math.min( application.emailTemplateCount(), 5 ) * 52; //ask on the fly, can change
 
76
    }
 
77
 
 
78
  }
 
79
}