This commit is contained in:
zhuzihcu 2023-03-14 18:23:12 +08:00
parent ee3ddf7732
commit 51a206e583
12 changed files with 54 additions and 19 deletions

15
example/T_Carousel.qml Normal file
View File

@ -0,0 +1,15 @@
import QtQuick 2.15
import QtQuick.Layouts 1.15
import QtQuick.Window 2.15
import QtQuick.Controls 2.15
import QtGraphicalEffects 1.15
import FluentUI 1.0
FluScrollablePage{
title:"Carousel"
FluCarousel{
}
}

View File

@ -97,12 +97,22 @@ FluWindow {
nav_view.push("qrc:/T_Progress.qml")
}
}
FluPaneItem{
title:"Rectangle"
onTap:{
nav_view.push("qrc:/T_Rectangle.qml")
}
}
FluPaneItem{
title:"Carousel"
onTap:{
nav_view.push("qrc:/T_Carousel.qml")
}
}
FluPaneItem{
title:"Expander"
onTap:{

View File

@ -1,8 +1,6 @@
<RCC>
<qresource prefix="/">
<file>App.qml</file>
<file>res/image/image_huoyin.webp</file>
<file>res/svg/avatar_1.svg</file>
<file>res/svg/avatar_2.svg</file>
@ -16,11 +14,9 @@
<file>res/svg/avatar_10.svg</file>
<file>res/svg/avatar_11.svg</file>
<file>res/svg/avatar_12.svg</file>
<file>page/AboutPage.qml</file>
<file>page/MainPage.qml</file>
<file>page/LoginPage.qml</file>
<file>T_ToggleSwitch.qml</file>
<file>T_Typography.qml</file>
<file>T_Awesome.qml</file>
@ -38,5 +34,6 @@
<file>T_DatePicker.qml</file>
<file>T_MultiWindow.qml</file>
<file>T_Menu.qml</file>
<file>T_Carousel.qml</file>
</qresource>
</RCC>

View File

@ -47,6 +47,7 @@ void Fluent::registerTypes(const char *uri){
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluDatePicker.qml"),uri,major,minor,"FluDatePicker");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluTimePicker.qml"),uri,major,minor,"FluTimePicker");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluCarousel.qml"),uri,major,minor,"FluCarousel");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluAutoSuggestBox.qml"),uri,major,minor,"FluAutoSuggestBox");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluExpander.qml"),uri,major,minor,"FluExpander");
@ -91,7 +92,7 @@ void Fluent::initializeEngine(QQmlEngine *engine, const char *uri)
QFont font;
font.setFamily("Microsoft YaHei");
QGuiApplication::setFont(font);
// QQuickWindow::setTextRenderType(QQuickWindow::NativeTextRendering);
// QQuickWindow::setTextRenderType(QQuickWindow::NativeTextRendering);
#endif
QFontDatabase::addApplicationFont(":/com.zhuzichu/res/font/Segoe_Fluent_Icons.ttf");
FluApp* app = FluApp::getInstance();

View File

@ -152,6 +152,7 @@ TextField{
boundsBehavior: ListView.StopAtBounds
clip: true
currentIndex: -1
ScrollBar.vertical: FluScrollBar {}
header: Item{
width: input.width
height: visible ? 38 : 0
@ -165,7 +166,6 @@ TextField{
}
}
}
ScrollBar.vertical: ScrollBar { }
delegate:Control{
width: input.width
padding:10

View File

@ -0,0 +1,7 @@
import QtQuick 2.15
Item {
}

View File

@ -202,7 +202,7 @@ Rectangle {
width: 100
height: parent.height
boundsBehavior:Flickable.StopAtBounds
ScrollBar.vertical: ScrollBar { }
ScrollBar.vertical: FluScrollBar {}
model: generateYearArray(1924,2048)
clip: true
visible: showYear
@ -228,7 +228,7 @@ Rectangle {
width: showYear ? 100 : 150
height: parent.height
clip: true
ScrollBar.vertical: ScrollBar { }
ScrollBar.vertical: FluScrollBar {}
boundsBehavior:Flickable.StopAtBounds
delegate: Loader{
property var model: modelData
@ -252,7 +252,7 @@ Rectangle {
width: showYear ? 100 : 150
height: parent.height
clip: true
ScrollBar.vertical: ScrollBar { }
ScrollBar.vertical: FluScrollBar {}
Layout.alignment: Qt.AlignVCenter
boundsBehavior:Flickable.StopAtBounds
delegate: Loader{

View File

@ -135,12 +135,11 @@ Item {
}
}
Item {
id:nav_app_bar
width: parent.width
height: 38
z:999
RowLayout{
height:parent.height
spacing: 0
@ -232,7 +231,7 @@ Item {
id:layout_list
width: 300
anchors{
top: nav_app_bar.bottom
top: parent.top
bottom: parent.bottom
}
x: {
@ -264,6 +263,7 @@ Item {
Item{
id:layout_header
width: layout_list.width
y:nav_app_bar.height
height: 50
FluAutoSuggestBox{
@ -322,6 +322,8 @@ Item {
stackIndex.push(currentIndex)
}
}
ScrollBar.vertical: FluScrollBar {}
model:{
if(items){
return items.children

View File

@ -17,10 +17,12 @@ Item {
fontStyle: FluText.TitleLarge
}
ScrollView{
Flickable{
clip: true
width: parent.width
contentWidth: parent.width
contentHeight: container.height
ScrollBar.vertical: ScrollBar { }
anchors{
top: text_title.bottom
bottom: parent.bottom

View File

@ -201,7 +201,7 @@ Rectangle {
width: isH ? 100 : 150
height: parent.height
boundsBehavior:Flickable.StopAtBounds
ScrollBar.vertical: ScrollBar { }
ScrollBar.vertical: FluScrollBar {}
model: isH ? generateArray(1,12) : generateArray(0,23)
clip: true
delegate: Loader{
@ -225,7 +225,7 @@ Rectangle {
height: parent.height
model: generateArray(0,59)
clip: true
ScrollBar.vertical: ScrollBar { }
ScrollBar.vertical: FluScrollBar {}
boundsBehavior:Flickable.StopAtBounds
delegate: Loader{
property var model: modelData
@ -250,7 +250,7 @@ Rectangle {
model: ["上午","下午"]
clip: true
visible: isH
ScrollBar.vertical: ScrollBar { }
ScrollBar.vertical: FluScrollBar {}
Layout.alignment: Qt.AlignVCenter
boundsBehavior:Flickable.StopAtBounds
delegate: Loader{

View File

@ -276,8 +276,8 @@ Item {
model: tree_model
flickableDirection: Flickable.HorizontalAndVerticalFlick
clip: true
ScrollBar.vertical: ScrollBar { }
ScrollBar.horizontal: ScrollBar { }
ScrollBar.vertical: FluScrollBar {}
ScrollBar.horizontal: FluScrollBar { }
}
function updateData(items){

View File

@ -47,5 +47,6 @@
<file>controls/FluCalenderView.qml</file>
<file>controls/FluCalendarDatePicker.qml</file>
<file>controls/FluFocusRectangle.qml</file>
<file>controls/FluCarousel.qml</file>
</qresource>
</RCC>