This commit is contained in:
柚子 2022-05-13 22:56:22 +00:00 committed by Gitee
parent 56dd6c70da
commit 3c87ef6954
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 88 additions and 1 deletions

0
src/qml/AppListPage.qml Normal file
View File

View File

View File

@ -4,4 +4,91 @@ import QtQuick.Controls 2.12
import QtQuick.Layouts 1.12
import QtGraphicalEffects 1.0
import FishUI 1.0 as FishUI
import FishUI 1.0 as FishUI
FishUI.Window {
id: root
width: settings.width
height: settings.height
minimumWidth: 900
minimumHeight: 580
visible: true
title: qsTr("Spark Store")
background.opacity: 1
header.height: 36 + FishUI.Units.largeSpacing
LayoutMirroring.enabled: Qt.application.layoutDirection === Qt.RightToLeft
LayoutMirroring.childrenInherit: true
property QtObject settings: GlobalSettings { }
onClosing: {
if (root.visibility !== Window.Maximized &&
root.visibility !== Window.FullScreen) {
settings.width = root.width
settings.height = root.height
}
}
headerItem: Item {
RowLayout {
anchors.fill: parent
anchors.leftMargin: FishUI.Units.smallSpacing * 1.5
anchors.rightMargin: FishUI.Units.smallSpacing * 1.5
anchors.topMargin: FishUI.Units.smallSpacing * 1.5
anchors.bottomMargin: FishUI.Units.smallSpacing * 1.5
spacing: FishUI.Units.smallSpacing
IconButton {
Layout.fillHeight: true
implicitWidth: height
source: FishUI.Theme.darkMode ? "qrc:/images/dark/go-previous.svg"
: "qrc:/images/light/go-previous.svg"
onClicked: _appListPage.goBack()
}
IconButton {
Layout.fillHeight: true
implicitWidth: height
source: FishUI.Theme.darkMode ? "qrc:/images/dark/go-next.svg"
: "qrc:/images/light/go-next.svg"
onClicked: _appListPage.goForward()
}
PathBar {
id: _pathBar
Layout.fillWidth: true
Layout.fillHeight: true
onItemClicked: _appListPage.openUrl(path)
onEditorAccepted: _appListPage.openUrl(path)
}
}
}
RowLayout {
anchors.fill: parent
spacing: 0
SideBar {
id: _sideBar
Layout.fillHeight: true
width: 180 + FishUI.Units.largeSpacing
onClicked: _appListPage.openUrl(path)
}
AppListPage {
id: _appListPage
Layout.fillWidth: true
Layout.fillHeight: true
onCurrentUrlChanged: {
_sideBar.updateSelection(currentUrl)
_pathBar.updateUrl(currentUrl)
}
onRequestPathEditor: {
_pathBar.openEditor()
}
}
}
}