Themes.qml 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  1. /**
  2. * Copyright © 2010 Digia Plc
  3. * Copyright © 2010 Nokia Corporation
  4. *
  5. * All rights reserved.
  6. *
  7. * Nokia and Nokia Connecting People are registered trademarks of
  8. * Nokia Corporation.
  9. * Java and all Java-based marks are trademarks or registered
  10. * trademarks of
  11. * Sun Microsystems, Inc. Other product and company names
  12. * mentioned herein may be
  13. * trademarks or trade names of their respective owners.
  14. *
  15. *
  16. * Subject to the conditions below, you may, without charge:
  17. *
  18. * · Use, copy, modify and/or merge copies of this software and
  19. * associated documentation files (the "Software")
  20. *
  21. * · Publish, distribute, sub-licence and/or sell new software
  22. * derived from or incorporating the Software.
  23. *
  24. *
  25. * This file, unmodified, shall be included with all copies or
  26. * substantial portions
  27. * of the Software that are distributed in source code form.
  28. *
  29. * The Software cannot constitute the primary value of any new
  30. * software derived
  31. * from or incorporating the Software.
  32. *
  33. * Any person dealing with the Software shall not misrepresent
  34. * the source of the Software.
  35. *
  36. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
  37. * KIND, EXPRESS OR IMPLIED,
  38. * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  39. * MERCHANTABILITY, FITNESS FOR A
  40. * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  41. * AUTHORS OR COPYRIGHT
  42. * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  43. * WHETHER IN AN ACTION
  44. * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  45. * CONNECTION WITH THE
  46. * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  47. */
  48. import Qt 4.7
  49. import "javascript/sql.js" as HCS
  50. import "../colibri"
  51. import "styles"
  52. Item {
  53. id: screen
  54. property int colSpacing: 15
  55. property string room: "room1"
  56. property real buttonSize: 30
  57. property CLStyle style: StyleHomeControlSystem {}
  58. property CLStyle style1: StyleHomeControlSystem {}
  59. property CLStyle style2: StyleHomeControlSystem2 {}
  60. property CLStyle style3: StyleHomeControlSystem3 {}
  61. property CLStyle style4: StyleHomeControlSystem4 {}
  62. property CLStyle style5: StyleHomeControlSystem5 {}
  63. property CLStyle style6: StyleHomeControlSystem6 {}
  64. property bool onStartUp: true
  65. property string activeCLButton: "button1"
  66. signal themeChange()
  67. signal closeWindow()
  68. function updateInfo() {
  69. HCS.getTheRoom(screen.room);
  70. onStartUp = true;
  71. }
  72. Component.onCompleted: {
  73. updateInfo();
  74. buttonSize = screen.width*0.1
  75. }
  76. onHeightChanged:buttonSize = screen.width*0.1
  77. onWidthChanged:buttonSize = screen.width*0.1
  78. width: parent.width
  79. height: parent.height
  80. Item {
  81. id: themeWidget
  82. anchors.horizontalCenter:parent.horizontalCenter
  83. anchors.verticalCenter: parent.verticalCenter
  84. width: parent.width
  85. height: parent.height
  86. Rectangle {
  87. anchors.fill:parent
  88. color:style.colorWhenDefault
  89. visible: if (bgPic.source != "") false
  90. }
  91. Rectangle {
  92. width:themeWidget.width*0.955
  93. height:themeWidget.height*0.924
  94. color:style.selectionColor
  95. anchors.centerIn:parent
  96. radius:7
  97. }
  98. Image {
  99. id: bgPic
  100. source: "images/control_bg_trans_420x275_png.png"
  101. width:themeWidget.width
  102. height:themeWidget.height
  103. anchors.centerIn:parent
  104. opacity:0.7
  105. }
  106. Text {
  107. id: headline
  108. text: "Themes"
  109. font.pixelSize: 1 + Math.round( 23 * (screen.height / 424) )
  110. x: Math.round( screen.width * 0.05 )
  111. y: Math.round( screen.height * 0.05 )
  112. color: screen.style.textColor
  113. font.bold: true
  114. }
  115. MouseArea {
  116. anchors.fill:parent
  117. }
  118. RoomExitButton {
  119. windowWidth: screen.width
  120. windowHeight: screen.height
  121. style: screen.style
  122. onClicked: screen.closeWindow();
  123. }
  124. Column {
  125. spacing: colSpacing
  126. anchors.verticalCenter: parent.verticalCenter
  127. anchors.horizontalCenter: parent.horizontalCenter
  128. Text {
  129. text: "Change theme"
  130. anchors.horizontalCenter:parent.horizontalCenter
  131. font.bold: true
  132. color: screen.style.textColor
  133. font.pixelSize: 20
  134. }
  135. Row {
  136. spacing: colSpacing
  137. CLButton {
  138. id:button1
  139. width:buttonSize
  140. height:buttonSize
  141. gradientWhenDefault:style.gradientBg
  142. style:style1
  143. text:""
  144. borderWidth: (activeCLButton == "button1")?8:1
  145. borderColor: (activeCLButton == "button1")?style.textColor:"white"
  146. MouseArea {
  147. anchors.fill:parent
  148. onClicked:{
  149. style = style1
  150. HCS.setTheme(1)
  151. screen.themeChange()
  152. activeCLButton = "button1"
  153. }
  154. }
  155. }
  156. CLButton {
  157. id:button2
  158. width:buttonSize
  159. height:buttonSize
  160. gradientWhenDefault:style.gradientBg
  161. style:style2
  162. text:""
  163. borderWidth: (activeCLButton == "button2")?8:1
  164. borderColor: (activeCLButton == "button2")?style.textColor:"white"
  165. MouseArea {
  166. anchors.fill:parent
  167. onClicked:{
  168. style = style2
  169. HCS.setTheme(2)
  170. screen.themeChange()
  171. activeCLButton = "button2"
  172. }
  173. }
  174. }
  175. CLButton {
  176. id:button3
  177. width:buttonSize
  178. height:buttonSize
  179. gradientWhenDefault:style.gradientBg
  180. style:style3
  181. text:""
  182. borderWidth: (activeCLButton == "button3")?8:1
  183. borderColor: (activeCLButton == "button3")?style.textColor:"white"
  184. MouseArea {
  185. anchors.fill:parent
  186. onClicked:{
  187. style = style3
  188. HCS.setTheme(3)
  189. screen.themeChange()
  190. activeCLButton = "button3"
  191. }
  192. }
  193. }
  194. }
  195. Row {
  196. spacing: colSpacing
  197. Rectangle{
  198. id:button4
  199. border.width:(activeCLButton == "button4")?8:1
  200. border.color:(activeCLButton == "button4")?style.textColor:"white"
  201. width:buttonSize
  202. height:buttonSize
  203. color:style4.selectionColor
  204. MouseArea {
  205. anchors.fill:parent
  206. onClicked:{
  207. style = style4
  208. HCS.setTheme(4)
  209. screen.themeChange()
  210. activeCLButton = "button4"
  211. }
  212. }
  213. }
  214. Rectangle {
  215. id:button5
  216. border.width:(activeCLButton == "button5")?8:1
  217. border.color:(activeCLButton == "button5")?style.textColor:"white"
  218. width:buttonSize
  219. height:buttonSize
  220. color:style5.selectionColor
  221. MouseArea {
  222. anchors.fill:parent
  223. onClicked:{
  224. style = style5
  225. HCS.setTheme(5)
  226. screen.themeChange()
  227. activeCLButton = "button5"
  228. }
  229. }
  230. }
  231. Rectangle {
  232. id:button6
  233. border.width:(activeCLButton == "button6")?8:1
  234. border.color:(activeCLButton == "button6")?style.textColor:"white"
  235. width:buttonSize
  236. height:buttonSize
  237. color:style6.selectionColor
  238. MouseArea {
  239. anchors.fill:parent
  240. onClicked:{
  241. style = style6
  242. HCS.setTheme(6)
  243. screen.themeChange()
  244. activeCLButton = "button6"
  245. }
  246. }
  247. }
  248. }
  249. }
  250. }
  251. }