-
Notifications
You must be signed in to change notification settings - Fork 504
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
08457dc
commit 206669e
Showing
9 changed files
with
193 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import QtQuick | ||
import QtQuick.Controls | ||
import QtQuick.Layouts | ||
import QtQuick.Window | ||
import FluentUI | ||
|
||
FluScrollablePage{ | ||
|
||
title:"Pivot" | ||
leftPadding:10 | ||
rightPadding:10 | ||
bottomPadding:20 | ||
|
||
|
||
FluArea{ | ||
Layout.fillWidth: true | ||
Layout.topMargin: 20 | ||
height: 400 | ||
paddings: 10 | ||
|
||
FluPivot{ | ||
anchors.fill: parent | ||
FluPivotItem{ | ||
title:"All" | ||
contentItem:FluText{ | ||
text:"All emails go here." | ||
} | ||
} | ||
FluPivotItem{ | ||
title:"Unread" | ||
contentItem:FluText{ | ||
text:"Unread emails go here." | ||
} | ||
} | ||
FluPivotItem{ | ||
title:"Flagged" | ||
contentItem:FluText{ | ||
text:"Flagged emails go here." | ||
} | ||
} | ||
FluPivotItem{ | ||
title:"Urgent" | ||
contentItem:FluText{ | ||
text:"Urgent emails go here." | ||
} | ||
} | ||
} | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
import QtQuick | ||
import QtQuick.Controls | ||
import FluentUI | ||
|
||
Item { | ||
|
||
|
||
id:control | ||
default property alias content: d.children | ||
property color normalColor: FluTheme.dark ? FluColors.Grey120 : FluColors.Grey120 | ||
property color hoverColor: FluTheme.dark ? FluColors.Grey10 : FluColors.Black | ||
|
||
|
||
width: 400 | ||
height: 300 | ||
|
||
FluObject{ | ||
id:d | ||
} | ||
|
||
Component.onCompleted: { | ||
for(var i =0 ;i <d.children.length;i++){ | ||
console.debug(d.children[i].title) | ||
} | ||
} | ||
|
||
ListView{ | ||
id:nav_list | ||
height: 40 | ||
width: control.width | ||
model:d.children | ||
clip: true | ||
spacing: 20 | ||
interactive: false | ||
orientation:ListView.Horizontal | ||
highlight: Item{ | ||
clip: true | ||
Rectangle{ | ||
height: 3 | ||
radius: 1.5 | ||
color: FluTheme.primaryColor.dark | ||
width: nav_list.currentItem ? nav_list.currentItem.width : 0 | ||
y:37 | ||
Behavior on width { | ||
NumberAnimation{ | ||
duration: 150 | ||
} | ||
} | ||
} | ||
} | ||
delegate: Button{ | ||
id:item_button | ||
width: item_title.width | ||
height: nav_list.height | ||
background:Item{ | ||
} | ||
contentItem: Item{ | ||
FluText { | ||
id:item_title | ||
fontStyle: FluText.Title | ||
font.bold: false | ||
text: modelData.title | ||
anchors.centerIn: parent | ||
color: { | ||
if(item_button.hovered) | ||
return hoverColor | ||
return normalColor | ||
} | ||
} | ||
transitions: Transition { | ||
NumberAnimation{ | ||
duration: 400; | ||
} | ||
} | ||
} | ||
onClicked: { | ||
nav_list.currentIndex = index | ||
} | ||
} | ||
} | ||
|
||
Item{ | ||
id:container | ||
anchors{ | ||
top: nav_list.bottom | ||
topMargin: 10 | ||
left: parent.left | ||
right: parent.right | ||
bottom: parent.bottom | ||
} | ||
|
||
Repeater{ | ||
model:d.children | ||
Loader{ | ||
property var argument: modelData.argument | ||
anchors.fill: parent | ||
sourceComponent: modelData.contentItem | ||
visible: nav_list.currentIndex === index | ||
} | ||
} | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import QtQuick | ||
import FluentUI | ||
|
||
QtObject { | ||
property string title | ||
property Component contentItem | ||
property var argument | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters