O_Settings.qml 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. import QtQuick
  2. import QtQuick.Layouts
  3. import QtQuick.Window
  4. import QtQuick.Controls
  5. import FluentUI
  6. import "../Global/"
  7. FluScrollablePage{
  8. leftPadding:10
  9. rightPadding:10
  10. bottomPadding:20
  11. spacing: 0
  12. property string configName: ""
  13. FluArea{
  14. Layout.fillWidth: true
  15. Layout.topMargin: 0
  16. height: 136
  17. paddings: 10
  18. ColumnLayout{
  19. spacing: 10
  20. anchors{
  21. top: parent.top
  22. left: parent.left
  23. }
  24. FluText{
  25. text: qsTr("Dark Mode")
  26. font: FluTextStyle.BodyStrong
  27. Layout.bottomMargin: 4
  28. }
  29. Repeater{
  30. model: [{title:qsTr("System"),mode:FluDarkMode.System},{title:qsTr("Light"),mode:FluDarkMode.Light},{title:qsTr("Dark"),mode:FluDarkMode.Dark}]
  31. delegate: FluRadioButton{
  32. selected : MainEvent.darkMode === modelData.mode
  33. text:modelData.title
  34. onClicked:{
  35. MainEvent.darkMode = modelData.mode
  36. }
  37. }
  38. }
  39. }
  40. }
  41. FluArea{
  42. Layout.fillWidth: true
  43. Layout.topMargin: 20
  44. height: 168
  45. paddings: 10
  46. ColumnLayout{
  47. spacing: 10
  48. anchors{
  49. top: parent.top
  50. left: parent.left
  51. }
  52. FluText{
  53. text: qsTr("navigation_view_display_mode")
  54. font: FluTextStyle.BodyStrong
  55. Layout.bottomMargin: 4
  56. }
  57. Repeater{
  58. model: [{title:qsTr("Open"),mode:FluNavigationView.Open},{title:qsTr("Compact"),mode:FluNavigationView.Compact},{title:qsTr("Minimal"),mode:FluNavigationView.Minimal},{title:qsTr("Auto"),mode:FluNavigationView.Auto}]
  59. delegate: FluRadioButton{
  60. selected : MainEvent.displayMode===modelData.mode
  61. text:modelData.title
  62. onClicked:{
  63. MainEvent.displayMode = modelData.mode
  64. }
  65. }
  66. }
  67. }
  68. }
  69. FluArea{
  70. Layout.fillWidth: true
  71. Layout.topMargin: 20
  72. height: 160
  73. paddings: 10
  74. ColumnLayout{
  75. spacing:0
  76. anchors{
  77. left: parent.left
  78. }
  79. FluText{
  80. text: qsTr("Theme color")
  81. font: FluTextStyle.BodyStrong
  82. Layout.bottomMargin: 4
  83. }
  84. RowLayout{
  85. Layout.topMargin: 10
  86. Repeater{
  87. model: [FluColors.Yellow,FluColors.Orange,FluColors.Red,FluColors.Magenta,FluColors.Purple,FluColors.Blue,FluColors.Teal,FluColors.Green]
  88. delegate: FluRectangle{
  89. width: 42
  90. height: 42
  91. radius: [4,4,4,4]
  92. color: mouse_item.containsMouse ? Qt.lighter(modelData.normal,1.1) : modelData.normal
  93. FluIcon {
  94. anchors.centerIn: parent
  95. iconSource: FluentIcons.AcceptMedium
  96. iconSize: 15
  97. visible: modelData === FluTheme.primaryColor
  98. color: FluTheme.dark ? Qt.rgba(0,0,0,1) : Qt.rgba(1,1,1,1)
  99. }
  100. MouseArea{
  101. id:mouse_item
  102. anchors.fill: parent
  103. hoverEnabled: true
  104. onClicked: {
  105. MainEvent.primaryColor = modelData
  106. }
  107. }
  108. }
  109. }
  110. }
  111. FluText{
  112. text:qsTr("Native text rendering")
  113. font: FluTextStyle.BodyStrong
  114. Layout.topMargin: 20
  115. }
  116. FluToggleSwitch{
  117. Layout.topMargin: 5
  118. selected: MainEvent.nativeText
  119. clickFunc:function(){
  120. MainEvent.nativeText = !MainEvent.nativeText
  121. }
  122. }
  123. }
  124. }
  125. FluArea{
  126. Layout.fillWidth: true
  127. Layout.topMargin: 20
  128. height: 80
  129. paddings: 10
  130. ColumnLayout{
  131. spacing: 10
  132. anchors{
  133. top: parent.top
  134. left: parent.left
  135. }
  136. FluText{
  137. text:qsTr("Locale")
  138. font: FluTextStyle.BodyStrong
  139. Layout.bottomMargin: 4
  140. }
  141. Flow{
  142. spacing: 5
  143. Repeater{
  144. model: ["简体中文","English"]
  145. delegate: FluRadioButton{
  146. selected : MainEvent.language === modelData
  147. text:modelData
  148. onClicked:{
  149. MainEvent.language = modelData
  150. }
  151. }
  152. }
  153. }
  154. }
  155. }
  156. FluArea{
  157. Layout.fillWidth: true
  158. Layout.topMargin: 20
  159. height: 200
  160. paddings: 10
  161. ColumnLayout{
  162. spacing: 10
  163. anchors{
  164. top: parent.top
  165. left: parent.left
  166. }
  167. FluText{
  168. text: qsTr("Dpi Strategy")
  169. font: FluTextStyle.BodyStrong
  170. Layout.bottomMargin: 4
  171. }
  172. Repeater{
  173. model: [{title:qsTr("default"),mode:"default"}, // 默认不缩放
  174. {title:qsTr("floor"),mode:"floor"}, // 始终不缩放
  175. {title:qsTr("ceil"),mode:"ceil"}, // 始终缩放
  176. {title:qsTr("round"),mode:"round"}, // 设备像素比0.5及以上的,进行缩放
  177. {title:qsTr("round_prefer_floor"),mode:"round_prefer_floor"} // 设备像素比0.75及以上的,进行缩放
  178. ]
  179. delegate: FluRadioButton{
  180. selected : MainEvent.dpiStrategy===modelData.mode
  181. text:modelData.title
  182. onClicked:{
  183. MainEvent.dpiStrategy = modelData.mode
  184. }
  185. }
  186. }
  187. }
  188. }
  189. }