mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2025-07-05 17:55:25 +08:00
Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
0b37ddcb6e | |||
d2e3e6dd4b | |||
1e5bd75123 | |||
1b97b197a4 | |||
936a310ca6 | |||
3236be8a7f |
2
.github/workflows/macos.yml
vendored
2
.github/workflows/macos.yml
vendored
@ -35,7 +35,7 @@ jobs:
|
|||||||
version: ${{ matrix.qt_ver }}
|
version: ${{ matrix.qt_ver }}
|
||||||
cached: 'false'
|
cached: 'false'
|
||||||
arch: ${{ matrix.qt_arch }}
|
arch: ${{ matrix.qt_arch }}
|
||||||
modules: 'qt5compat qtmultimedia qtshadertools'
|
modules: 'qt5compat qtmultimedia qtshadertools qtimageformats'
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 1
|
fetch-depth: 1
|
||||||
|
2
.github/workflows/ubuntu.yml
vendored
2
.github/workflows/ubuntu.yml
vendored
@ -30,7 +30,7 @@ jobs:
|
|||||||
version: ${{ matrix.qt_ver }}
|
version: ${{ matrix.qt_ver }}
|
||||||
cached: 'false'
|
cached: 'false'
|
||||||
arch: ${{ matrix.qt_arch }}
|
arch: ${{ matrix.qt_arch }}
|
||||||
modules: 'qt5compat qtmultimedia qtshadertools'
|
modules: 'qt5compat qtmultimedia qtshadertools qtimageformats'
|
||||||
- name: ubuntu install GL library
|
- name: ubuntu install GL library
|
||||||
run: sudo apt-get install -y libglew-dev libglfw3-dev qml-module-qtquick-controls qml-module-qtquick-controls2
|
run: sudo apt-get install -y libglew-dev libglfw3-dev qml-module-qtquick-controls qml-module-qtquick-controls2
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
2
.github/workflows/windows.yml
vendored
2
.github/workflows/windows.yml
vendored
@ -38,7 +38,7 @@ jobs:
|
|||||||
version: ${{ matrix.qt_ver }}
|
version: ${{ matrix.qt_ver }}
|
||||||
arch: ${{ matrix.qt_arch }}
|
arch: ${{ matrix.qt_arch }}
|
||||||
cached: 'false'
|
cached: 'false'
|
||||||
modules: 'qt5compat qtmultimedia qtshadertools'
|
modules: 'qt5compat qtmultimedia qtshadertools qtimageformats'
|
||||||
# 拉取代码
|
# 拉取代码
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
|
@ -16,6 +16,7 @@ Window {
|
|||||||
"/about":"qrc:/page/AboutPage.qml",
|
"/about":"qrc:/page/AboutPage.qml",
|
||||||
"/login":"qrc:/page/LoginPage.qml",
|
"/login":"qrc:/page/LoginPage.qml",
|
||||||
"/chat":"qrc:/page/ChatPage.qml",
|
"/chat":"qrc:/page/ChatPage.qml",
|
||||||
|
"/media":"qrc:/page/MediaPage.qml",
|
||||||
}
|
}
|
||||||
FluApp.initialRoute = "/"
|
FluApp.initialRoute = "/"
|
||||||
FluApp.run()
|
FluApp.run()
|
||||||
|
@ -142,20 +142,6 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ListModel{
|
|
||||||
id:model_added
|
|
||||||
Component.onCompleted: {
|
|
||||||
append(ItemsOriginal.getRecentlyAddedData())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ListModel{
|
|
||||||
id:model_update
|
|
||||||
Component.onCompleted: {
|
|
||||||
append(ItemsOriginal.getRecentlyUpdatedData())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component{
|
Component{
|
||||||
id:com_item
|
id:com_item
|
||||||
Item{
|
Item{
|
||||||
@ -187,7 +173,7 @@ FluScrollablePage{
|
|||||||
id:item_icon
|
id:item_icon
|
||||||
height: 40
|
height: 40
|
||||||
width: 40
|
width: 40
|
||||||
source: model.image
|
source: modelData.image
|
||||||
anchors{
|
anchors{
|
||||||
left: parent.left
|
left: parent.left
|
||||||
leftMargin: 20
|
leftMargin: 20
|
||||||
@ -197,7 +183,7 @@ FluScrollablePage{
|
|||||||
|
|
||||||
FluText{
|
FluText{
|
||||||
id:item_title
|
id:item_title
|
||||||
text:model.title
|
text:modelData.title
|
||||||
fontStyle: FluText.BodyStrong
|
fontStyle: FluText.BodyStrong
|
||||||
anchors{
|
anchors{
|
||||||
left: item_icon.right
|
left: item_icon.right
|
||||||
@ -208,7 +194,7 @@ FluScrollablePage{
|
|||||||
|
|
||||||
FluText{
|
FluText{
|
||||||
id:item_desc
|
id:item_desc
|
||||||
text:model.desc
|
text:modelData.desc
|
||||||
color:FluColors.Grey120
|
color:FluColors.Grey120
|
||||||
wrapMode: Text.WrapAnywhere
|
wrapMode: Text.WrapAnywhere
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
@ -241,7 +227,7 @@ FluScrollablePage{
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
onClicked: {
|
onClicked: {
|
||||||
ItemsOriginal.startPageByItem(model)
|
ItemsOriginal.startPageByItem(modelData)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -260,7 +246,7 @@ FluScrollablePage{
|
|||||||
implicitHeight: contentHeight
|
implicitHeight: contentHeight
|
||||||
cellHeight: 120
|
cellHeight: 120
|
||||||
cellWidth: 320
|
cellWidth: 320
|
||||||
model:model_added
|
model:ItemsOriginal.getRecentlyAddedData()
|
||||||
interactive: false
|
interactive: false
|
||||||
delegate: com_item
|
delegate: com_item
|
||||||
}
|
}
|
||||||
@ -278,7 +264,7 @@ FluScrollablePage{
|
|||||||
cellHeight: 120
|
cellHeight: 120
|
||||||
cellWidth: 320
|
cellWidth: 320
|
||||||
interactive: false
|
interactive: false
|
||||||
model: model_update
|
model: ItemsOriginal.getRecentlyUpdatedData()
|
||||||
delegate: com_item
|
delegate: com_item
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
QT += quick quickcontrols2 concurrent network multimedia
|
QT += quick quickcontrols2 concurrent network multimedia
|
||||||
CONFIG += c++11
|
CONFIG += c++17
|
||||||
DEFINES += QT_DEPRECATED_WARNINGS QT_NO_WARNING_OUTPUT
|
DEFINES += QT_DEPRECATED_WARNINGS QT_NO_WARNING_OUTPUT
|
||||||
|
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
|
@ -16,9 +16,9 @@ FluObject{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FluPaneItemHeader{
|
FluPaneItemExpander{
|
||||||
title:"Inputs"
|
title:"Basic input"
|
||||||
}
|
icon:FluentIcons.CheckboxComposite
|
||||||
|
|
||||||
FluPaneItem{
|
FluPaneItem{
|
||||||
title:"Buttons"
|
title:"Buttons"
|
||||||
@ -29,7 +29,6 @@ FluObject{
|
|||||||
navigationView.push("qrc:/T_Buttons.qml")
|
navigationView.push("qrc:/T_Buttons.qml")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FluPaneItem{
|
FluPaneItem{
|
||||||
title:"Slider"
|
title:"Slider"
|
||||||
image:"qrc:/res/image/control/Slider.png"
|
image:"qrc:/res/image/control/Slider.png"
|
||||||
@ -56,50 +55,48 @@ FluObject{
|
|||||||
navigationView.push("qrc:/T_ToggleSwitch.qml")
|
navigationView.push("qrc:/T_ToggleSwitch.qml")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FluPaneItemHeader{
|
|
||||||
title:"Form"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FluPaneItemExpander{
|
||||||
|
title:"Form"
|
||||||
|
icon:FluentIcons.GridView
|
||||||
FluPaneItem{
|
FluPaneItem{
|
||||||
title:"TextBox"
|
title:"TextBox"
|
||||||
onTap:{
|
onTap:{
|
||||||
navigationView.push("qrc:/T_TextBox.qml")
|
navigationView.push("qrc:/T_TextBox.qml")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FluPaneItem{
|
FluPaneItem{
|
||||||
title:"TimePicker"
|
title:"TimePicker"
|
||||||
onTap:{
|
onTap:{
|
||||||
navigationView.push("qrc:/T_TimePicker.qml")
|
navigationView.push("qrc:/T_TimePicker.qml")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FluPaneItem{
|
FluPaneItem{
|
||||||
title:"DatePicker"
|
title:"DatePicker"
|
||||||
onTap:{
|
onTap:{
|
||||||
navigationView.push("qrc:/T_DatePicker.qml")
|
navigationView.push("qrc:/T_DatePicker.qml")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FluPaneItem{
|
FluPaneItem{
|
||||||
title:"CalendarPicker"
|
title:"CalendarPicker"
|
||||||
onTap:{
|
onTap:{
|
||||||
navigationView.push("qrc:/T_CalendarPicker.qml")
|
navigationView.push("qrc:/T_CalendarPicker.qml")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FluPaneItem{
|
FluPaneItem{
|
||||||
title:"ColorPicker"
|
title:"ColorPicker"
|
||||||
onTap:{
|
onTap:{
|
||||||
navigationView.push("qrc:/T_ColorPicker.qml")
|
navigationView.push("qrc:/T_ColorPicker.qml")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FluPaneItemHeader{
|
|
||||||
title:"Surface"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
FluPaneItemExpander{
|
||||||
|
title:"Surface"
|
||||||
|
icon:FluentIcons.SurfaceHub
|
||||||
|
|
||||||
FluPaneItem{
|
FluPaneItem{
|
||||||
title:"InfoBar"
|
title:"InfoBar"
|
||||||
image:"qrc:/res/image/control/InfoBar.png"
|
image:"qrc:/res/image/control/InfoBar.png"
|
||||||
@ -145,10 +142,11 @@ FluObject{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FluPaneItemHeader{
|
|
||||||
title:"Popus"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FluPaneItemExpander{
|
||||||
|
title:"Popus"
|
||||||
|
icon:FluentIcons.ButtonMenu
|
||||||
FluPaneItem{
|
FluPaneItem{
|
||||||
title:"Dialog"
|
title:"Dialog"
|
||||||
onTap:{
|
onTap:{
|
||||||
@ -169,11 +167,11 @@ FluObject{
|
|||||||
navigationView.push("qrc:/T_Menu.qml")
|
navigationView.push("qrc:/T_Menu.qml")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FluPaneItemHeader{
|
|
||||||
title:"Navigation"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FluPaneItemExpander{
|
||||||
|
title:"Navigation"
|
||||||
|
icon:FluentIcons.AllApps
|
||||||
FluPaneItem{
|
FluPaneItem{
|
||||||
title:"TabView"
|
title:"TabView"
|
||||||
image:"qrc:/res/image/control/TabView.png"
|
image:"qrc:/res/image/control/TabView.png"
|
||||||
@ -183,7 +181,6 @@ FluObject{
|
|||||||
navigationView.push("qrc:/T_TabView.qml")
|
navigationView.push("qrc:/T_TabView.qml")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FluPaneItem{
|
FluPaneItem{
|
||||||
title:"TreeView"
|
title:"TreeView"
|
||||||
onTap:{
|
onTap:{
|
||||||
@ -191,18 +188,18 @@ FluObject{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FluPaneItem{
|
FluPaneItem{
|
||||||
title:"MultiWindow"
|
title:"MultiWindow"
|
||||||
onTap:{
|
onTap:{
|
||||||
navigationView.push("qrc:/T_MultiWindow.qml")
|
navigationView.push("qrc:/T_MultiWindow.qml")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FluPaneItemHeader{
|
|
||||||
title:"Theming"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
FluPaneItemExpander{
|
||||||
|
title:"Theming"
|
||||||
|
icon:FluentIcons.Brightness
|
||||||
FluPaneItem{
|
FluPaneItem{
|
||||||
title:"Theme"
|
title:"Theme"
|
||||||
onTap:{
|
onTap:{
|
||||||
@ -222,11 +219,11 @@ FluObject{
|
|||||||
navigationView.push("qrc:/T_Typography.qml")
|
navigationView.push("qrc:/T_Typography.qml")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FluPaneItemHeader{
|
|
||||||
title:"Media"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FluPaneItemExpander{
|
||||||
|
title:"Media"
|
||||||
|
icon:FluentIcons.Media
|
||||||
FluPaneItem{
|
FluPaneItem{
|
||||||
title:"MediaPlayer"
|
title:"MediaPlayer"
|
||||||
image:"qrc:/res/image/control/MediaPlayerElement.png"
|
image:"qrc:/res/image/control/MediaPlayerElement.png"
|
||||||
@ -236,6 +233,7 @@ FluObject{
|
|||||||
navigationView.push("qrc:/T_MediaPlayer.qml")
|
navigationView.push("qrc:/T_MediaPlayer.qml")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function getRecentlyAddedData(){
|
function getRecentlyAddedData(){
|
||||||
var arr = []
|
var arr = []
|
||||||
@ -244,14 +242,23 @@ FluObject{
|
|||||||
if(item instanceof FluPaneItem && item.recentlyAdded){
|
if(item instanceof FluPaneItem && item.recentlyAdded){
|
||||||
arr.push(item)
|
arr.push(item)
|
||||||
}
|
}
|
||||||
|
if(item instanceof FluPaneItemExpander){
|
||||||
|
for(var j=0;j<item.children.length;j++){
|
||||||
|
var itemChild = item.children[j]
|
||||||
|
if(itemChild instanceof FluPaneItem && itemChild.recentlyAdded){
|
||||||
|
arr.push(itemChild)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return arr
|
return arr
|
||||||
}
|
}
|
||||||
|
|
||||||
function getRecentlyUpdatedData(){
|
function getRecentlyUpdatedData(){
|
||||||
var arr = []
|
var arr = []
|
||||||
for(var i=0;i<children.length;i++){
|
var items = navigationView.getItems();
|
||||||
var item = children[i]
|
for(var i=0;i<items.length;i++){
|
||||||
|
var item = items[i]
|
||||||
if(item instanceof FluPaneItem && item.recentlyUpdated){
|
if(item instanceof FluPaneItem && item.recentlyUpdated){
|
||||||
arr.push(item)
|
arr.push(item)
|
||||||
}
|
}
|
||||||
@ -261,8 +268,9 @@ FluObject{
|
|||||||
|
|
||||||
function getSearchData(){
|
function getSearchData(){
|
||||||
var arr = []
|
var arr = []
|
||||||
for(var i=0;i<children.length;i++){
|
var items = navigationView.getItems();
|
||||||
var item = children[i]
|
for(var i=0;i<items.length;i++){
|
||||||
|
var item = items[i]
|
||||||
if(item instanceof FluPaneItem){
|
if(item instanceof FluPaneItem){
|
||||||
arr.push({title:item.title,key:item.key})
|
arr.push({title:item.title,key:item.key})
|
||||||
}
|
}
|
||||||
@ -270,14 +278,19 @@ FluObject{
|
|||||||
return arr
|
return arr
|
||||||
}
|
}
|
||||||
|
|
||||||
function startPageByItem(item){
|
function startPageByItem(data){
|
||||||
for(var i=0;i<children.length;i++){
|
var items = navigationView.getItems();
|
||||||
if(children[i].key === item.key){
|
for(var i=0;i<items.length;i++){
|
||||||
|
var item = items[i]
|
||||||
|
if(item.key === data.key){
|
||||||
if(navigationView.getCurrentIndex() === i){
|
if(navigationView.getCurrentIndex() === i){
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
children[i].tap()
|
item.tap()
|
||||||
navigationView.setCurrentIndex(i)
|
navigationView.setCurrentIndex(i)
|
||||||
|
if(item.parent){
|
||||||
|
item.parent.isExpand = true
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,6 @@ int main(int argc, char *argv[])
|
|||||||
QCoreApplication::setOrganizationName("ZhuZiChu");
|
QCoreApplication::setOrganizationName("ZhuZiChu");
|
||||||
QCoreApplication::setOrganizationDomain("https://zhuzichu520.github.io");
|
QCoreApplication::setOrganizationDomain("https://zhuzichu520.github.io");
|
||||||
QCoreApplication::setApplicationName("FluentUI");
|
QCoreApplication::setApplicationName("FluentUI");
|
||||||
// QQuickWindow::setSceneGraphBackend(QSGRendererInterface::Software);
|
|
||||||
QQuickStyle::setStyle("Basic");
|
QQuickStyle::setStyle("Basic");
|
||||||
QGuiApplication app(argc, argv);
|
QGuiApplication app(argc, argv);
|
||||||
QQmlApplicationEngine engine;
|
QQmlApplicationEngine engine;
|
||||||
|
@ -36,7 +36,7 @@ FluWindow {
|
|||||||
fontStyle: FluText.Title
|
fontStyle: FluText.Title
|
||||||
}
|
}
|
||||||
FluText{
|
FluText{
|
||||||
text:"v1.1.6"
|
text:"v1.1.7"
|
||||||
fontStyle: FluText.Body
|
fontStyle: FluText.Body
|
||||||
Layout.alignment: Qt.AlignBottom
|
Layout.alignment: Qt.AlignBottom
|
||||||
}
|
}
|
||||||
|
37
example/page/MediaPage.qml
Normal file
37
example/page/MediaPage.qml
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Controls
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import FluentUI
|
||||||
|
|
||||||
|
FluWindow {
|
||||||
|
|
||||||
|
width: 640
|
||||||
|
height: 480
|
||||||
|
minimumWidth: 640
|
||||||
|
minimumHeight: 480
|
||||||
|
|
||||||
|
title:"视频播放器"
|
||||||
|
|
||||||
|
|
||||||
|
FluAppBar{
|
||||||
|
id:appbar
|
||||||
|
title:"视频播放器"
|
||||||
|
width:parent.width
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
FluMediaPlayer{
|
||||||
|
id:player
|
||||||
|
anchors{
|
||||||
|
left: parent.left
|
||||||
|
right: parent.right
|
||||||
|
top: appbar.bottom
|
||||||
|
bottom: parent.bottom
|
||||||
|
}
|
||||||
|
// source:"http://mirror.aarnet.edu.au/pub/TED-talks/911Mothers_2010W-480p.mp4"
|
||||||
|
source:"http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4"
|
||||||
|
// source:"http://video.chinanews.com/flv/2019/04/23/400/111773_web.mp4"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -152,5 +152,6 @@
|
|||||||
<file>global/ItemsOriginal.qml</file>
|
<file>global/ItemsOriginal.qml</file>
|
||||||
<file>global/qmldir</file>
|
<file>global/qmldir</file>
|
||||||
<file>global/ItemsFooter.qml</file>
|
<file>global/ItemsFooter.qml</file>
|
||||||
|
<file>page/MediaPage.qml</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
@ -32,6 +32,8 @@ void Fluent::registerTypes(const char *uri){
|
|||||||
|
|
||||||
qmlRegisterType<WindowHelper>(uri,major,minor,"WindowHelper");
|
qmlRegisterType<WindowHelper>(uri,major,minor,"WindowHelper");
|
||||||
qmlRegisterType<FluColorSet>(uri,major,minor,"FluColorSet");
|
qmlRegisterType<FluColorSet>(uri,major,minor,"FluColorSet");
|
||||||
|
|
||||||
|
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluPaneItemExpander.qml"),uri,major,minor,"FluPaneItemExpander");
|
||||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluTabView.qml"),uri,major,minor,"FluTabView");
|
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluTabView.qml"),uri,major,minor,"FluTabView");
|
||||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluArea.qml"),uri,major,minor,"FluArea");
|
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluArea.qml"),uri,major,minor,"FluArea");
|
||||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluBadge.qml"),uri,major,minor,"FluBadge");
|
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluBadge.qml"),uri,major,minor,"FluBadge");
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
QT += qml quick svg
|
QT += qml quick svg
|
||||||
CONFIG += plugin c++11
|
CONFIG += plugin c++17
|
||||||
TEMPLATE = lib
|
TEMPLATE = lib
|
||||||
TARGET = FluentUI
|
TARGET = FluentUI
|
||||||
TARGET = $$qtLibraryTarget($$TARGET)
|
TARGET = $$qtLibraryTarget($$TARGET)
|
||||||
|
@ -55,13 +55,6 @@ Rectangle{
|
|||||||
height: root.height
|
height: root.height
|
||||||
spacing: 0
|
spacing: 0
|
||||||
|
|
||||||
TFpsMonitor{
|
|
||||||
Layout.alignment: Qt.AlignVCenter
|
|
||||||
Layout.rightMargin: 20
|
|
||||||
Layout.topMargin: 5
|
|
||||||
color:root.textColor
|
|
||||||
visible: showFps
|
|
||||||
}
|
|
||||||
|
|
||||||
RowLayout{
|
RowLayout{
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
|
@ -28,7 +28,9 @@ Rectangle {
|
|||||||
property bool autoSeek:true
|
property bool autoSeek:true
|
||||||
source: control.source
|
source: control.source
|
||||||
videoOutput: video_output
|
videoOutput: video_output
|
||||||
audioOutput:audio_output
|
audioOutput: AudioOutput{
|
||||||
|
id:audio_output
|
||||||
|
}
|
||||||
onErrorChanged:
|
onErrorChanged:
|
||||||
(error)=> {
|
(error)=> {
|
||||||
console.debug(error)
|
console.debug(error)
|
||||||
@ -41,10 +43,9 @@ Rectangle {
|
|||||||
onMediaStatusChanged:
|
onMediaStatusChanged:
|
||||||
(status)=> {
|
(status)=> {
|
||||||
if(status===2){
|
if(status===2){
|
||||||
mediaplayer.play()
|
|
||||||
}else if(status===5){
|
|
||||||
slider.maxValue = mediaplayer.duration
|
slider.maxValue = mediaplayer.duration
|
||||||
showControl = true
|
showControl = true
|
||||||
|
mediaplayer.play()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -53,10 +54,6 @@ Rectangle {
|
|||||||
slider.seek(0)
|
slider.seek(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
AudioOutput{
|
|
||||||
id:audio_output
|
|
||||||
}
|
|
||||||
|
|
||||||
VideoOutput {
|
VideoOutput {
|
||||||
id:video_output
|
id:video_output
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
@ -66,21 +63,23 @@ Rectangle {
|
|||||||
height: 100
|
height: 100
|
||||||
y:showControl ? control.height - 110 : control.height
|
y:showControl ? control.height - 110 : control.height
|
||||||
anchors{
|
anchors{
|
||||||
left: parent.left
|
horizontalCenter: parent.horizontalCenter
|
||||||
right: parent.right
|
|
||||||
leftMargin: 10
|
|
||||||
rightMargin: 10
|
|
||||||
}
|
}
|
||||||
|
width: 460
|
||||||
|
opacity: showControl
|
||||||
MouseArea{
|
MouseArea{
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
}
|
}
|
||||||
|
Behavior on opacity{
|
||||||
|
NumberAnimation{
|
||||||
|
duration: 150
|
||||||
|
}
|
||||||
|
}
|
||||||
Behavior on y{
|
Behavior on y{
|
||||||
NumberAnimation{
|
NumberAnimation{
|
||||||
duration: 150
|
duration: 150
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle{
|
Rectangle{
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
color:FluTheme.dark ? Qt.rgba(45/255,45/255,45/255,0.97) : Qt.rgba(237/255,237/255,237/255,0.97)
|
color:FluTheme.dark ? Qt.rgba(45/255,45/255,45/255,0.97) : Qt.rgba(237/255,237/255,237/255,0.97)
|
||||||
@ -102,13 +101,11 @@ Rectangle {
|
|||||||
mediaplayer.autoSeek = true
|
mediaplayer.autoSeek = true
|
||||||
mediaplayer.play()
|
mediaplayer.play()
|
||||||
}
|
}
|
||||||
|
|
||||||
onValueChanged: {
|
onValueChanged: {
|
||||||
if(mediaplayer.autoSeek == false){
|
if(mediaplayer.autoSeek == false){
|
||||||
mediaplayer.position = value*mediaplayer.duration/slider.maxValue
|
mediaplayer.position = value*mediaplayer.duration/slider.maxValue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onLineClickFunc:function(val){
|
onLineClickFunc:function(val){
|
||||||
mediaplayer.position = val*mediaplayer.duration/slider.maxValue
|
mediaplayer.position = val*mediaplayer.duration/slider.maxValue
|
||||||
}
|
}
|
||||||
@ -170,11 +167,10 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FluIconButton{
|
FluIconButton{
|
||||||
id:btn_volume
|
id:btn_volume
|
||||||
iconSize: 17
|
iconSize: 17
|
||||||
iconSource: audio_output.volume ? FluentIcons.Volume : FluentIcons.Mute
|
iconSource: audio_output.muted ? FluentIcons.Mute : FluentIcons.Volume
|
||||||
anchors{
|
anchors{
|
||||||
left: parent.left
|
left: parent.left
|
||||||
leftMargin: 5
|
leftMargin: 5
|
||||||
@ -182,7 +178,7 @@ Rectangle {
|
|||||||
bottomMargin: 10
|
bottomMargin: 10
|
||||||
}
|
}
|
||||||
onClicked: {
|
onClicked: {
|
||||||
audio_output.volume = !audio_output.volume
|
audio_output.muted = !audio_output.muted
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -200,7 +196,6 @@ Rectangle {
|
|||||||
audio_output.volume = value/100
|
audio_output.volume = value/100
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function formatDuration(duration) {
|
function formatDuration(duration) {
|
||||||
|
@ -48,14 +48,34 @@ Item {
|
|||||||
id:com_panel_item_separatorr
|
id:com_panel_item_separatorr
|
||||||
FluDivider{
|
FluDivider{
|
||||||
width: nav_list.width
|
width: nav_list.width
|
||||||
height: 1
|
height: {
|
||||||
|
if(model.parent){
|
||||||
|
return model.parent.isExpand ? 1 : 0
|
||||||
|
}
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
Behavior on height {
|
||||||
|
NumberAnimation{
|
||||||
|
duration: 150
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Component{
|
Component{
|
||||||
id:com_panel_item_header
|
id:com_panel_item_header
|
||||||
Item{
|
Item{
|
||||||
height: 30
|
height: {
|
||||||
|
if(model.parent){
|
||||||
|
return model.parent.isExpand ? 30 : 0
|
||||||
|
}
|
||||||
|
return 30
|
||||||
|
}
|
||||||
|
Behavior on height {
|
||||||
|
NumberAnimation{
|
||||||
|
duration: 150
|
||||||
|
}
|
||||||
|
}
|
||||||
width: nav_list.width
|
width: nav_list.width
|
||||||
FluText{
|
FluText{
|
||||||
text:model.title
|
text:model.title
|
||||||
@ -70,11 +90,131 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Component{
|
Component{
|
||||||
id:com_panel_item
|
id:com_panel_item_expander
|
||||||
Item{
|
Item{
|
||||||
height: 38
|
height: 38
|
||||||
width: nav_list.width
|
width: nav_list.width
|
||||||
|
|
||||||
|
Rectangle{
|
||||||
|
radius: 4
|
||||||
|
anchors{
|
||||||
|
top: parent.top
|
||||||
|
bottom: parent.bottom
|
||||||
|
left: parent.left
|
||||||
|
right: parent.right
|
||||||
|
topMargin: 2
|
||||||
|
bottomMargin: 2
|
||||||
|
leftMargin: 6
|
||||||
|
rightMargin: 6
|
||||||
|
}
|
||||||
|
Rectangle{
|
||||||
|
width: 3
|
||||||
|
height: 18
|
||||||
|
radius: 1.5
|
||||||
|
color: FluTheme.primaryColor.dark
|
||||||
|
visible: {
|
||||||
|
for(var i=0;i<model.children.length;i++){
|
||||||
|
var item = model.children[i]
|
||||||
|
if(item.idx === nav_list.currentIndex && !model.isExpand){
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
anchors{
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluIcon{
|
||||||
|
rotation: model.isExpand?0:180
|
||||||
|
iconSource:FluentIcons.ChevronUp
|
||||||
|
iconSize: 15
|
||||||
|
anchors{
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
right: parent.right
|
||||||
|
rightMargin: 12
|
||||||
|
}
|
||||||
|
Behavior on rotation {
|
||||||
|
NumberAnimation{
|
||||||
|
duration: 150
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
MouseArea{
|
||||||
|
id:item_mouse
|
||||||
|
hoverEnabled: true
|
||||||
|
anchors.fill: parent
|
||||||
|
onClicked: {
|
||||||
|
model.isExpand = !model.isExpand
|
||||||
|
}
|
||||||
|
}
|
||||||
|
color: {
|
||||||
|
if(FluTheme.dark){
|
||||||
|
if(item_mouse.containsMouse){
|
||||||
|
return Qt.rgba(1,1,1,0.03)
|
||||||
|
}
|
||||||
|
if((nav_list.currentIndex === position)&&type===0){
|
||||||
|
return Qt.rgba(1,1,1,0.06)
|
||||||
|
}
|
||||||
|
return Qt.rgba(0,0,0,0)
|
||||||
|
}else{
|
||||||
|
if(item_mouse.containsMouse){
|
||||||
|
return Qt.rgba(0,0,0,0.03)
|
||||||
|
}
|
||||||
|
if(nav_list.currentIndex === position&&type===0){
|
||||||
|
return Qt.rgba(0,0,0,0.06)
|
||||||
|
}
|
||||||
|
return Qt.rgba(0,0,0,0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FluIcon{
|
||||||
|
id:item_icon
|
||||||
|
iconSource: {
|
||||||
|
if(model.icon){
|
||||||
|
return model.icon
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
width: 30
|
||||||
|
height: 30
|
||||||
|
iconSize: 15
|
||||||
|
anchors{
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
left:parent.left
|
||||||
|
leftMargin: 3
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FluText{
|
||||||
|
id:item_title
|
||||||
|
text:model.title
|
||||||
|
anchors{
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
left:item_icon.right
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Component{
|
||||||
|
id:com_panel_item
|
||||||
|
Item{
|
||||||
|
Behavior on height {
|
||||||
|
NumberAnimation{
|
||||||
|
duration: 150
|
||||||
|
}
|
||||||
|
}
|
||||||
|
clip: true
|
||||||
|
height: {
|
||||||
|
if(model.parent){
|
||||||
|
return model.parent.isExpand ? 38 : 0
|
||||||
|
}
|
||||||
|
return 38
|
||||||
|
}
|
||||||
|
width: nav_list.width
|
||||||
|
|
||||||
Rectangle{
|
Rectangle{
|
||||||
radius: 4
|
radius: 4
|
||||||
anchors{
|
anchors{
|
||||||
@ -330,11 +470,7 @@ Item {
|
|||||||
}
|
}
|
||||||
ScrollBar.vertical: FluScrollBar {}
|
ScrollBar.vertical: FluScrollBar {}
|
||||||
|
|
||||||
model:{
|
model:handleItems()
|
||||||
if(items){
|
|
||||||
return items.children
|
|
||||||
}
|
|
||||||
}
|
|
||||||
delegate: Loader{
|
delegate: Loader{
|
||||||
property var model: modelData
|
property var model: modelData
|
||||||
property var position: index
|
property var position: index
|
||||||
@ -349,6 +485,9 @@ Item {
|
|||||||
if(modelData instanceof FluPaneItemSeparator){
|
if(modelData instanceof FluPaneItemSeparator){
|
||||||
return com_panel_item_separatorr
|
return com_panel_item_separatorr
|
||||||
}
|
}
|
||||||
|
if(modelData instanceof FluPaneItemExpander){
|
||||||
|
return com_panel_item_expander
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -383,6 +522,33 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function handleItems(){
|
||||||
|
var idx = 0
|
||||||
|
var data = []
|
||||||
|
if(items){
|
||||||
|
for(var i=0;i<items.children.length;i++){
|
||||||
|
var item = items.children[i]
|
||||||
|
item.idx = idx
|
||||||
|
data.push(item)
|
||||||
|
idx++
|
||||||
|
if(item instanceof FluPaneItemExpander){
|
||||||
|
for(var j=0;j<item.children.length;j++){
|
||||||
|
var itemChild = item.children[j]
|
||||||
|
itemChild.parent = item
|
||||||
|
itemChild.idx = idx
|
||||||
|
data.push(itemChild)
|
||||||
|
idx++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return data
|
||||||
|
}
|
||||||
|
|
||||||
|
function getItems(){
|
||||||
|
return nav_list.model
|
||||||
|
}
|
||||||
|
|
||||||
function push(url){
|
function push(url){
|
||||||
nav_swipe.push(url)
|
nav_swipe.push(url)
|
||||||
}
|
}
|
||||||
|
@ -3,12 +3,15 @@ import FluentUI
|
|||||||
|
|
||||||
QtObject {
|
QtObject {
|
||||||
readonly property string key : FluApp.uuid()
|
readonly property string key : FluApp.uuid()
|
||||||
|
readonly property int flag : 0
|
||||||
property string title
|
property string title
|
||||||
property int icon
|
property int icon
|
||||||
property bool recentlyAdded: false
|
property bool recentlyAdded: false
|
||||||
property bool recentlyUpdated: false
|
property bool recentlyUpdated: false
|
||||||
property string desc
|
property string desc
|
||||||
property var image
|
property var image
|
||||||
|
property var parent
|
||||||
|
property int idx
|
||||||
signal tap
|
signal tap
|
||||||
signal repTap
|
signal repTap
|
||||||
}
|
}
|
||||||
|
14
src/controls/FluPaneItemExpander.qml
Normal file
14
src/controls/FluPaneItemExpander.qml
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
import QtQuick
|
||||||
|
import FluentUI
|
||||||
|
|
||||||
|
FluObject {
|
||||||
|
readonly property int flag : 3
|
||||||
|
readonly property string key : FluApp.uuid()
|
||||||
|
property string title
|
||||||
|
property int icon
|
||||||
|
property bool isExpand: false
|
||||||
|
property var parent
|
||||||
|
property int idx
|
||||||
|
signal tap
|
||||||
|
signal repTap
|
||||||
|
}
|
@ -1,6 +1,9 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
|
|
||||||
QtObject {
|
QtObject {
|
||||||
|
readonly property int flag : 1
|
||||||
readonly property string key : FluApp.uuid()
|
readonly property string key : FluApp.uuid()
|
||||||
property string title
|
property string title
|
||||||
|
property var parent
|
||||||
|
property int idx
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
|
|
||||||
QtObject {
|
QtObject {
|
||||||
|
readonly property int flag : 2
|
||||||
readonly property string key : FluApp.uuid()
|
readonly property string key : FluApp.uuid()
|
||||||
|
property var parent
|
||||||
|
property int idx
|
||||||
}
|
}
|
||||||
|
@ -1,71 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import FluentUI
|
|
||||||
|
|
||||||
Item {
|
|
||||||
|
|
||||||
readonly property alias fps: _private.fps;
|
|
||||||
readonly property alias fpsAvg: _private.fpsAvg;
|
|
||||||
property color color: "#C0C0C0"
|
|
||||||
property Component contentItem: contentComponent;
|
|
||||||
|
|
||||||
id: control
|
|
||||||
width: contentItemLoader.width + 5;
|
|
||||||
height: contentItemLoader.height + 5;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Component{
|
|
||||||
id:contentComponent
|
|
||||||
FluText{
|
|
||||||
color:control.color
|
|
||||||
text: " Avg " + fpsAvg + " | " + fps + " Fps";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluObject{
|
|
||||||
id:_private;
|
|
||||||
property int frameCounter: 0
|
|
||||||
property int frameCounterAvg: 0
|
|
||||||
property int counter: 0
|
|
||||||
property int fps: 0
|
|
||||||
property int fpsAvg: 0
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: monitor
|
|
||||||
radius: 3
|
|
||||||
width: 6
|
|
||||||
height: width
|
|
||||||
opacity: 0;
|
|
||||||
|
|
||||||
NumberAnimation on rotation {
|
|
||||||
from:0
|
|
||||||
to: 360
|
|
||||||
duration: 800
|
|
||||||
loops: Animation.Infinite
|
|
||||||
}
|
|
||||||
onRotationChanged: _private.frameCounter++;
|
|
||||||
}
|
|
||||||
|
|
||||||
Loader{
|
|
||||||
id:contentItemLoader
|
|
||||||
sourceComponent: contentItem
|
|
||||||
}
|
|
||||||
|
|
||||||
Timer {
|
|
||||||
interval: 2000
|
|
||||||
repeat: true
|
|
||||||
running: visible
|
|
||||||
onTriggered: {
|
|
||||||
_private.frameCounterAvg += _private.frameCounter;
|
|
||||||
_private.fps = _private.frameCounter/2;
|
|
||||||
_private.counter++;
|
|
||||||
_private.frameCounter = 0;
|
|
||||||
if (_private.counter >= 3) {
|
|
||||||
_private.fpsAvg = _private.frameCounterAvg/(2 * _private.counter)
|
|
||||||
_private.frameCounterAvg = 0;
|
|
||||||
_private.counter = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -22,7 +22,6 @@
|
|||||||
<file>controls/FluIcon.qml</file>
|
<file>controls/FluIcon.qml</file>
|
||||||
<file>controls/FluDivider.qml</file>
|
<file>controls/FluDivider.qml</file>
|
||||||
<file>controls/FluTooltip.qml</file>
|
<file>controls/FluTooltip.qml</file>
|
||||||
<file>controls/TFpsMonitor.qml</file>
|
|
||||||
<file>controls/FluTextBoxBackground.qml</file>
|
<file>controls/FluTextBoxBackground.qml</file>
|
||||||
<file>controls/FluMultiLineTextBox.qml</file>
|
<file>controls/FluMultiLineTextBox.qml</file>
|
||||||
<file>controls/FluWindowResize.qml</file>
|
<file>controls/FluWindowResize.qml</file>
|
||||||
@ -60,5 +59,6 @@
|
|||||||
<file>controls/FluMediaPlayer.qml</file>
|
<file>controls/FluMediaPlayer.qml</file>
|
||||||
<file>controls/FluTabView.qml</file>
|
<file>controls/FluTabView.qml</file>
|
||||||
<file>controls/FluItem.qml</file>
|
<file>controls/FluItem.qml</file>
|
||||||
|
<file>controls/FluPaneItemExpander.qml</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
Reference in New Issue
Block a user