~artmello/gallery-app/gallery-app-fix_1524973

« back to all changes in this revision

Viewing changes to qml/Tab.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: tab_wrapper
 
25
  objectName: "tab_wrapper"
 
26
  
 
27
  property string title: ""
 
28
  
 
29
  height: 44
 
30
  
 
31
  signal activated()
 
32
  
 
33
  states: [
 
34
    State { name: "selected";
 
35
      PropertyChanges { target: selected_tab_image; visible: true; }
 
36
      PropertyChanges { target: deselected_tab_image; visible: false; }
 
37
      PropertyChanges { target: tab_wrapper; z: 10; }
 
38
    },
 
39
 
 
40
    State { name: "deselected";
 
41
      PropertyChanges { target: selected_tab_image; visible: false; }
 
42
      PropertyChanges { target: deselected_tab_image; visible: true; }
 
43
      PropertyChanges { target: tab_wrapper; z: 0; }
 
44
    }
 
45
  ]
 
46
  
 
47
  state: "deselected"
 
48
  
 
49
  Image {
 
50
    id: selected_tab_image
 
51
    objectName: "selected_tab_image"
 
52
    
 
53
    source: "selected-tab.png"
 
54
    
 
55
    Text {
 
56
      text: tab_wrapper.title
 
57
      anchors.centerIn: parent
 
58
      color: "#657CA9"
 
59
    }
 
60
    
 
61
    MouseArea {
 
62
      anchors.fill: parent
 
63
      
 
64
      onClicked: activated()
 
65
    }
 
66
  }
 
67
  
 
68
  Image {
 
69
    id: deselected_tab_image
 
70
    objectName: "deselected_tab_image"
 
71
    
 
72
    source: "deselected-tab.png"
 
73
 
 
74
    Text {
 
75
      text: tab_wrapper.title
 
76
      anchors.centerIn: parent
 
77
      color: "#657CA9"
 
78
    }
 
79
 
 
80
    MouseArea {
 
81
      anchors.fill: parent
 
82
      
 
83
      onClicked: activated()
 
84
    }
 
85
  }
 
86
}
 
87