mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2024-11-30 07:03:46 +08:00
update
This commit is contained in:
parent
cf730bc769
commit
221361369e
@ -76,44 +76,110 @@ CustomWindow {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FluAppBar {
|
Flipable{
|
||||||
id: title_bar
|
id:flipable
|
||||||
anchors {
|
anchors.fill: parent
|
||||||
top: parent.top
|
property bool flipped: false
|
||||||
left: parent.left
|
transform: Rotation {
|
||||||
right: parent.right
|
id: rotation
|
||||||
}
|
origin.x: flipable.width/2
|
||||||
darkText: lang.dark_mode
|
origin.y: flipable.height/2
|
||||||
showDark: true
|
axis { x: 0; y: 1; z: 0 }
|
||||||
z:7
|
angle: 0
|
||||||
}
|
|
||||||
|
|
||||||
FluNavigationView{
|
|
||||||
id:nav_view
|
|
||||||
width: parent.width
|
|
||||||
height: parent.height
|
|
||||||
z:999
|
|
||||||
items: ItemsOriginal
|
|
||||||
footerItems:ItemsFooter
|
|
||||||
topPadding:FluTools.isMacos() ? 20 : 5
|
|
||||||
displayMode:MainEvent.displayMode
|
|
||||||
logo: "qrc:/example/res/image/favicon.ico"
|
|
||||||
title:"FluentUI"
|
|
||||||
autoSuggestBox:FluAutoSuggestBox{
|
|
||||||
width: 280
|
|
||||||
anchors.centerIn: parent
|
|
||||||
iconSource: FluentIcons.Search
|
|
||||||
items: ItemsOriginal.getSearchData()
|
|
||||||
placeholderText: lang.search
|
|
||||||
onItemClicked:
|
|
||||||
(data)=>{
|
|
||||||
ItemsOriginal.startPageByItem(data)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Component.onCompleted: {
|
states: State {
|
||||||
ItemsOriginal.navigationView = nav_view
|
name: "back"
|
||||||
ItemsFooter.navigationView = nav_view
|
PropertyChanges { target: rotation; angle: 180 }
|
||||||
setCurrentIndex(0)
|
when: flipable.flipped
|
||||||
|
}
|
||||||
|
transitions: Transition {
|
||||||
|
NumberAnimation { target: rotation; property: "angle"; duration: 1000 ; easing.type: Easing.OutQuad}
|
||||||
|
}
|
||||||
|
back: Item{
|
||||||
|
anchors.fill: flipable
|
||||||
|
visible: rotation.angle !== 0
|
||||||
|
FluAppBar {
|
||||||
|
anchors {
|
||||||
|
top: parent.top
|
||||||
|
left: parent.left
|
||||||
|
right: parent.right
|
||||||
|
}
|
||||||
|
darkText: lang.dark_mode
|
||||||
|
showDark: true
|
||||||
|
z:7
|
||||||
|
}
|
||||||
|
FluIconButton{
|
||||||
|
iconSource: FluentIcons.ChromeBack
|
||||||
|
width: 30
|
||||||
|
height: 30
|
||||||
|
iconSize: 13
|
||||||
|
z:8
|
||||||
|
onClicked: {
|
||||||
|
flipable.flipped = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluText{
|
||||||
|
font: FluTextStyle.Title
|
||||||
|
text:"建设中..."
|
||||||
|
anchors.centerIn: parent
|
||||||
|
}
|
||||||
|
}
|
||||||
|
front: Item{
|
||||||
|
visible: rotation.angle !== 180
|
||||||
|
anchors.fill: flipable
|
||||||
|
FluAppBar {
|
||||||
|
anchors {
|
||||||
|
top: parent.top
|
||||||
|
left: parent.left
|
||||||
|
right: parent.right
|
||||||
|
}
|
||||||
|
darkText: lang.dark_mode
|
||||||
|
showDark: true
|
||||||
|
z:7
|
||||||
|
}
|
||||||
|
FluNavigationView{
|
||||||
|
property int clickCount: 0
|
||||||
|
id:nav_view
|
||||||
|
width: parent.width
|
||||||
|
height: parent.height
|
||||||
|
z:999
|
||||||
|
items: ItemsOriginal
|
||||||
|
footerItems:ItemsFooter
|
||||||
|
topPadding:FluTools.isMacos() ? 20 : 5
|
||||||
|
displayMode:MainEvent.displayMode
|
||||||
|
logo: "qrc:/example/res/image/favicon.ico"
|
||||||
|
title:"FluentUI"
|
||||||
|
Behavior on rotation {
|
||||||
|
NumberAnimation{
|
||||||
|
duration: 167
|
||||||
|
}
|
||||||
|
}
|
||||||
|
transformOrigin: Item.Center
|
||||||
|
onLoginClicked:{
|
||||||
|
clickCount += 1
|
||||||
|
if(clickCount === 5){
|
||||||
|
flipable.flipped = true
|
||||||
|
clickCount = 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
autoSuggestBox:FluAutoSuggestBox{
|
||||||
|
width: 280
|
||||||
|
anchors.centerIn: parent
|
||||||
|
iconSource: FluentIcons.Search
|
||||||
|
items: ItemsOriginal.getSearchData()
|
||||||
|
placeholderText: lang.search
|
||||||
|
onItemClicked:
|
||||||
|
(data)=>{
|
||||||
|
ItemsOriginal.startPageByItem(data)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Component.onCompleted: {
|
||||||
|
ItemsOriginal.navigationView = nav_view
|
||||||
|
ItemsFooter.navigationView = nav_view
|
||||||
|
setCurrentIndex(0)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,16 +16,6 @@ Rectangle {
|
|||||||
border.width: 1
|
border.width: 1
|
||||||
implicitHeight: height
|
implicitHeight: height
|
||||||
implicitWidth: width
|
implicitWidth: width
|
||||||
Behavior on color{
|
|
||||||
ColorAnimation {
|
|
||||||
duration: 300
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Behavior on border.color{
|
|
||||||
ColorAnimation {
|
|
||||||
duration: 300
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Item {
|
Item {
|
||||||
id: container
|
id: container
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
@ -24,13 +24,15 @@ Button {
|
|||||||
}
|
}
|
||||||
id:control
|
id:control
|
||||||
enabled: !disabled
|
enabled: !disabled
|
||||||
padding:0
|
|
||||||
onClicked: clickListener()
|
onClicked: clickListener()
|
||||||
background: Item{
|
background: Item{
|
||||||
FluFocusRectangle{
|
FluFocusRectangle{
|
||||||
|
radius: 4
|
||||||
visible: control.activeFocus
|
visible: control.activeFocus
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
horizontalPadding:2
|
||||||
|
verticalPadding: 2
|
||||||
Accessible.role: Accessible.Button
|
Accessible.role: Accessible.Button
|
||||||
Accessible.name: control.text
|
Accessible.name: control.text
|
||||||
Accessible.description: contentDescription
|
Accessible.description: contentDescription
|
||||||
|
@ -20,16 +20,6 @@ Item {
|
|||||||
radius: 4
|
radius: 4
|
||||||
color: FluTheme.dark ? Window.active ? Qt.rgba(38/255,44/255,54/255,1) : Qt.rgba(39/255,39/255,39/255,1) : Qt.rgba(251/255,251/255,253/255,1)
|
color: FluTheme.dark ? Window.active ? Qt.rgba(38/255,44/255,54/255,1) : Qt.rgba(39/255,39/255,39/255,1) : Qt.rgba(251/255,251/255,253/255,1)
|
||||||
border.color: FluTheme.dark ? Window.active ? Qt.rgba(55/255,55/255,55/255,1) : Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(226/255,229/255,234/255,1)
|
border.color: FluTheme.dark ? Window.active ? Qt.rgba(55/255,55/255,55/255,1) : Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(226/255,229/255,234/255,1)
|
||||||
Behavior on color{
|
|
||||||
ColorAnimation {
|
|
||||||
duration: 300
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Behavior on border.color{
|
|
||||||
ColorAnimation {
|
|
||||||
duration: 300
|
|
||||||
}
|
|
||||||
}
|
|
||||||
MouseArea{
|
MouseArea{
|
||||||
id:control_mouse
|
id:control_mouse
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
@ -25,6 +25,7 @@ Item {
|
|||||||
property Component autoSuggestBox
|
property Component autoSuggestBox
|
||||||
property Component actionItem
|
property Component actionItem
|
||||||
property int topPadding: 0
|
property int topPadding: 0
|
||||||
|
signal loginClicked
|
||||||
id:control
|
id:control
|
||||||
QtObject{
|
QtObject{
|
||||||
id:d
|
id:d
|
||||||
@ -514,6 +515,12 @@ Item {
|
|||||||
}
|
}
|
||||||
sourceSize: Qt.size(40,40)
|
sourceSize: Qt.size(40,40)
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
|
MouseArea{
|
||||||
|
anchors.fill: parent
|
||||||
|
onClicked: {
|
||||||
|
loginClicked()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
FluText{
|
FluText{
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
|
@ -22,7 +22,8 @@ Button {
|
|||||||
Accessible.onPressAction: control.clicked()
|
Accessible.onPressAction: control.clicked()
|
||||||
id:control
|
id:control
|
||||||
enabled: !disabled
|
enabled: !disabled
|
||||||
padding:0
|
horizontalPadding:2
|
||||||
|
verticalPadding: 2
|
||||||
background: Item{
|
background: Item{
|
||||||
FluFocusRectangle{
|
FluFocusRectangle{
|
||||||
visible: control.activeFocus
|
visible: control.activeFocus
|
||||||
|
Loading…
Reference in New Issue
Block a user