ItemsOriginal.qml 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  1. pragma Singleton
  2. import QtQuick
  3. import FluentUI
  4. FluObject{
  5. property var navigationView
  6. FluPaneItem{
  7. title:lang.home
  8. icon:FluentIcons.Home
  9. // cusIcon: Image{
  10. // anchors.centerIn: parent
  11. // source: FluTheme.dark ? "qrc:/example/res/svg/home_dark.svg" : "qrc:/example/res/svg/home.svg"
  12. // sourceSize: Qt.size(30,30)
  13. // width: 18
  14. // height: 18
  15. // }
  16. onTap:{
  17. navigationView.push("qrc:/example/qml/page/T_Home.qml")
  18. }
  19. }
  20. FluPaneItemExpander{
  21. title:lang.basic_input
  22. icon:FluentIcons.CheckboxComposite
  23. FluPaneItem{
  24. title:"Buttons"
  25. image:"qrc:/example/res/image/control/Button.png"
  26. recentlyUpdated:true
  27. desc:"A control that responds to user input and raisesa Click event."
  28. onTap:{
  29. navigationView.push("qrc:/example/qml/page/T_Buttons.qml")
  30. }
  31. }
  32. FluPaneItem{
  33. title:"Text"
  34. onTap:{
  35. navigationView.push("qrc:/example/qml/page/T_Text.qml")
  36. }
  37. }
  38. FluPaneItem{
  39. title:"Slider"
  40. image:"qrc:/example/res/image/control/Slider.png"
  41. recentlyUpdated:true
  42. desc:"A control that lets the user select from a rangeof values by moving a Thumb control along atrack."
  43. onTap:{
  44. navigationView.push("qrc:/example/qml/page/T_Slider.qml")
  45. }
  46. }
  47. FluPaneItem{
  48. title:"CheckBox"
  49. image:"qrc:/example/res/image/control/Checkbox.png"
  50. recentlyUpdated:true
  51. desc:"A control that a user can select or clear."
  52. onTap:{
  53. navigationView.push("qrc:/example/qml/page/T_CheckBox.qml")
  54. }
  55. }
  56. FluPaneItem{
  57. title:"ToggleSwitch"
  58. onTap:{
  59. navigationView.push("qrc:/example/qml/page/T_ToggleSwitch.qml")
  60. }
  61. }
  62. }
  63. FluPaneItemExpander{
  64. title:lang.form
  65. icon:FluentIcons.GridView
  66. FluPaneItem{
  67. title:"TextBox"
  68. onTap:{
  69. navigationView.push("qrc:/example/qml/page/T_TextBox.qml")
  70. }
  71. }
  72. FluPaneItem{
  73. title:"TimePicker"
  74. onTap:{
  75. navigationView.push("qrc:/example/qml/page/T_TimePicker.qml")
  76. }
  77. }
  78. FluPaneItem{
  79. title:"DatePicker"
  80. onTap:{
  81. navigationView.push("qrc:/example/qml/page/T_DatePicker.qml")
  82. }
  83. }
  84. FluPaneItem{
  85. title:"CalendarPicker"
  86. onTap:{
  87. navigationView.push("qrc:/example/qml/page/T_CalendarPicker.qml")
  88. }
  89. }
  90. FluPaneItem{
  91. title:"ColorPicker"
  92. onTap:{
  93. navigationView.push("qrc:/example/qml/page/T_ColorPicker.qml")
  94. }
  95. }
  96. }
  97. FluPaneItemExpander{
  98. title:lang.surface
  99. icon:FluentIcons.SurfaceHub
  100. FluPaneItem{
  101. title:"InfoBar"
  102. image:"qrc:/example/res/image/control/InfoBar.png"
  103. recentlyUpdated:true
  104. desc:"An inline message to display app-wide statuschange information."
  105. onTap:{
  106. navigationView.push("qrc:/example/qml/page/T_InfoBar.qml")
  107. }
  108. }
  109. FluPaneItem{
  110. title:"Progress"
  111. onTap:{
  112. navigationView.push("qrc:/example/qml/page/T_Progress.qml")
  113. }
  114. }
  115. FluPaneItem{
  116. title:"RatingControl"
  117. onTap:{
  118. navigationView.push("qrc:/example/qml/page/T_RatingControl.qml")
  119. }
  120. }
  121. FluPaneItem{
  122. title:"Badge"
  123. onTap:{
  124. navigationView.push("qrc:/example/qml/page/T_Badge.qml")
  125. }
  126. }
  127. FluPaneItem{
  128. title:"Rectangle"
  129. onTap:{
  130. navigationView.push("qrc:/example/qml/page/T_Rectangle.qml")
  131. }
  132. }
  133. FluPaneItem{
  134. title:"StatusView"
  135. onTap:{
  136. navigationView.push("qrc:/example/qml/page/T_StatusView.qml")
  137. }
  138. }
  139. FluPaneItem{
  140. title:"Carousel"
  141. onTap:{
  142. navigationView.push("qrc:/example/qml/page/T_Carousel.qml")
  143. }
  144. }
  145. FluPaneItem{
  146. title:"Expander"
  147. onTap:{
  148. navigationView.push("qrc:/example/qml/page/T_Expander.qml")
  149. }
  150. }
  151. }
  152. FluPaneItemExpander{
  153. title:lang.popus
  154. icon:FluentIcons.ButtonMenu
  155. FluPaneItem{
  156. title:"Dialog"
  157. onTap:{
  158. navigationView.push("qrc:/example/qml/page/T_Dialog.qml")
  159. }
  160. }
  161. FluPaneItem{
  162. title:"Tooltip"
  163. onTap:{
  164. navigationView.push("qrc:/example/qml/page/T_Tooltip.qml")
  165. }
  166. }
  167. FluPaneItem{
  168. title:"Menu"
  169. onTap:{
  170. navigationView.push("qrc:/example/qml/page/T_Menu.qml")
  171. }
  172. }
  173. }
  174. FluPaneItemExpander{
  175. title:lang.navigation
  176. icon:FluentIcons.AllApps
  177. FluPaneItem{
  178. title:"Pivot"
  179. image:"qrc:/example/res/image/control/Pivot.png"
  180. recentlyAdded:true
  181. order:3
  182. desc:"Presents information from different sources in atabbed view."
  183. onTap:{
  184. navigationView.push("qrc:/example/qml/page/T_Pivot.qml")
  185. }
  186. }
  187. FluPaneItem{
  188. title:"BreadcrumbBar"
  189. onTap:{
  190. navigationView.push("qrc:/example/qml/page/T_BreadcrumbBar.qml")
  191. }
  192. }
  193. FluPaneItem{
  194. title:"TabView"
  195. image:"qrc:/example/res/image/control/TabView.png"
  196. recentlyAdded:true
  197. order:1
  198. desc:"A control that displays a collection of tabs thatcan be used to display several documents."
  199. onTap:{
  200. navigationView.push("qrc:/example/qml/page/T_TabView.qml")
  201. }
  202. }
  203. FluPaneItem{
  204. title:"TreeView"
  205. onTap:{
  206. navigationView.push("qrc:/example/qml/page/T_TreeView.qml")
  207. }
  208. }
  209. FluPaneItem{
  210. title:"TableView"
  211. image:"qrc:/example/res/image/control/DataGrid.png"
  212. recentlyAdded:true
  213. order:4
  214. desc:"The TableView control provides a flexible way to display a collection of data in rows and columns"
  215. onTap:{
  216. navigationView.push("qrc:/example/qml/page/T_TableView.qml")
  217. }
  218. }
  219. FluPaneItem{
  220. title:"MultiWindow"
  221. onTap:{
  222. navigationView.push("qrc:/example/qml/page/T_MultiWindow.qml")
  223. }
  224. }
  225. FluPaneItem{
  226. title:"FlipView"
  227. image:"qrc:/example/res/image/control/FlipView.png"
  228. recentlyAdded:true
  229. order:2
  230. desc:"Presents a collection of items that the user canflip through, one item at a time."
  231. onTap:{
  232. navigationView.push("qrc:/example/qml/page/T_FlipView.qml")
  233. }
  234. }
  235. }
  236. FluPaneItemExpander{
  237. title:lang.theming
  238. icon:FluentIcons.Brightness
  239. FluPaneItem{
  240. title:"Theme"
  241. onTap:{
  242. navigationView.push("qrc:/example/qml/page/T_Theme.qml")
  243. }
  244. }
  245. FluPaneItem{
  246. title:"Typography"
  247. onTap:{
  248. navigationView.push("qrc:/example/qml/page/T_Typography.qml")
  249. }
  250. }
  251. FluPaneItem{
  252. title:"Awesome"
  253. onTap:{
  254. navigationView.push("qrc:/example/qml/page/T_Awesome.qml")
  255. }
  256. }
  257. }
  258. FluPaneItemExpander{
  259. title:lang.media
  260. icon:FluentIcons.Media
  261. FluPaneItem{
  262. title:"MediaPlayer"
  263. image:"qrc:/example/res/image/control/MediaPlayerElement.png"
  264. recentlyAdded:true
  265. order:0
  266. desc:"A control to display video and image content."
  267. onTap:{
  268. navigationView.push("qrc:/example/qml/page/T_MediaPlayer.qml")
  269. }
  270. }
  271. }
  272. function getRecentlyAddedData(){
  273. var arr = []
  274. for(var i=0;i<children.length;i++){
  275. var item = children[i]
  276. if(item instanceof FluPaneItem && item.recentlyAdded){
  277. arr.push(item)
  278. }
  279. if(item instanceof FluPaneItemExpander){
  280. for(var j=0;j<item.children.length;j++){
  281. var itemChild = item.children[j]
  282. if(itemChild instanceof FluPaneItem && itemChild.recentlyAdded){
  283. arr.push(itemChild)
  284. }
  285. }
  286. }
  287. }
  288. arr.sort(function(o1,o2){ return o2.order-o1.order })
  289. return arr
  290. }
  291. function getRecentlyUpdatedData(){
  292. var arr = []
  293. var items = navigationView.getItems();
  294. for(var i=0;i<items.length;i++){
  295. var item = items[i]
  296. if(item instanceof FluPaneItem && item.recentlyUpdated){
  297. arr.push(item)
  298. }
  299. }
  300. return arr
  301. }
  302. function getSearchData(){
  303. var arr = []
  304. var items = navigationView.getItems();
  305. for(var i=0;i<items.length;i++){
  306. var item = items[i]
  307. if(item instanceof FluPaneItem){
  308. arr.push({title:item.title,key:item.key})
  309. }
  310. }
  311. return arr
  312. }
  313. function startPageByItem(data){
  314. navigationView.startPageByItem(data)
  315. }
  316. }