调整了ContentPage

main
wuyize 2023-06-30 23:31:28 +08:00
parent 6572091478
commit 2fcb8a2797
5 changed files with 189 additions and 173 deletions

View File

@ -34,12 +34,11 @@ FluWindow {
layoutDirection: Qt.RightToLeft layoutDirection: Qt.RightToLeft
// Rectangle{ // Rectangle{
// anchors.fill: parent // anchors.fill: parent
// color: "red" // color: "red"
// } // }
Rectangle {
Rectangle{
color: FluColors.White color: FluColors.White
radius: 50 radius: 50
width: 32 width: 32
@ -47,7 +46,9 @@ FluWindow {
} }
Text { Text {
Layout.margins: {right: 10} Layout.margins: {
right: 10
}
text: "用户名" text: "用户名"
} }
} }
@ -80,13 +81,15 @@ FluWindow {
} }
} }
ContentPage{ ContentPage {
Layout.fillWidth: true
Layout.fillHeight: true Layout.fillHeight: true
topPadding: 10 Layout.fillWidth: true
Layout.topMargin: 20 Layout.topMargin: 45
Layout.bottomMargin: 4
Layout.rightMargin: 4
} }
/* /*
FluArea { FluArea {
Layout.fillHeight: true Layout.fillHeight: true
@ -116,7 +119,4 @@ FluWindow {
window.show() window.show()
} }
} }
} }

View File

@ -3,12 +3,10 @@ import QtQuick.Layouts
import FluentUI import FluentUI
import "qrc:///AicsKnowledgeBase/qml/global" import "qrc:///AicsKnowledgeBase/qml/global"
Window { Item {
id: fileListTestWindow id: fileListTestWindow
visible: true
width: 800 width: 800
height: 600 height: 600
title: "File List Test1"
signal search(string tag) signal search(string tag)
signal open(string file) signal open(string file)
Item { Item {

View File

@ -6,8 +6,23 @@ import QtQuick.Controls.Basic
import QtWebEngine 1.2 import QtWebEngine 1.2
import FluentUI import FluentUI
FluScrollablePage { FluArea {
paddings: 0
// paddings: {
// top: 10
// right: 0
// bottom: 10
// left: 10
// }
FluScrollablePage {
id: contentPage id: contentPage
anchors.fill: parent
leftPadding: 10
topPadding: 10
rightPadding: 10
bottomPadding: 0
property int knowledgeFileId property int knowledgeFileId
property int likeCount: 0 property int likeCount: 0
property int favoriteCount: 0 property int favoriteCount: 0
@ -16,7 +31,7 @@ FluScrollablePage {
property bool isLike: false property bool isLike: false
property bool isFavorite: false property bool isFavorite: false
property double fileSize: 455 property double fileSize: 455
property list<string> tags: ["tage 1", "tage 2", "tage 3"] property list<string> tags: ["tag 1", "tag 2", "tag 3"]
property date publishTime: new Date() property date publishTime: new Date()
property string brief: "这是一个简介" property string brief: "这是一个简介"
property string type: null property string type: null
@ -26,16 +41,15 @@ FluScrollablePage {
} }
FluArea { Item {
Layout.fillWidth: true Layout.fillWidth: true
implicitHeight: 50 implicitHeight: 50
Layout.topMargin: 15
FluText { FluText {
id: text_title id: text_title
padding: 10 padding: 10
text: "文章标题" text: "文章标题"
font{ font {
pointSize: 15 pointSize: 15
bold: true bold: true
} }
@ -57,7 +71,7 @@ FluScrollablePage {
top: button_share.bottom top: button_share.bottom
} }
} }
anchors{ anchors {
verticalCenter: text_title.verticalCenter verticalCenter: text_title.verticalCenter
right: parent.right right: parent.right
} }
@ -78,7 +92,7 @@ FluScrollablePage {
top: button_favorite.bottom top: button_favorite.bottom
} }
} }
anchors{ anchors {
verticalCenter: text_title.verticalCenter verticalCenter: text_title.verticalCenter
right: layout_share.left right: layout_share.left
} }
@ -99,7 +113,7 @@ FluScrollablePage {
top: button_like.bottom top: button_like.bottom
} }
} }
anchors{ anchors {
verticalCenter: text_title.verticalCenter verticalCenter: text_title.verticalCenter
right: layout_favorite.left right: layout_favorite.left
} }
@ -131,9 +145,9 @@ FluScrollablePage {
backgroundColor: "transparent" backgroundColor: "transparent"
implicitHeight: 200 implicitHeight: 200
Layout.fillWidth: true Layout.fillWidth: true
settings.javascriptEnabled : true settings.javascriptEnabled: true
settings.pluginsEnabled:true settings.pluginsEnabled: true
url:"https://www.qt.io" url: "https://www.baidu.com"
} }
FluArea { FluArea {
@ -141,32 +155,32 @@ FluScrollablePage {
implicitHeight: 100 implicitHeight: 100
ColumnLayout { ColumnLayout {
RowLayout { RowLayout {
FluText{ FluText {
padding: 10 padding: 10
text: contentPage.publishTime.toDateString() text: contentPage.publishTime.toDateString()
} }
FluText{ FluText {
padding: 10 padding: 10
text: contentPage.fileSize.toString() + "Mb" text: contentPage.fileSize.toString() + "Mb"
} }
FluText{ FluText {
padding: 10 padding: 10
text: contentPage.browsCount.toString()+"浏览量" text: contentPage.browsCount.toString() + "浏览量"
} }
} }
FluText{ FluText {
Layout.topMargin: -2 Layout.topMargin: -2
Layout.leftMargin: 10 Layout.leftMargin: 10
text: contentPage.brief text: contentPage.brief
} }
RowLayout{ RowLayout {
Layout.topMargin: 2 Layout.topMargin: 2
Layout.leftMargin: 5 Layout.leftMargin: 5
Repeater { Repeater {
model: contentPage.tags model: contentPage.tags
delegate: Button { delegate: Button {
Layout.margins: 2 Layout.margins: 2
text: "#"+contentPage.tags[index] text: "#" + contentPage.tags[index]
background: Rectangle { background: Rectangle {
implicitHeight: 10 implicitHeight: 10
implicitWidth: 10 implicitWidth: 10
@ -186,4 +200,5 @@ FluScrollablePage {
bold: true bold: true
} }
} }
}
} }

View File

@ -4,6 +4,7 @@ import QtQuick.Window
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Controls.Basic import QtQuick.Controls.Basic
import FluentUI import FluentUI
import "qrc:///AicsKnowledgeBase/qml/component"
FluArea{ FluArea{
property string url: '' property string url: ''
@ -18,5 +19,7 @@ FluArea{
text: "File" text: "File"
} }
FileList{}
} }

View File

@ -15,7 +15,7 @@ FluArea{
FluText{ FluText{
Layout.topMargin: 20 Layout.topMargin: 20
text:"Home" text: "Home"
} }
} }