~ubuntu-branches/ubuntu/quantal/kde-runtime/quantal

« back to all changes in this revision

Viewing changes to plasma/declarativeimports/plasmacomponents/qml/ToolBar.qml

  • Committer: Package Import Robot
  • Author(s): Philip Muškovac
  • Date: 2012-06-03 21:50:00 UTC
  • mto: This revision was merged to the branch mainline in revision 21.
  • Revision ID: package-import@ubuntu.com-20120603215000-vn7oarsq0ynrydj5
Tags: upstream-4.8.80
Import upstream version 4.8.80

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
*   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
18
18
*/
19
19
 
20
 
/**Documentanted API
 
20
/**Documented API
21
21
Inherits:
22
22
        PlasmaCore.FrameSvgItem
23
23
 
31
31
Properties:
32
32
 
33
33
        Item tools:
34
 
        The current set of tools; null if none.
 
34
        The ToolBarLayout that contains the ToolButton components that
 
35
        are contained in the ToolBar. ToolBarLayout is not mandatory.
 
36
        The default value is NULL.
 
37
 
35
38
 
36
39
        string transition:
37
 
        The transition type. One of the following:
 
40
        The type of transition to be used for the ToolBar when
 
41
        the page changes on the relevant PageStack.
 
42
        The possible values can be one of the following:
38
43
              set         an instantaneous change (default)
39
44
              push        follows page stack push animation
40
45
              pop         follows page stack pop animation
41
46
              replace     follows page stack replace animation
 
47
 
 
48
Methods:
 
49
        void setTools( tools, transition ):
 
50
        This sets the tools for the ToolBar and the transition type that
 
51
        will be used when the page changes on the relevant PageStack.
 
52
        @arg Item tools see tool property
 
53
        @arg string transition see transition property
42
54
**/
43
55
 
44
56
import QtQuick 1.1
67
79
    //      replace     follows page stack replace animation
68
80
    property string transition: "set"
69
81
 
 
82
    //This invisible item keeps all the old dismissed tools:
 
83
    //note that the outside application still has to keep references to them (or explicity delete them) or they will just accumulate wasting memory
 
84
    Item {
 
85
        id: oldToolsItem
 
86
        visible: false
 
87
    }
70
88
    // Sets the tools with a transition.
71
89
    function setTools(tools, transition)
72
90
    {
74
92
            return
75
93
        }
76
94
 
 
95
        if (connection.oldTools) {
 
96
            connection.oldTools.parent = oldToolsItem
 
97
        }
 
98
        connection.oldTools = toolBar.tools
77
99
        toolBar.transition = transition
78
100
        toolBar.tools = tools
79
101
    }
80
102
    Connections {
81
103
        id: connection
82
104
        target: toolBar
 
105
        property Item oldTools
 
106
 
83
107
        function internalToolsChanged()
84
108
        {
85
109
            var newContainer