mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2025-07-02 16:15:28 +08:00
update
This commit is contained in:
@ -8,6 +8,13 @@ Window {
|
||||
id: app
|
||||
flags: Qt.SplashScreen
|
||||
|
||||
Connections{
|
||||
target: FluTheme
|
||||
function onDarkModeChanged(){
|
||||
SettingsHelper.saveDarkMode(FluTheme.darkMode)
|
||||
}
|
||||
}
|
||||
|
||||
FluHttpInterceptor{
|
||||
id:interceptor
|
||||
function onIntercept(request){
|
||||
@ -26,7 +33,7 @@ Window {
|
||||
|
||||
Component.onCompleted: {
|
||||
FluApp.init(app)
|
||||
FluTheme.darkMode = FluThemeType.System
|
||||
FluTheme.darkMode = SettingsHelper.getDarkMode()
|
||||
FluTheme.enableAnimation = true
|
||||
FluApp.routes = {
|
||||
"/":"qrc:/example/qml/window/MainWindow.qml",
|
||||
|
@ -80,7 +80,6 @@ FluExpander{
|
||||
"FluIcon",
|
||||
"FluIconButton",
|
||||
"FluInfoBar",
|
||||
"FluItem",
|
||||
"FluMediaPlayer",
|
||||
"FluMenu",
|
||||
"FluMenuItem",
|
||||
|
@ -477,6 +477,9 @@ FluObject{
|
||||
}
|
||||
|
||||
function getSearchData(){
|
||||
if(!navigationView){
|
||||
return
|
||||
}
|
||||
var arr = []
|
||||
var items = navigationView.getItems();
|
||||
for(var i=0;i<items.length;i++){
|
||||
|
@ -48,7 +48,7 @@ FluScrollablePage{
|
||||
height: 1200/4+20
|
||||
paddings: 10
|
||||
Layout.topMargin: 10
|
||||
FluRectangle{
|
||||
FluClip{
|
||||
width: 1920/4
|
||||
height: 1200/4
|
||||
radius:[8,8,8,8]
|
||||
|
@ -45,7 +45,6 @@ FluScrollablePage{
|
||||
}
|
||||
FluCarousel{
|
||||
anchors.fill: parent
|
||||
radius:[8,8,8,8]
|
||||
delegate: Component{
|
||||
Image {
|
||||
anchors.fill: parent
|
||||
@ -83,7 +82,6 @@ FluScrollablePage{
|
||||
}
|
||||
FluCarousel{
|
||||
anchors.fill: parent
|
||||
radius:[8,8,8,8]
|
||||
loopTime:1500
|
||||
indicatorGravity: Qt.AlignHCenter | Qt.AlignTop
|
||||
indicatorMarginTop:15
|
||||
|
@ -2,6 +2,7 @@ import QtQuick 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import QtQuick.Window 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtGraphicalEffects 1.0
|
||||
import "qrc:///example/qml/global"
|
||||
import FluentUI 1.0
|
||||
|
||||
@ -50,23 +51,9 @@ FluScrollablePage{
|
||||
}
|
||||
}
|
||||
|
||||
ListView{
|
||||
id: list
|
||||
anchors{
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
bottom: parent.bottom
|
||||
}
|
||||
orientation: ListView.Horizontal
|
||||
height: 240
|
||||
model: model_header
|
||||
header: Item{height: 10;width: 10}
|
||||
footer: Item{height: 10;width: 10}
|
||||
ScrollBar.horizontal: FluScrollBar{
|
||||
id: scrollbar_header
|
||||
}
|
||||
clip: false
|
||||
delegate:Item{
|
||||
Component{
|
||||
id:com_grallery
|
||||
Item{
|
||||
id: control
|
||||
width: 220
|
||||
height: 240
|
||||
@ -74,7 +61,7 @@ FluScrollablePage{
|
||||
radius:5
|
||||
anchors.fill: item_content
|
||||
}
|
||||
FluItem{
|
||||
FluClip{
|
||||
id:item_content
|
||||
radius: [5,5,5,5]
|
||||
width: 200
|
||||
@ -91,19 +78,14 @@ FluScrollablePage{
|
||||
Rectangle{
|
||||
anchors.fill: parent
|
||||
radius: 5
|
||||
color:{
|
||||
if(FluTheme.dark){
|
||||
if(item_mouse.containsMouse){
|
||||
return Qt.rgba(1,1,1,0.03)
|
||||
}
|
||||
return Qt.rgba(0,0,0,0.0)
|
||||
}else{
|
||||
if(item_mouse.containsMouse){
|
||||
return Qt.rgba(0,0,0,0.03)
|
||||
}
|
||||
return Qt.rgba(0,0,0,0.0)
|
||||
}
|
||||
}
|
||||
color:FluTheme.dark ? Qt.rgba(1,1,1,0.03) : Qt.rgba(0,0,0,0.03)
|
||||
visible: item_mouse.containsMouse
|
||||
}
|
||||
Rectangle{
|
||||
anchors.fill: parent
|
||||
radius: 5
|
||||
color:Qt.rgba(0,0,0,0.0)
|
||||
visible: !item_mouse.containsMouse
|
||||
}
|
||||
ColumnLayout{
|
||||
Image {
|
||||
@ -155,11 +137,31 @@ FluScrollablePage{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ListView{
|
||||
id: list
|
||||
anchors{
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
bottom: parent.bottom
|
||||
}
|
||||
orientation: ListView.Horizontal
|
||||
height: 240
|
||||
model: model_header
|
||||
header: Item{height: 10;width: 10}
|
||||
footer: Item{height: 10;width: 10}
|
||||
ScrollBar.horizontal: FluScrollBar{
|
||||
id: scrollbar_header
|
||||
}
|
||||
clip: false
|
||||
delegate: com_grallery
|
||||
}
|
||||
}
|
||||
|
||||
Component{
|
||||
id:com_item
|
||||
Item{
|
||||
property string desc: modelData.desc
|
||||
width: 320
|
||||
height: 120
|
||||
FluArea{
|
||||
@ -195,7 +197,6 @@ FluScrollablePage{
|
||||
verticalCenter: parent.verticalCenter
|
||||
}
|
||||
}
|
||||
|
||||
FluText{
|
||||
id:item_title
|
||||
text:modelData.title
|
||||
@ -206,10 +207,9 @@ FluScrollablePage{
|
||||
top: item_icon.top
|
||||
}
|
||||
}
|
||||
|
||||
FluText{
|
||||
id:item_desc
|
||||
text:modelData.desc
|
||||
text:desc
|
||||
color:FluColors.Grey120
|
||||
wrapMode: Text.WrapAnywhere
|
||||
elide: Text.ElideRight
|
||||
|
@ -24,7 +24,7 @@ FluScrollablePage{
|
||||
FluButton{
|
||||
text:"Info"
|
||||
onClicked: {
|
||||
showInfo("这是一个Info样式的InfoBar",0,"123")
|
||||
showInfo("这是一个Info样式的InfoBar")
|
||||
}
|
||||
}
|
||||
FluButton{
|
||||
|
@ -3,7 +3,6 @@ import QtQuick.Controls 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import QtQuick.Window 2.15
|
||||
import FluentUI 1.0
|
||||
import QtGraphicalEffects 1.15
|
||||
import "qrc:///example/qml/component"
|
||||
import "../component"
|
||||
|
||||
|
@ -69,7 +69,7 @@ FluScrollablePage{
|
||||
}
|
||||
RowLayout{
|
||||
spacing: 14
|
||||
FluRectangle{
|
||||
FluClip{
|
||||
width: 50
|
||||
height: 50
|
||||
radius:[25,0,25,25]
|
||||
@ -80,7 +80,7 @@ FluScrollablePage{
|
||||
sourceSize: Qt.size(width,height)
|
||||
}
|
||||
}
|
||||
FluRectangle{
|
||||
FluClip{
|
||||
width: 50
|
||||
height: 50
|
||||
radius:[10,10,10,10]
|
||||
@ -91,7 +91,7 @@ FluScrollablePage{
|
||||
source: "qrc:/example/res/svg/avatar_2.svg"
|
||||
}
|
||||
}
|
||||
FluRectangle{
|
||||
FluClip{
|
||||
width: 50
|
||||
height: 50
|
||||
radius:[25,25,25,25]
|
||||
@ -102,7 +102,7 @@ FluScrollablePage{
|
||||
source: "qrc:/example/res/svg/avatar_3.svg"
|
||||
}
|
||||
}
|
||||
FluRectangle{
|
||||
FluClip{
|
||||
width: 50
|
||||
height: 50
|
||||
radius:[0,25,25,25]
|
||||
@ -114,7 +114,7 @@ FluScrollablePage{
|
||||
}
|
||||
}
|
||||
}
|
||||
FluRectangle{
|
||||
FluClip{
|
||||
width: 1920/5
|
||||
height: 1200/5
|
||||
radius:[8,8,8,8]
|
||||
|
@ -43,7 +43,7 @@ FluScrollablePage{
|
||||
spacing: 20
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
FluText{
|
||||
text:"当前版本 v%1".arg(appInfo.version)
|
||||
text:"当前版本 v%1".arg(AppInfo.version)
|
||||
font: FluTextStyle.Body
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
@ -59,6 +59,38 @@ FluScrollablePage{
|
||||
}
|
||||
}
|
||||
|
||||
FluArea{
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 20
|
||||
height: 50
|
||||
paddings: 10
|
||||
FluCheckBox{
|
||||
text:"Software Render"
|
||||
checked: SettingsHelper.getReander() === "software"
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
onClicked: {
|
||||
if(SettingsHelper.getReander() === "software"){
|
||||
SettingsHelper.saveRender("")
|
||||
}else{
|
||||
SettingsHelper.saveRender("software")
|
||||
}
|
||||
dialog_render.open()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FluContentDialog{
|
||||
id:dialog_render
|
||||
title:"友情提示"
|
||||
message:"此操作需要重启才能生效,是否重新启动?"
|
||||
buttonFlags: FluContentDialogType.NegativeButton | FluContentDialogType.PositiveButton
|
||||
negativeText: "取消"
|
||||
positiveText:"确定"
|
||||
onPositiveClicked:{
|
||||
window.deleteWindow()
|
||||
AppInfo.restart()
|
||||
}
|
||||
}
|
||||
|
||||
FluArea{
|
||||
Layout.fillWidth: true
|
||||
@ -144,10 +176,10 @@ FluScrollablePage{
|
||||
Repeater{
|
||||
model: ["Zh","En"]
|
||||
delegate: FluRadioButton{
|
||||
checked: appInfo.lang.objectName === modelData
|
||||
checked: AppInfo.lang.objectName === modelData
|
||||
text:modelData
|
||||
clickListener:function(){
|
||||
appInfo.changeLang(modelData)
|
||||
AppInfo.changeLang(modelData)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -11,9 +11,9 @@ FluScrollablePage {
|
||||
title:"TreeView"
|
||||
|
||||
function treeData(){
|
||||
const dig = (path = '0', level = 4) => {
|
||||
const dig = (path = '0', level = 3) => {
|
||||
const list = [];
|
||||
for (let i = 0; i < 10; i += 1) {
|
||||
for (let i = 0; i < 8; i += 1) {
|
||||
const key = `${path}-${i}`;
|
||||
const treeNode = {
|
||||
title: key,
|
||||
@ -49,7 +49,7 @@ FluScrollablePage {
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 10
|
||||
paddings: 10
|
||||
height: 400
|
||||
height: 420
|
||||
Item{
|
||||
anchors.fill: tree_view
|
||||
FluShadow{}
|
||||
@ -62,6 +62,7 @@ FluScrollablePage {
|
||||
left:parent.left
|
||||
bottom:parent.bottom
|
||||
}
|
||||
draggable:switch_draggable.checked
|
||||
showLine: switch_showline.checked
|
||||
Component.onCompleted: {
|
||||
var data = treeData()
|
||||
@ -69,6 +70,7 @@ FluScrollablePage {
|
||||
}
|
||||
}
|
||||
Column{
|
||||
spacing: 15
|
||||
anchors{
|
||||
top:parent.top
|
||||
topMargin: 10
|
||||
@ -87,7 +89,7 @@ FluScrollablePage {
|
||||
id:slider_width
|
||||
value: 200
|
||||
from: 160
|
||||
to:320
|
||||
to:460
|
||||
}
|
||||
}
|
||||
|
||||
@ -96,6 +98,12 @@ FluScrollablePage {
|
||||
text:"showLine"
|
||||
checked: true
|
||||
}
|
||||
|
||||
FluToggleSwitch{
|
||||
id:switch_draggable
|
||||
text:"draggable"
|
||||
checked: false
|
||||
}
|
||||
}
|
||||
}
|
||||
CodeExpander{
|
||||
|
@ -36,7 +36,7 @@ CustomWindow {
|
||||
}
|
||||
}
|
||||
FluText{
|
||||
text:"v%1".arg(appInfo.version)
|
||||
text:"v%1".arg(AppInfo.version)
|
||||
font: FluTextStyle.Body
|
||||
Layout.alignment: Qt.AlignBottom
|
||||
}
|
||||
|
@ -321,7 +321,7 @@ CustomWindow {
|
||||
property string body
|
||||
id:dialog_update
|
||||
title:"升级提示"
|
||||
message:"FluentUI目前最新版本 "+ newVerson +" -- 当前应用版本 "+appInfo.version+" \n现在是否去下载新版本?\n\n更新内容:\n"+body
|
||||
message:"FluentUI目前最新版本 "+ newVerson +" -- 当前应用版本 "+AppInfo.version+" \n现在是否去下载新版本?\n\n更新内容:\n"+body
|
||||
buttonFlags: FluContentDialogType.NegativeButton | FluContentDialogType.PositiveButton
|
||||
negativeText: "取消"
|
||||
positiveText:"确定"
|
||||
@ -343,9 +343,9 @@ CustomWindow {
|
||||
onSuccess:
|
||||
(result)=>{
|
||||
var data = JSON.parse(result)
|
||||
console.debug("current version "+appInfo.version)
|
||||
console.debug("current version "+AppInfo.version)
|
||||
console.debug("new version "+data.tag_name)
|
||||
if(data.tag_name !== appInfo.version){
|
||||
if(data.tag_name !== AppInfo.version){
|
||||
dialog_update.newVerson = data.tag_name
|
||||
dialog_update.body = data.body
|
||||
dialog_update.open()
|
||||
|
Reference in New Issue
Block a user