diff --git a/AicsKnowledgeBase/qml/MainWindow.qml b/AicsKnowledgeBase/qml/MainWindow.qml index ed4417a..5726b17 100644 --- a/AicsKnowledgeBase/qml/MainWindow.qml +++ b/AicsKnowledgeBase/qml/MainWindow.qml @@ -34,12 +34,11 @@ FluWindow { layoutDirection: Qt.RightToLeft -// Rectangle{ -// anchors.fill: parent -// color: "red" -// } - - Rectangle{ + // Rectangle{ + // anchors.fill: parent + // color: "red" + // } + Rectangle { color: FluColors.White radius: 50 width: 32 @@ -47,7 +46,9 @@ FluWindow { } Text { - Layout.margins: {right: 10} + Layout.margins: { + right: 10 + } text: "用户名" } } @@ -80,13 +81,15 @@ FluWindow { } } - ContentPage{ - Layout.fillWidth: true + ContentPage { Layout.fillHeight: true - topPadding: 10 - Layout.topMargin: 20 - + Layout.fillWidth: true + Layout.topMargin: 45 + Layout.bottomMargin: 4 + Layout.rightMargin: 4 } + + /* FluArea { Layout.fillHeight: true @@ -116,7 +119,4 @@ FluWindow { window.show() } } - - } - diff --git a/AicsKnowledgeBase/qml/component/FileList.qml b/AicsKnowledgeBase/qml/component/FileList.qml index 8f7d105..304d7ee 100644 --- a/AicsKnowledgeBase/qml/component/FileList.qml +++ b/AicsKnowledgeBase/qml/component/FileList.qml @@ -3,12 +3,10 @@ import QtQuick.Layouts import FluentUI import "qrc:///AicsKnowledgeBase/qml/global" -Window { +Item { id: fileListTestWindow - visible: true width: 800 height: 600 - title: "File List Test1" signal search(string tag) signal open(string file) Item { diff --git a/AicsKnowledgeBase/qml/page/ContentPage.qml b/AicsKnowledgeBase/qml/page/ContentPage.qml index 229298a..1703cbe 100644 --- a/AicsKnowledgeBase/qml/page/ContentPage.qml +++ b/AicsKnowledgeBase/qml/page/ContentPage.qml @@ -6,184 +6,199 @@ import QtQuick.Controls.Basic import QtWebEngine 1.2 import FluentUI -FluScrollablePage { - id: contentPage - property int knowledgeFileId - property int likeCount: 0 - property int favoriteCount: 0 - property int shareCount: 0 - property int browsCount: 555 - property bool isLike: false - property bool isFavorite: false - property double fileSize: 455 - property list tags: ["tage 1", "tage 2", "tage 3"] - property date publishTime: new Date() - property string brief: "这是一个简介" - property string type: null - property var contentShow +FluArea { + paddings: 0 - Component.onCompleted: { + // paddings: { + // top: 10 + // right: 0 + // bottom: 10 + // left: 10 + // } + FluScrollablePage { + id: contentPage + anchors.fill: parent + leftPadding: 10 + topPadding: 10 + rightPadding: 10 + bottomPadding: 0 - } + property int knowledgeFileId + property int likeCount: 0 + property int favoriteCount: 0 + property int shareCount: 0 + property int browsCount: 555 + property bool isLike: false + property bool isFavorite: false + property double fileSize: 455 + property list tags: ["tag 1", "tag 2", "tag 3"] + property date publishTime: new Date() + property string brief: "这是一个简介" + property string type: null + property var contentShow - FluArea { - Layout.fillWidth: true - implicitHeight: 50 - Layout.topMargin: 15 + Component.onCompleted: { - FluText { - id: text_title - padding: 10 - text: "文章标题" - font{ - pointSize: 15 - bold: true - } } - ColumnLayout { - id: layout_share - FluIconButton { - id: button_share - iconSize: 15 - iconSource: FluentIcons.Share - text: contentPage.shareCount.toString() - } + + Item { + Layout.fillWidth: true + implicitHeight: 50 + FluText { - id: text_share - text: contentPage.shareCount - font.pointSize: 8 - anchors { - horizontalCenter: button_share.horizontalCenter - top: button_share.bottom + id: text_title + padding: 10 + text: "文章标题" + font { + pointSize: 15 + bold: true } } - anchors{ - verticalCenter: text_title.verticalCenter - right: parent.right + ColumnLayout { + id: layout_share + FluIconButton { + id: button_share + iconSize: 15 + iconSource: FluentIcons.Share + text: contentPage.shareCount.toString() + } + FluText { + id: text_share + text: contentPage.shareCount + font.pointSize: 8 + anchors { + horizontalCenter: button_share.horizontalCenter + top: button_share.bottom + } + } + anchors { + verticalCenter: text_title.verticalCenter + right: parent.right + } + } + ColumnLayout { + id: layout_favorite + FluIconButton { + id: button_favorite + iconSize: 15 + iconSource: contentPage.isFavorite ? FluentIcons.FavoriteStarFill : FluentIcons.FavoriteStar + } + FluText { + id: text_favorite + text: contentPage.favoriteCount + font.pointSize: 8 + anchors { + horizontalCenter: button_favorite.horizontalCenter + top: button_favorite.bottom + } + } + anchors { + verticalCenter: text_title.verticalCenter + right: layout_share.left + } + } + ColumnLayout { + id: layout_like + FluIconButton { + id: button_like + iconSize: 15 + iconSource: contentPage.isLike ? FluentIcons.HeartFill : FluentIcons.Heart + } + FluText { + id: text_like + text: contentPage.favoriteCount + font.pointSize: 8 + anchors { + horizontalCenter: button_like.horizontalCenter + top: button_like.bottom + } + } + anchors { + verticalCenter: text_title.verticalCenter + right: layout_favorite.left + } } - } - ColumnLayout { - id: layout_favorite FluIconButton { - id: button_favorite - iconSize: 15 - iconSource: contentPage.isFavorite ? FluentIcons.FavoriteStarFill : FluentIcons.FavoriteStar - } - FluText { - id: text_favorite - text: contentPage.favoriteCount - font.pointSize: 8 + id: button_download + iconSize: 25 + iconSource: FluentIcons.Download anchors { - horizontalCenter: button_favorite.horizontalCenter - top: button_favorite.bottom + verticalCenter: text_title.verticalCenter + right: layout_like.left + rightMargin: 20 } } - anchors{ - verticalCenter: text_title.verticalCenter - right: layout_share.left - } } - ColumnLayout { - id: layout_like - FluIconButton { - id: button_like - iconSize: 15 - iconSource: contentPage.isLike ? FluentIcons.HeartFill : FluentIcons.Heart - } - FluText { - id: text_like - text: contentPage.favoriteCount - font.pointSize: 8 - anchors { - horizontalCenter: button_like.horizontalCenter - top: button_like.bottom - } - } - anchors{ - verticalCenter: text_title.verticalCenter - right: layout_favorite.left - } + + FluMediaPlayer { + Layout.fillWidth: true } - FluIconButton { - id: button_download - iconSize: 25 - iconSource: FluentIcons.Download - anchors { - verticalCenter: text_title.verticalCenter - right: layout_like.left - rightMargin: 20 - } + + Text { + id: textMd + text: contentPage.contentMd + textFormat: TextEdit.MarkdownText + focus: true + } + WebEngineView { + id: sitemonitoryView + backgroundColor: "transparent" + implicitHeight: 200 + Layout.fillWidth: true + settings.javascriptEnabled: true + settings.pluginsEnabled: true + url: "https://www.baidu.com" } - } - FluMediaPlayer { - Layout.fillWidth: true - } - - Text { - id: textMd - text: contentPage.contentMd - textFormat: TextEdit.MarkdownText - focus: true - } - WebEngineView { - id: sitemonitoryView - backgroundColor: "transparent" - implicitHeight: 200 - Layout.fillWidth: true - settings.javascriptEnabled : true - settings.pluginsEnabled:true - url:"https://www.qt.io" - } - - FluArea { - Layout.fillWidth: true - implicitHeight: 100 - ColumnLayout { - RowLayout { - FluText{ - padding: 10 - text: contentPage.publishTime.toDateString() + FluArea { + Layout.fillWidth: true + implicitHeight: 100 + ColumnLayout { + RowLayout { + FluText { + padding: 10 + text: contentPage.publishTime.toDateString() + } + FluText { + padding: 10 + text: contentPage.fileSize.toString() + "Mb" + } + FluText { + padding: 10 + text: contentPage.browsCount.toString() + "浏览量" + } } - FluText{ - padding: 10 - text: contentPage.fileSize.toString() + "Mb" + FluText { + Layout.topMargin: -2 + Layout.leftMargin: 10 + text: contentPage.brief } - FluText{ - padding: 10 - text: contentPage.browsCount.toString()+"浏览量" - } - } - FluText{ - Layout.topMargin: -2 - Layout.leftMargin: 10 - text: contentPage.brief - } - RowLayout{ - Layout.topMargin: 2 - Layout.leftMargin: 5 - Repeater { - model: contentPage.tags - delegate: Button { - Layout.margins: 2 - text: "#"+contentPage.tags[index] - background: Rectangle { - implicitHeight: 10 - implicitWidth: 10 - color: FluColors.Grey20 - radius: 10 + RowLayout { + Layout.topMargin: 2 + Layout.leftMargin: 5 + Repeater { + model: contentPage.tags + delegate: Button { + Layout.margins: 2 + text: "#" + contentPage.tags[index] + background: Rectangle { + implicitHeight: 10 + implicitWidth: 10 + color: FluColors.Grey20 + radius: 10 + } } } } } } - } - FluText { - Layout.topMargin: 10 - text: "笔记" - font { - pointSize: 15 - bold: true + FluText { + Layout.topMargin: 10 + text: "笔记" + font { + pointSize: 15 + bold: true + } } } } diff --git a/AicsKnowledgeBase/qml/page/FilePage.qml b/AicsKnowledgeBase/qml/page/FilePage.qml index 28977da..afedc8a 100644 --- a/AicsKnowledgeBase/qml/page/FilePage.qml +++ b/AicsKnowledgeBase/qml/page/FilePage.qml @@ -4,6 +4,7 @@ import QtQuick.Window import QtQuick.Controls import QtQuick.Controls.Basic import FluentUI +import "qrc:///AicsKnowledgeBase/qml/component" FluArea{ property string url: '' @@ -18,5 +19,7 @@ FluArea{ text: "File" } + FileList{} + } diff --git a/AicsKnowledgeBase/qml/page/HomePage.qml b/AicsKnowledgeBase/qml/page/HomePage.qml index b0d63b7..fe3ffbd 100644 --- a/AicsKnowledgeBase/qml/page/HomePage.qml +++ b/AicsKnowledgeBase/qml/page/HomePage.qml @@ -15,7 +15,7 @@ FluArea{ FluText{ Layout.topMargin: 20 - text:"Home" + text: "Home" } }