1 /****************************************************************************
3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
4 ** All rights reserved.
5 ** Contact: Nokia Corporation (qt-info@nokia.com)
7 ** This file is part of the QtDeclarative module of the Qt Toolkit.
9 ** $QT_BEGIN_LICENSE:BSD$
10 ** You may use this file under the terms of the BSD license as follows:
12 ** "Redistribution and use in source and binary forms, with or without
13 ** modification, are permitted provided that the following conditions are
15 ** * Redistributions of source code must retain the above copyright
16 ** notice, this list of conditions and the following disclaimer.
17 ** * Redistributions in binary form must reproduce the above copyright
18 ** notice, this list of conditions and the following disclaimer in
19 ** the documentation and/or other materials provided with the
21 ** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
22 ** the names of its contributors may be used to endorse or promote
23 ** products derived from this software without specific prior written
26 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
27 ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28 ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
29 ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
30 ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
31 ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
32 ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
33 ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
34 ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
35 ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
36 ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
39 ****************************************************************************/
45 height: 480; width:1000
46 property color buttonBorderColor: "#7F8487"
47 property color buttonFillColor: "#8FBDCACD"
48 property string fileContent:directory.fileContent
50 //the menuName is accessible from outside this QML file
51 property string menuName: "File"
53 //used to divide the screen into parts.
54 property real partition: 1/3
58 GradientStop { position: 0.0; color: "#6C646A" }
59 GradientStop { position: 1.0; color: Qt.darker("#6A6D6A") }
64 filename: textInput.text
65 onDirectoryChanged:fileDialog.notifyRefresh()
71 //make this rectangle invisible
73 anchors.left: parent.left
75 //the height is a good proportion that creates more space at the top of the column of buttons
76 width: fileMenu.width * partition; height: fileMenu.height
79 anchors.centerIn: parent
80 spacing: parent.height/32
84 borderColor: buttonBorderColor
85 buttonColor: buttonFillColor
86 width: actionContainer.width/ 1.3
87 height:actionContainer.height / 8
90 directory.fileContent = textArea.textContent
91 directory.filename = textInput.text
95 GradientStop { position: 0.0; color: Qt.lighter(buttonFillColor,1.25) }
96 GradientStop { position: 0.67; color: Qt.darker(buttonFillColor,1.3) }
102 width: actionContainer.width/ 1.3
103 height:actionContainer.height/ 8
104 buttonColor: buttonFillColor
105 borderColor: buttonBorderColor
109 directory.filename = textInput.text
111 textArea.textContent = directory.fileContent
114 GradientStop { position: 0.0; color: Qt.lighter(buttonFillColor,1.25) }
115 GradientStop { position: 0.67; color: Qt.darker(buttonFillColor,1.3) }
120 width: actionContainer.width/ 1.3
121 height:actionContainer.height/ 8
122 buttonColor: buttonFillColor
123 borderColor: buttonBorderColor
127 textArea.textContent = ""
131 GradientStop { position: 0.0; color: Qt.lighter(buttonFillColor,1.25) }
132 GradientStop { position: 0.67; color: Qt.darker(buttonFillColor,1.3) }
138 width: actionContainer.width/ 1.3
139 height:actionContainer.height / 16
144 width: actionContainer.width/ 1.3
145 height:actionContainer.height/ 8
148 buttonColor: buttonFillColor
149 borderColor: buttonBorderColor
150 onButtonClick:Qt.quit()
152 GradientStop { position: 0.0; color: Qt.lighter(buttonFillColor,1.25) }
153 GradientStop { position: 0.67; color: Qt.darker(buttonFillColor,1.3) }
162 width: 2*fileMenu.width * partition; height: fileMenu.height
163 anchors.right:parent.right
167 anchors.centerIn: parent
168 spacing: parent.height /640
171 height: 2*dialogContainer.height * partition; width: dialogContainer.width
172 onSelectChanged: textInput.text = selectedFile
177 height: dialogContainer.height * partition; width: dialogContainer.width
183 GradientStop { position: 0.0; color: "#806F6F6F" }
184 GradientStop { position: 1.0; color: "#136F6F6F" }
188 anchors {centerIn:parent; leftMargin: 15; rightMargin: 15; topMargin: 15}
189 height: parent.height-15; width: parent.width -20
190 border {color:"#4A4A4A"; width:1}
195 anchors {bottom: parent.bottom; topMargin: 10; horizontalCenter:parent.horizontalCenter}
196 width: parent.width - 10
197 height: parent.height -10
199 color:"lightsteelblue"
204 anchors.centerIn:parent
205 text: "Select file name and press save or load"
206 font {pointSize: 11; weight:Font.Light; italic: true}
209 opacity: (textInput.text == "") ? 1: 0
213 anchors {top: parent.top; left: parent.left}
215 font {pointSize: 11; weight: Font.Light; italic: true}
220 anchors.centerIn:parent
221 width: nameField.width; height: nameField.height
224 textInput.focus = true
225 textInput.forceFocus()