main
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") nav_view.push("qrc:/T_Progress.qml")
} }
} }
FluPaneItem{ FluPaneItem{
title:"Rectangle" title:"Rectangle"
onTap:{ onTap:{
nav_view.push("qrc:/T_Rectangle.qml") nav_view.push("qrc:/T_Rectangle.qml")
} }
} }
FluPaneItem{
title:"Carousel"
onTap:{
nav_view.push("qrc:/T_Carousel.qml")
}
}
FluPaneItem{ FluPaneItem{
title:"Expander" title:"Expander"
onTap:{ onTap:{

View File

@ -1,8 +1,6 @@
<RCC> <RCC>
<qresource prefix="/"> <qresource prefix="/">
<file>App.qml</file> <file>App.qml</file>
<file>res/image/image_huoyin.webp</file> <file>res/image/image_huoyin.webp</file>
<file>res/svg/avatar_1.svg</file> <file>res/svg/avatar_1.svg</file>
<file>res/svg/avatar_2.svg</file> <file>res/svg/avatar_2.svg</file>
@ -16,12 +14,10 @@
<file>res/svg/avatar_10.svg</file> <file>res/svg/avatar_10.svg</file>
<file>res/svg/avatar_11.svg</file> <file>res/svg/avatar_11.svg</file>
<file>res/svg/avatar_12.svg</file> <file>res/svg/avatar_12.svg</file>
<file>page/AboutPage.qml</file> <file>page/AboutPage.qml</file>
<file>page/MainPage.qml</file> <file>page/MainPage.qml</file>
<file>page/LoginPage.qml</file> <file>page/LoginPage.qml</file>
<file>T_ToggleSwitch.qml</file>
<file>T_ToggleSwitch.qml</file>
<file>T_Typography.qml</file> <file>T_Typography.qml</file>
<file>T_Awesome.qml</file> <file>T_Awesome.qml</file>
<file>T_Buttons.qml</file> <file>T_Buttons.qml</file>
@ -38,5 +34,6 @@
<file>T_DatePicker.qml</file> <file>T_DatePicker.qml</file>
<file>T_MultiWindow.qml</file> <file>T_MultiWindow.qml</file>
<file>T_Menu.qml</file> <file>T_Menu.qml</file>
<file>T_Carousel.qml</file>
</qresource> </qresource>
</RCC> </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/FluDatePicker.qml"),uri,major,minor,"FluDatePicker");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluTimePicker.qml"),uri,major,minor,"FluTimePicker"); 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/FluAutoSuggestBox.qml"),uri,major,minor,"FluAutoSuggestBox");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluExpander.qml"),uri,major,minor,"FluExpander"); 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; QFont font;
font.setFamily("Microsoft YaHei"); font.setFamily("Microsoft YaHei");
QGuiApplication::setFont(font); QGuiApplication::setFont(font);
// QQuickWindow::setTextRenderType(QQuickWindow::NativeTextRendering); // QQuickWindow::setTextRenderType(QQuickWindow::NativeTextRendering);
#endif #endif
QFontDatabase::addApplicationFont(":/com.zhuzichu/res/font/Segoe_Fluent_Icons.ttf"); QFontDatabase::addApplicationFont(":/com.zhuzichu/res/font/Segoe_Fluent_Icons.ttf");
FluApp* app = FluApp::getInstance(); FluApp* app = FluApp::getInstance();

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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