ukui-menu/qml/AppUI/FullScreenUI.qml

136 lines
3.9 KiB
QML
Raw Normal View History

2022-12-23 11:32:21 +08:00
import QtQuick 2.0
2023-03-17 17:25:50 +08:00
import QtQuick.Layouts 1.12
import org.ukui.quick.platform 1.0 as Platform
import org.ukui.quick.items 1.0 as UkuiItems
2023-03-20 15:33:32 +08:00
import org.ukui.menu.core 1.0
UkuiItems.StyleBackground {
paletteRole: Platform.Theme.Dark
2024-01-09 07:31:27 +08:00
MouseArea {
anchors.fill: parent
onClicked: {
2024-01-09 07:31:27 +08:00
if (mainContainer.visible) {
//执行全屏退出操作
forceActiveFocus();
mainWindow.hide();
} else {
2024-01-09 07:31:27 +08:00
mainContainer.visible = true;
}
}
}
2023-03-20 15:33:32 +08:00
2024-01-09 07:31:27 +08:00
Item {
id: mainContainer
2022-12-23 11:32:21 +08:00
anchors.fill: parent
2024-01-09 07:31:27 +08:00
AppPageBackend {
id: appPageBackend
2023-03-17 17:25:50 +08:00
}
2024-01-09 07:31:27 +08:00
// 两行三列
GridLayout {
anchors.fill: parent
// anchors.margins: 36
anchors.leftMargin: 36
anchors.topMargin: 36
anchors.rightMargin: 36
anchors.bottomMargin: 5
rowSpacing: 5
columnSpacing: 5
rows: 2
columns: 3
// 应用列表模式选择按钮: [row: 0, column: 0] [rowspan: 2, columnSpan: 1]
Item {
Layout.row: 0
Layout.column: 0
Layout.preferredWidth: Math.max(actionsItem.width, labelsItem.width)
Layout.preferredHeight: 40
2024-01-09 07:31:27 +08:00
// TODO: 设计最小保持宽度
AppListActions {
id: actionsItem
anchors.centerIn: parent
height: parent.height
actions: appPageBackend.appModel.header.actions
visible: count > 0
}
}
2024-01-09 07:31:27 +08:00
// 搜索框: [row: 0, column: 1]
Item {
Layout.row: 0
Layout.column: 1
Layout.fillWidth: true
Layout.preferredHeight: 40
SearchInputBar {
id: searchInputBar
width: 372; height: 36
anchors.centerIn: parent
radius: Platform.Theme.minRadius
visible: opacity
onTextChanged: {
if (text === "") {
appPageBackend.group = PluginGroup.Display;
} else {
appPageBackend.group = PluginGroup.Search;
appPageBackend.startSearch(text);
}
}
Behavior on opacity {
NumberAnimation { duration: 300; easing.type: Easing.InOutCubic }
}
}
}
2022-12-23 11:32:21 +08:00
2024-01-09 07:31:27 +08:00
// 右侧按钮区域: [row: 0, column: 2] [rowspan: 2, columnSpan: 1]
Sidebar {
Layout.row: 0
Layout.column: 2
Layout.rowSpan: 2
Layout.columnSpan: 1
Layout.preferredWidth: 60
Layout.fillHeight: true
}
// 左侧标签列表: [row: 1, column: 0]
Item {
Layout.row: 1
Layout.column: 0
Layout.preferredWidth: Math.max(actionsItem.width, labelsItem.width)
Layout.fillHeight: true
Item {
id: labelsItem
anchors.centerIn: parent
width: 120
height: parent.height
}
}
// 应用列表: [row: 1, column: 1]
Item {
Layout.row: 1
Layout.column: 1
Layout.fillWidth: true
Layout.fillHeight: true
AppList {
anchors.fill: parent
visible: true
model: appPageBackend.appModel
view.onContentYChanged: {
//
}
}
}
2022-12-23 11:32:21 +08:00
}
}
}