~ubuntu-branches/ubuntu/utopic/sflphone/utopic

« back to all changes in this revision

Viewing changes to kde/plasma/plasmoid-qml/package/contents/ui/TabBar.qml

  • Committer: Package Import Robot
  • Author(s): Mark Purcell
  • Date: 2013-06-30 11:40:56 UTC
  • mfrom: (4.1.18 saucy-proposed)
  • Revision ID: package-import@ubuntu.com-20130630114056-0np50jkyqo6vnmii
Tags: 1.2.3-2
* changeset_r92d62cfc54732bbbcfff2b1d36c096b120b981a5.diff 
  - fixes automatic endian detection 
* Update Vcs: fixes vcs-field-not-canonical

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/******************************************************************************
 
2
 *   Copyright (C) 2012 by Savoir-Faire Linux                                 *
 
3
 *   Author : Emmanuel Lepage Vallee <emmanuel.lepage@savoirfairelinux.com>   *
 
4
 *                                                                            *
 
5
 *   This library is free software; you can redistribute it and/or            *
 
6
 *   modify it under the terms of the GNU Lesser General Public               *
 
7
 *   License as published by the Free Software Foundation; either             *
 
8
 *   version 2.1 of the License, or (at your option) any later version.       *
 
9
 *                                                                            *
 
10
 *   This library 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 GNU        *
 
13
 *   Lesser General Public License for more details.                          *
 
14
 *                                                                            *
 
15
 *   You should have received a copy of the Lesser GNU General Public License *
 
16
 *   along with this program.  If not, see <http://www.gnu.org/licenses/>.    *
 
17
 *****************************************************************************/
 
18
import QtQuick 1.1
 
19
import org.kde.plasma.components 0.1 as Plasma
 
20
 
 
21
//Plasma.TagGroup {
 
22
Plasma.TabBar {
 
23
    id:tabBar
 
24
    width:parent.width
 
25
 
 
26
    function displayTabs(index) {
 
27
        switch (index) {
 
28
            case 0:
 
29
                contactList.visible = false
 
30
                callList.visible    = true
 
31
                historyList.visible = false
 
32
                bookmarkList.visible= false
 
33
                settingsTab.visible = false
 
34
                break;
 
35
            case 1:
 
36
                contactList.visible = true
 
37
                callList.visible    = false
 
38
                historyList.visible = false
 
39
                bookmarkList.visible= false
 
40
                settingsTab.visible = false
 
41
                break;
 
42
            case 2:
 
43
                contactList.visible = false
 
44
                historyList.visible = true
 
45
                callList.visible    = false
 
46
                bookmarkList.visible= false
 
47
                settingsTab.visible = false
 
48
                break;
 
49
            case 3:
 
50
                contactList.visible = false
 
51
                historyList.visible = false
 
52
                callList.visible    = false
 
53
                bookmarkList.visible= true
 
54
                settingsTab.visible = false
 
55
                break;
 
56
            case 4:
 
57
                contactList.visible = false
 
58
                callList.visible    = false
 
59
                historyList.visible = false
 
60
                bookmarkList.visible= false
 
61
                settingsTab.visible = true
 
62
               break
 
63
        }
 
64
    }
 
65
 
 
66
    //Buggy, awaiting fix upstream, test often
 
67
   /*Repeater {
 
68
      model:5
 
69
      Plasma.TabButton {
 
70
         text: Array("New calls","Contacts","History","Bookmarks","Settings")[index]
 
71
         onPressedChanged: {
 
72
            tabBar.displayTabs(index)
 
73
         }
 
74
      }
 
75
   }*/
 
76
   Plasma.TabButton {
 
77
      text: "New calls"
 
78
      iconSource: "call-start"
 
79
      onPressedChanged: {
 
80
         tabBar.displayTabs(0)
 
81
      }
 
82
   }
 
83
 
 
84
   Plasma.TabButton {
 
85
      text: "Contacts"
 
86
      iconSource: "user-identity"
 
87
      onPressedChanged: {
 
88
         tabBar.displayTabs(1)
 
89
      }
 
90
   }
 
91
 
 
92
   Plasma.TabButton {
 
93
      text: "History"
 
94
      iconSource: "view-history"
 
95
      onPressedChanged: {
 
96
         tabBar.displayTabs(2)
 
97
      }
 
98
   }
 
99
 
 
100
   Plasma.TabButton {
 
101
      text: "Bookmarks"
 
102
      iconSource: "favorites"
 
103
      onPressedChanged: {
 
104
         tabBar.displayTabs(3)
 
105
      }
 
106
   }
 
107
 
 
108
   Plasma.TabButton {
 
109
      iconSource: "configure"
 
110
      text:"Configure"
 
111
      onPressedChanged: {
 
112
         tabBar.displayTabs(4)
 
113
      }
 
114
   }
 
115
}
 
116
//}