ukui-menu/qml/AppUI/AppPageContent.qml

77 lines
2.2 KiB
QML
Raw Normal View History

2023-03-20 15:33:32 +08:00
/*
* Copyright (C) 2023, KylinSoft Co., Ltd.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
2023-04-04 09:33:06 +08:00
import QtQuick 2.12
import QtQuick.Layouts 1.12
import QtQuick.Controls 2.5
import AppControls2 1.0 as AppControls2
import org.ukui.menu.core 1.0
2024-01-09 10:08:53 +08:00
Item {
property bool isAppListShow: appList.visible
function resetFocus() {
if (appList.visible) {
appList.resetListFocus();
} else {
selectionPage.viewFocusEnable();
}
}
2024-01-09 10:08:53 +08:00
ColumnLayout {
anchors.fill: parent
spacing: 5
2024-01-09 10:08:53 +08:00
AppListHeader {
id: appListHeader
Layout.fillWidth: true
Layout.preferredHeight: 48
header: AppPageBackend.appModel.header
}
Item {
2024-01-09 10:08:53 +08:00
Layout.fillWidth: true
Layout.fillHeight: true
AppList {
id: appList
anchors.fill: parent
2024-01-09 10:08:53 +08:00
visible: true
model: AppPageBackend.appModel
2024-01-09 10:08:53 +08:00
view.onContentYChanged: {
if (view.contentY <= 0) {
appListHeader.title = "";
} else {
appListHeader.title = view.currentSection;
}
}
2024-01-09 10:08:53 +08:00
}
2023-04-04 09:33:06 +08:00
2024-01-09 10:08:53 +08:00
SelectionPage {
id: selectionPage
anchors.fill: parent
anchors.bottomMargin: 54
visible: !appList.visible
onViewHideFinished: appList.visible = true
onLabelSelected: appList.labelSelection(labelId)
}
}
}
}