~artmello/gallery-app/badcontext_crash

« back to all changes in this revision

Viewing changes to qml/ReturnButton.qml

  • Committer: Adam Dingle
  • Date: 2011-12-02 16:50:22 UTC
  • Revision ID: adam@yorba.org-20111202165022-uwvs4abs076oqwgy
Initial commit from Yorba.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2011 Canonical Ltd
 
3
 *
 
4
 * This program is free software: you can redistribute it and/or modify
 
5
 * it under the terms of the GNU General Public License version 3 as
 
6
 * published by the Free Software Foundation.
 
7
 *
 
8
 * This program is distributed in the hope that it will be useful,
 
9
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
11
 * GNU General Public License for more details.
 
12
 *
 
13
 * You should have received a copy of the GNU General Public License
 
14
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
15
 *
 
16
 * Authors:
 
17
 * Jim Nelson <jim@yorba.org>
 
18
 * Lucas Beeler <lucas@yorba.org>
 
19
 */
 
20
 
 
21
import QtQuick 1.1
 
22
 
 
23
Rectangle {
 
24
  id: return_button
 
25
  objectName: "return_button"
 
26
  
 
27
  property string title: "Return"
 
28
  
 
29
  signal pressed()
 
30
  
 
31
  width: 192
 
32
  height: 48
 
33
  
 
34
  color: "transparent"
 
35
  
 
36
  Image {
 
37
    id: return_cap_icon
 
38
    objectName: "return_cap_icon"
 
39
    
 
40
    width: 18
 
41
    height: 48
 
42
    x: 0
 
43
    y: 0
 
44
    z: 0
 
45
    
 
46
    source: "return-cap.png"
 
47
  }
 
48
  
 
49
  Image {
 
50
    width: return_button.width - return_cap_icon.width
 
51
    height: 48
 
52
    x: 18
 
53
    y: 0
 
54
    z: 0
 
55
    
 
56
    source: "element-body.png"
 
57
    
 
58
    fillMode: Image.Tile
 
59
  }
 
60
  
 
61
  Text {
 
62
    anchors.centerIn: parent
 
63
    text: return_button.title
 
64
    color: "white"
 
65
    
 
66
    z: 10
 
67
  }
 
68
  
 
69
  MouseArea {
 
70
    anchors.fill: parent
 
71
    z: 20
 
72
    
 
73
    onClicked: return_button.pressed()
 
74
  }
 
75
}
 
76