2022-10-04 20:25:14 +00:00
|
|
|
import QtQuick 2.14
|
|
|
|
import QtQuick.Controls 2.14
|
2022-10-14 08:29:36 +00:00
|
|
|
import QtQuick.Layouts 1.14
|
2022-10-04 20:25:14 +00:00
|
|
|
|
|
|
|
import Qt.labs.settings 1.0
|
|
|
|
|
2022-10-14 08:29:36 +00:00
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
import Storybook 1.0
|
2022-10-04 20:25:14 +00:00
|
|
|
|
|
|
|
ApplicationWindow {
|
2022-10-14 08:29:36 +00:00
|
|
|
id: root
|
2022-10-04 20:25:14 +00:00
|
|
|
|
|
|
|
width: 1450
|
|
|
|
height: 840
|
|
|
|
visible: true
|
|
|
|
|
2022-10-14 08:29:36 +00:00
|
|
|
property string currentPage
|
2022-10-04 20:25:14 +00:00
|
|
|
|
2022-10-14 08:29:36 +00:00
|
|
|
font.pixelSize: 13
|
|
|
|
|
2022-10-18 18:47:41 +00:00
|
|
|
HotReloader {
|
2022-10-19 19:51:39 +00:00
|
|
|
id: reloader
|
2022-10-18 18:47:41 +00:00
|
|
|
|
2022-10-19 19:51:39 +00:00
|
|
|
loader: viewLoader
|
|
|
|
enabled: hotReloaderControls.enabled
|
|
|
|
onReloaded: hotReloaderControls.notifyReload()
|
2022-10-18 18:47:41 +00:00
|
|
|
}
|
|
|
|
|
2022-10-14 08:29:36 +00:00
|
|
|
ListModel {
|
|
|
|
id: pagesModel
|
2022-10-04 20:25:14 +00:00
|
|
|
|
2022-10-20 15:12:38 +00:00
|
|
|
ListElement {
|
|
|
|
title: "ProfileDialogView"
|
2022-11-21 10:55:16 +00:00
|
|
|
|
|
|
|
figma: [
|
|
|
|
ListElement {
|
|
|
|
link: "https://www.figma.com/file/ibJOTPlNtIxESwS96vJb06/%F0%9F%91%A4-Profile-%7C-Desktop?node-id=733%3A12552"
|
|
|
|
},
|
|
|
|
ListElement {
|
|
|
|
link: "https://www.figma.com/file/ibJOTPlNtIxESwS96vJb06/%F0%9F%91%A4-Profile-%7C-Desktop?node-id=682%3A15078"
|
|
|
|
},
|
|
|
|
ListElement {
|
|
|
|
link: "https://www.figma.com/file/ibJOTPlNtIxESwS96vJb06/%F0%9F%91%A4-Profile-%7C-Desktop?node-id=682%3A17655"
|
|
|
|
},
|
|
|
|
ListElement {
|
|
|
|
link: "https://www.figma.com/file/ibJOTPlNtIxESwS96vJb06/%F0%9F%91%A4-Profile-%7C-Desktop?node-id=682%3A17087"
|
|
|
|
},
|
|
|
|
ListElement {
|
|
|
|
link: "https://www.figma.com/file/ibJOTPlNtIxESwS96vJb06/%F0%9F%91%A4-Profile-%7C-Desktop?node-id=4%3A23525"
|
|
|
|
},
|
|
|
|
ListElement {
|
|
|
|
link: "https://www.figma.com/file/ibJOTPlNtIxESwS96vJb06/%F0%9F%91%A4-Profile-%7C-Desktop?node-id=4%3A23932"
|
|
|
|
}
|
|
|
|
]
|
2022-11-16 13:40:29 +00:00
|
|
|
section: "Views"
|
2022-10-20 15:12:38 +00:00
|
|
|
}
|
2022-10-14 08:29:36 +00:00
|
|
|
ListElement {
|
|
|
|
title: "CommunitiesPortalLayout"
|
2022-11-21 10:55:16 +00:00
|
|
|
|
|
|
|
figma: [
|
|
|
|
ListElement {
|
|
|
|
link: "https://www.figma.com/file/17fc13UBFvInrLgNUKJJg5/Kuba%E2%8E%9CDesktop?node-id=8159%3A415655"
|
|
|
|
},
|
|
|
|
ListElement {
|
|
|
|
link: "https://www.figma.com/file/17fc13UBFvInrLgNUKJJg5/Kuba%E2%8E%9CDesktop?node-id=8159%3A415935"
|
|
|
|
}
|
|
|
|
]
|
2022-11-16 13:40:29 +00:00
|
|
|
section: "Views"
|
2022-10-19 19:51:39 +00:00
|
|
|
}
|
2022-10-14 08:29:36 +00:00
|
|
|
ListElement {
|
|
|
|
title: "LoginView"
|
2022-11-16 13:40:29 +00:00
|
|
|
section: "Views"
|
2022-10-14 08:29:36 +00:00
|
|
|
}
|
2022-10-13 19:02:40 +00:00
|
|
|
ListElement {
|
|
|
|
title: "AboutView"
|
2022-11-16 13:40:29 +00:00
|
|
|
section: "Views"
|
2022-10-13 20:56:25 +00:00
|
|
|
}
|
2022-10-25 08:24:47 +00:00
|
|
|
ListElement {
|
|
|
|
title: "CommunityProfilePopupInviteFriendsPanel"
|
2022-11-16 13:40:29 +00:00
|
|
|
section: "Panels"
|
2022-10-25 08:24:47 +00:00
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
title: "CommunityProfilePopupInviteMessagePanel"
|
2022-11-16 13:40:29 +00:00
|
|
|
section: "Panels"
|
2022-10-25 08:24:47 +00:00
|
|
|
}
|
|
|
|
ListElement {
|
2022-11-16 13:40:29 +00:00
|
|
|
title: "StatusCommunityCard"
|
2022-11-21 10:55:16 +00:00
|
|
|
|
|
|
|
figma: [
|
|
|
|
ListElement {
|
|
|
|
link: "https://www.figma.com/file/17fc13UBFvInrLgNUKJJg5/Kuba%E2%8E%9CDesktop?node-id=8159%3A416159"
|
|
|
|
},
|
|
|
|
ListElement {
|
|
|
|
link: "https://www.figma.com/file/17fc13UBFvInrLgNUKJJg5/Kuba%E2%8E%9CDesktop?node-id=8159%3A416160"
|
|
|
|
}
|
|
|
|
]
|
2022-11-16 13:40:29 +00:00
|
|
|
section: "Panels"
|
2022-10-25 08:24:47 +00:00
|
|
|
}
|
2022-10-25 13:57:04 +00:00
|
|
|
ListElement {
|
2022-11-16 13:40:29 +00:00
|
|
|
title: "InviteFriendsToCommunityPopup"
|
|
|
|
section: "Popups"
|
2022-10-25 13:57:04 +00:00
|
|
|
}
|
2022-11-08 21:23:55 +00:00
|
|
|
ListElement {
|
|
|
|
title: "CreateChannelPopup"
|
2022-11-16 13:40:29 +00:00
|
|
|
section: "Popups"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
title: "LanguageCurrencySettings"
|
|
|
|
section: "Settings"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
title: "BrowserSettings"
|
|
|
|
section: "Settings"
|
2022-11-08 21:23:55 +00:00
|
|
|
}
|
2022-11-16 09:41:32 +00:00
|
|
|
ListElement {
|
|
|
|
title: "UserListPanel"
|
|
|
|
}
|
2022-11-14 09:30:42 +00:00
|
|
|
ListElement {
|
|
|
|
title: "ProfileFetchingView"
|
|
|
|
}
|
2022-11-08 08:36:08 +00:00
|
|
|
ListElement {
|
|
|
|
title: "MembersSelector"
|
|
|
|
}
|
2022-10-14 08:29:36 +00:00
|
|
|
}
|
2022-10-04 20:25:14 +00:00
|
|
|
|
2022-10-14 08:29:36 +00:00
|
|
|
SplitView {
|
|
|
|
anchors.fill: parent
|
2022-10-04 20:25:14 +00:00
|
|
|
|
2022-11-21 10:55:16 +00:00
|
|
|
Pane {
|
|
|
|
SplitView.preferredWidth: 270
|
2022-10-04 21:51:14 +00:00
|
|
|
|
2022-11-21 10:55:16 +00:00
|
|
|
ColumnLayout {
|
|
|
|
width: parent.width
|
|
|
|
height: parent.height
|
2022-10-12 11:02:37 +00:00
|
|
|
|
2022-11-21 10:55:16 +00:00
|
|
|
Button {
|
|
|
|
Layout.fillWidth: true
|
2022-10-14 08:29:36 +00:00
|
|
|
|
2022-11-21 10:55:16 +00:00
|
|
|
text: "Settings"
|
|
|
|
|
|
|
|
onClicked: settingsPopup.open()
|
|
|
|
}
|
2022-10-12 11:02:37 +00:00
|
|
|
|
2022-11-21 10:55:16 +00:00
|
|
|
CheckBox {
|
|
|
|
id: darkModeCheckBox
|
2022-10-12 11:02:37 +00:00
|
|
|
|
2022-11-21 10:55:16 +00:00
|
|
|
Layout.fillWidth: true
|
2022-10-14 08:29:36 +00:00
|
|
|
|
2022-11-21 10:55:16 +00:00
|
|
|
text: "Dark mode"
|
2022-10-14 08:29:36 +00:00
|
|
|
|
2022-11-21 10:55:16 +00:00
|
|
|
StatusLightTheme { id: lightTheme }
|
|
|
|
StatusDarkTheme { id: darkTheme }
|
2022-10-14 08:29:36 +00:00
|
|
|
|
2022-11-21 10:55:16 +00:00
|
|
|
Binding {
|
|
|
|
target: Theme
|
|
|
|
property: "palette"
|
|
|
|
value: darkModeCheckBox.checked ? darkTheme : lightTheme
|
|
|
|
}
|
2022-10-12 09:42:51 +00:00
|
|
|
}
|
|
|
|
|
2022-11-21 10:55:16 +00:00
|
|
|
HotReloaderControls {
|
|
|
|
id: hotReloaderControls
|
2022-10-18 18:47:41 +00:00
|
|
|
|
2022-11-21 10:55:16 +00:00
|
|
|
Layout.fillWidth: true
|
2022-10-18 18:47:41 +00:00
|
|
|
|
2022-11-21 10:55:16 +00:00
|
|
|
onForceReloadClicked: reloader.forceReload()
|
|
|
|
}
|
2022-10-18 18:47:41 +00:00
|
|
|
|
2022-11-21 10:55:16 +00:00
|
|
|
MenuSeparator {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
}
|
2022-10-14 08:29:36 +00:00
|
|
|
|
2022-11-08 10:19:14 +00:00
|
|
|
FilteredPagesList {
|
2022-11-21 10:55:16 +00:00
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
|
|
|
|
2022-10-14 08:29:36 +00:00
|
|
|
currentPage: root.currentPage
|
|
|
|
model: pagesModel
|
|
|
|
|
|
|
|
onPageSelected: root.currentPage = page
|
2022-10-04 21:51:14 +00:00
|
|
|
}
|
2022-10-04 20:25:14 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-11-21 10:55:16 +00:00
|
|
|
Page {
|
2022-10-14 08:29:36 +00:00
|
|
|
SplitView.fillWidth: true
|
2022-10-04 20:25:14 +00:00
|
|
|
|
|
|
|
Loader {
|
|
|
|
id: viewLoader
|
2022-10-12 11:02:37 +00:00
|
|
|
|
2022-10-04 20:25:14 +00:00
|
|
|
anchors.fill: parent
|
|
|
|
clip: true
|
2022-10-12 11:02:37 +00:00
|
|
|
|
2022-10-18 18:47:41 +00:00
|
|
|
source: `pages/${root.currentPage}Page.qml`
|
2022-11-21 10:55:16 +00:00
|
|
|
asynchronous: settingsLayout.loadAsynchronously
|
2022-10-12 11:02:37 +00:00
|
|
|
visible: status === Loader.Ready
|
|
|
|
|
|
|
|
// force reload when `asynchronous` changes
|
|
|
|
onAsynchronousChanged: {
|
2022-10-14 08:29:36 +00:00
|
|
|
active = false
|
|
|
|
active = true
|
2022-10-12 11:02:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
BusyIndicator {
|
|
|
|
anchors.centerIn: parent
|
|
|
|
visible: viewLoader.status === Loader.Loading
|
2022-10-04 20:25:14 +00:00
|
|
|
}
|
2022-10-19 19:51:39 +00:00
|
|
|
|
|
|
|
Label {
|
|
|
|
anchors.centerIn: parent
|
|
|
|
visible: viewLoader.status === Loader.Error
|
|
|
|
text: "Loading page failed"
|
|
|
|
}
|
2022-11-21 10:55:16 +00:00
|
|
|
|
|
|
|
footer: PageToolBar {
|
|
|
|
id: pageToolBar
|
|
|
|
|
|
|
|
title: `pages/${root.currentPage}Page.qml`
|
|
|
|
figmaPagesCount: currentPageModelItem.object
|
|
|
|
? currentPageModelItem.object.figmaCount : 0
|
|
|
|
|
|
|
|
Instantiator {
|
|
|
|
id: currentPageModelItem
|
|
|
|
|
|
|
|
model: SingleItemProxyModel {
|
|
|
|
sourceModel: pagesModel
|
|
|
|
roleName: "title"
|
|
|
|
value: root.currentPage
|
|
|
|
}
|
|
|
|
|
|
|
|
delegate: QtObject {
|
|
|
|
readonly property string title: model.title
|
|
|
|
readonly property var figma: model.figma
|
|
|
|
readonly property int figmaCount: figma ? figma.count : 0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
onFigmaPreviewClicked: {
|
|
|
|
if (!settingsLayout.figmaToken) {
|
|
|
|
noFigmaTokenDialog.open()
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
const window = figmaWindow.createObject(root, {
|
|
|
|
figmaModel: currentPageModelItem.object.figma,
|
|
|
|
title: currentPageModelItem.object.title + " - Figma"
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Dialog {
|
|
|
|
id: settingsPopup
|
|
|
|
|
|
|
|
anchors.centerIn: Overlay.overlay
|
|
|
|
width: 420
|
|
|
|
modal: true
|
|
|
|
|
|
|
|
header: Pane {
|
|
|
|
background: null
|
|
|
|
|
|
|
|
Label {
|
|
|
|
text: "Settings"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
SettingsLayout {
|
|
|
|
id: settingsLayout
|
|
|
|
|
|
|
|
width: parent.width
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Dialog {
|
|
|
|
id: noFigmaTokenDialog
|
|
|
|
|
|
|
|
anchors.centerIn: Overlay.overlay
|
|
|
|
|
|
|
|
title: "Figma token not set"
|
|
|
|
standardButtons: Dialog.Ok
|
|
|
|
|
|
|
|
Label {
|
|
|
|
text: "Please set Figma personal token in \"Settings\""
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
FigmaLinksCache {
|
|
|
|
id: figmaImageLinksCache
|
|
|
|
|
|
|
|
figmaToken: settingsLayout.figmaToken
|
|
|
|
}
|
|
|
|
|
|
|
|
Component {
|
|
|
|
id: figmaWindow
|
|
|
|
|
|
|
|
FigmaPreviewWindow {
|
|
|
|
property alias figmaModel: figmaImagesProxyModel.sourceModel
|
|
|
|
|
|
|
|
model: FigmaImagesProxyModel {
|
|
|
|
id: figmaImagesProxyModel
|
|
|
|
|
|
|
|
figmaLinksCache: figmaImageLinksCache
|
|
|
|
}
|
|
|
|
|
|
|
|
onClosing: Qt.callLater(destroy)
|
2022-10-04 20:25:14 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Settings {
|
2022-10-14 08:29:36 +00:00
|
|
|
property alias currentPage: root.currentPage
|
2022-11-21 10:55:16 +00:00
|
|
|
property alias loadAsynchronously: settingsLayout.loadAsynchronously
|
2022-10-14 08:29:36 +00:00
|
|
|
property alias darkMode: darkModeCheckBox.checked
|
2022-10-19 19:51:39 +00:00
|
|
|
property alias hotReloading: hotReloaderControls.enabled
|
2022-11-21 10:55:16 +00:00
|
|
|
property alias figmaToken: settingsLayout.figmaToken
|
2022-10-04 20:25:14 +00:00
|
|
|
}
|
|
|
|
}
|