2023-05-16 17:48:30 +03:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2020 by Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
|
|
|
|
*
|
|
|
|
* 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 2 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.
|
|
|
|
*/
|
|
|
|
|
2021-09-09 14:33:57 +03:00
|
|
|
import QtQuick 2.15
|
2023-05-16 17:48:30 +03:00
|
|
|
import QtQuick.Window 2.15
|
|
|
|
import QtQuick.Controls 2.15
|
|
|
|
import QtQuick.Layouts 1.15
|
|
|
|
import QtGraphicalEffects 1.15
|
2022-04-20 14:44:19 +03:00
|
|
|
import Qt.labs.platform 1.1 as NativeDialogs
|
2022-11-07 16:05:20 +03:00
|
|
|
|
2021-09-09 14:33:57 +03:00
|
|
|
import "../"
|
2022-11-07 16:05:20 +03:00
|
|
|
import "../filedetails/"
|
2019-12-08 13:32:22 +03:00
|
|
|
|
2020-01-19 22:13:12 +03:00
|
|
|
// Custom qml modules are in /theme (and included by resources.qrc)
|
|
|
|
import Style 1.0
|
|
|
|
|
2020-06-15 18:01:39 +03:00
|
|
|
import com.nextcloud.desktopclient 1.0
|
|
|
|
|
2022-07-20 20:56:57 +03:00
|
|
|
ApplicationWindow {
|
2020-01-19 22:13:12 +03:00
|
|
|
id: trayWindow
|
2019-12-08 13:32:22 +03:00
|
|
|
|
2021-06-21 14:33:22 +03:00
|
|
|
title: Systray.windowTitle
|
|
|
|
// If the main dialog is displayed as a regular window we want it to be quadratic
|
|
|
|
width: Systray.useNormalWindow ? Style.trayWindowHeight : Style.trayWindowWidth
|
2020-01-19 22:13:12 +03:00
|
|
|
height: Style.trayWindowHeight
|
|
|
|
color: "transparent"
|
2021-07-22 11:34:13 +03:00
|
|
|
flags: Systray.useNormalWindow ? Qt.Window : Qt.Dialog | Qt.FramelessWindowHint
|
2021-06-21 14:33:22 +03:00
|
|
|
|
2020-07-06 21:12:58 +03:00
|
|
|
readonly property int maxMenuHeight: Style.trayWindowHeight - Style.trayWindowHeaderHeight - 2 * Style.trayWindowBorderWidth
|
|
|
|
|
2020-10-22 13:39:40 +03:00
|
|
|
Component.onCompleted: Systray.forceWindowInit(trayWindow)
|
|
|
|
|
2020-01-19 22:13:12 +03:00
|
|
|
// Close tray window when focus is lost (e.g. click somewhere else on the screen)
|
2019-12-30 13:39:21 +03:00
|
|
|
onActiveChanged: {
|
2021-06-21 14:33:22 +03:00
|
|
|
if (!Systray.useNormalWindow && !active) {
|
|
|
|
hide();
|
2022-06-30 17:20:13 +03:00
|
|
|
Systray.isOpen = false;
|
2019-12-30 13:39:21 +03:00
|
|
|
}
|
2022-08-04 15:52:59 +03:00
|
|
|
}
|
2021-06-21 14:33:22 +03:00
|
|
|
|
2022-06-30 17:20:13 +03:00
|
|
|
onClosing: Systray.isOpen = false
|
2019-12-30 13:39:21 +03:00
|
|
|
|
2020-01-03 15:09:29 +03:00
|
|
|
onVisibleChanged: {
|
2020-01-19 22:13:12 +03:00
|
|
|
// HACK: reload account Instantiator immediately by restting it - could be done better I guess
|
|
|
|
// see also id:accountMenu below
|
2020-01-11 17:05:37 +03:00
|
|
|
userLineInstantiator.active = false;
|
|
|
|
userLineInstantiator.active = true;
|
2021-09-14 14:17:03 +03:00
|
|
|
syncStatus.model.load();
|
2020-01-03 15:09:29 +03:00
|
|
|
}
|
|
|
|
|
2022-07-20 20:56:57 +03:00
|
|
|
background: Rectangle {
|
|
|
|
radius: Systray.useNormalWindow ? 0.0 : Style.trayWindowRadius
|
|
|
|
border.width: Style.trayWindowBorderWidth
|
|
|
|
border.color: Style.menuBorder
|
|
|
|
color: Style.backgroundColor
|
|
|
|
}
|
|
|
|
|
2019-12-08 13:32:22 +03:00
|
|
|
Connections {
|
2020-06-15 18:01:39 +03:00
|
|
|
target: UserModel
|
2022-08-04 15:52:59 +03:00
|
|
|
function onCurrentUserChanged() {
|
2020-01-03 15:09:29 +03:00
|
|
|
accountMenu.close();
|
2021-09-14 14:17:03 +03:00
|
|
|
syncStatus.model.load();
|
2019-12-08 13:32:22 +03:00
|
|
|
}
|
2019-12-30 13:52:07 +03:00
|
|
|
}
|
|
|
|
|
2022-04-20 14:44:19 +03:00
|
|
|
Component {
|
|
|
|
id: errorMessageDialog
|
|
|
|
|
|
|
|
NativeDialogs.MessageDialog {
|
|
|
|
id: dialog
|
|
|
|
|
|
|
|
title: Systray.windowTitle
|
|
|
|
|
|
|
|
onAccepted: destroy()
|
|
|
|
onRejected: destroy()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-12-30 13:52:07 +03:00
|
|
|
Connections {
|
2020-06-15 18:01:39 +03:00
|
|
|
target: Systray
|
2022-06-29 20:57:52 +03:00
|
|
|
|
2022-06-30 18:42:39 +03:00
|
|
|
function onIsOpenChanged() {
|
2022-07-20 20:56:57 +03:00
|
|
|
userStatusDrawer.close()
|
2022-11-07 16:05:20 +03:00
|
|
|
fileDetailsDrawer.close();
|
2022-07-20 20:56:57 +03:00
|
|
|
|
2022-06-30 18:42:39 +03:00
|
|
|
if(Systray.isOpen) {
|
|
|
|
accountMenu.close();
|
|
|
|
appsMenu.close();
|
2023-04-21 18:48:44 +03:00
|
|
|
openLocalFolderButton.closeMenu()
|
2022-06-29 20:57:52 +03:00
|
|
|
}
|
2019-12-30 13:39:21 +03:00
|
|
|
}
|
2021-08-20 16:17:06 +03:00
|
|
|
|
2022-04-20 14:44:19 +03:00
|
|
|
function onShowErrorMessageDialog(error) {
|
|
|
|
var newErrorDialog = errorMessageDialog.createObject(trayWindow)
|
|
|
|
newErrorDialog.text = error
|
|
|
|
newErrorDialog.open()
|
|
|
|
}
|
2022-11-07 16:05:20 +03:00
|
|
|
|
|
|
|
function onShowFileDetails(accountState, localPath, fileDetailsPage) {
|
|
|
|
fileDetailsDrawer.openFileDetails(accountState, localPath, fileDetailsPage);
|
|
|
|
}
|
2019-12-08 13:32:22 +03:00
|
|
|
}
|
|
|
|
|
2020-07-27 18:27:23 +03:00
|
|
|
OpacityMask {
|
|
|
|
anchors.fill: parent
|
2022-11-24 15:19:32 +03:00
|
|
|
anchors.margins: Style.trayWindowBorderWidth
|
2020-07-27 18:27:23 +03:00
|
|
|
source: ShaderEffectSource {
|
2022-07-20 20:56:57 +03:00
|
|
|
sourceItem: trayWindowMainItem
|
2020-07-27 18:27:23 +03:00
|
|
|
hideSource: true
|
|
|
|
}
|
|
|
|
maskSource: Rectangle {
|
2022-07-20 20:56:57 +03:00
|
|
|
width: trayWindow.width
|
|
|
|
height: trayWindow.height
|
2021-06-21 14:33:22 +03:00
|
|
|
radius: Systray.useNormalWindow ? 0.0 : Style.trayWindowRadius
|
2020-07-27 18:27:23 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-07-20 20:56:57 +03:00
|
|
|
Drawer {
|
|
|
|
id: userStatusDrawer
|
|
|
|
width: parent.width
|
2022-11-09 16:07:51 +03:00
|
|
|
height: parent.height - Style.trayDrawerMargin
|
2022-07-20 20:56:57 +03:00
|
|
|
padding: 0
|
|
|
|
edge: Qt.BottomEdge
|
2022-11-09 16:07:51 +03:00
|
|
|
modal: true
|
2022-07-20 20:56:57 +03:00
|
|
|
visible: false
|
|
|
|
|
|
|
|
background: Rectangle {
|
|
|
|
radius: Systray.useNormalWindow ? 0.0 : Style.trayWindowRadius
|
|
|
|
border.width: Style.trayWindowBorderWidth
|
|
|
|
border.color: Style.menuBorder
|
|
|
|
color: Style.backgroundColor
|
|
|
|
}
|
|
|
|
|
|
|
|
property int userIndex: 0
|
|
|
|
|
|
|
|
function openUserStatusDrawer(index) {
|
|
|
|
console.log(`About to show dialog for user with index ${index}`);
|
|
|
|
userIndex = index;
|
|
|
|
open();
|
|
|
|
}
|
|
|
|
|
|
|
|
Loader {
|
|
|
|
id: userStatusContents
|
|
|
|
anchors.fill: parent
|
|
|
|
active: userStatusDrawer.visible
|
|
|
|
sourceComponent: UserStatusSelectorPage {
|
|
|
|
anchors.fill: parent
|
|
|
|
userIndex: userStatusDrawer.userIndex
|
|
|
|
onFinished: userStatusDrawer.close()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-11-07 16:05:20 +03:00
|
|
|
Drawer {
|
|
|
|
id: fileDetailsDrawer
|
2022-11-09 14:21:07 +03:00
|
|
|
width: parent.width - Style.trayDrawerMargin
|
2022-11-07 16:05:20 +03:00
|
|
|
height: parent.height
|
|
|
|
padding: 0
|
|
|
|
edge: Qt.RightEdge
|
2022-11-09 14:21:07 +03:00
|
|
|
modal: true
|
2022-11-07 16:05:20 +03:00
|
|
|
visible: false
|
2022-12-09 15:42:29 +03:00
|
|
|
clip: true
|
2022-11-07 16:05:20 +03:00
|
|
|
|
|
|
|
background: Rectangle {
|
|
|
|
radius: Systray.useNormalWindow ? 0.0 : Style.trayWindowRadius
|
|
|
|
border.width: Style.trayWindowBorderWidth
|
|
|
|
border.color: Style.menuBorder
|
|
|
|
color: Style.backgroundColor
|
|
|
|
}
|
|
|
|
|
|
|
|
property var folderAccountState: ({})
|
|
|
|
property string fileLocalPath: ""
|
|
|
|
property var pageToShow: Systray.FileDetailsPage.Activity
|
|
|
|
|
|
|
|
function openFileDetails(accountState, localPath, fileDetailsPage) {
|
|
|
|
console.log(`About to show file details view in tray for ${localPath}`);
|
|
|
|
folderAccountState = accountState;
|
|
|
|
fileLocalPath = localPath;
|
|
|
|
pageToShow = fileDetailsPage;
|
|
|
|
|
|
|
|
if(!opened) {
|
|
|
|
open();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Loader {
|
|
|
|
id: fileDetailsContents
|
|
|
|
anchors.fill: parent
|
|
|
|
active: fileDetailsDrawer.visible
|
|
|
|
onActiveChanged: {
|
|
|
|
if (active) {
|
|
|
|
Systray.showFileDetailsPage(fileDetailsDrawer.fileLocalPath,
|
|
|
|
fileDetailsDrawer.pageToShow);
|
|
|
|
}
|
|
|
|
}
|
2022-12-09 15:42:29 +03:00
|
|
|
sourceComponent: FileDetailsView {
|
2022-11-09 14:50:33 +03:00
|
|
|
id: fileDetails
|
2022-11-07 16:05:20 +03:00
|
|
|
|
2022-11-09 15:10:59 +03:00
|
|
|
width: parent.width
|
|
|
|
height: parent.height
|
2022-11-07 16:05:20 +03:00
|
|
|
|
2022-12-09 15:42:29 +03:00
|
|
|
backgroundsVisible: false
|
2022-11-09 14:50:33 +03:00
|
|
|
accountState: fileDetailsDrawer.folderAccountState
|
|
|
|
localPath: fileDetailsDrawer.fileLocalPath
|
|
|
|
showCloseButton: true
|
2022-11-07 16:05:20 +03:00
|
|
|
|
2022-11-09 14:50:33 +03:00
|
|
|
onCloseButtonClicked: fileDetailsDrawer.close()
|
2022-11-07 16:05:20 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-07-20 20:56:57 +03:00
|
|
|
Item {
|
|
|
|
id: trayWindowMainItem
|
2020-01-19 22:13:12 +03:00
|
|
|
|
2022-07-11 18:52:31 +03:00
|
|
|
property bool isUnifiedSearchActive: unifiedSearchResultsListViewSkeletonLoader.active
|
2021-09-09 14:33:57 +03:00
|
|
|
|| unifiedSearchResultNothingFound.visible
|
|
|
|
|| unifiedSearchResultsErrorLabel.visible
|
|
|
|
|| unifiedSearchResultsListView.visible
|
|
|
|
|
2022-11-24 15:19:32 +03:00
|
|
|
anchors.fill: parent
|
|
|
|
anchors.margins: Style.trayWindowBorderWidth
|
2022-07-20 20:56:57 +03:00
|
|
|
clip: true
|
2019-12-08 13:32:22 +03:00
|
|
|
|
2020-08-25 14:16:42 +03:00
|
|
|
Accessible.role: Accessible.Grouping
|
2020-08-25 17:52:05 +03:00
|
|
|
Accessible.name: qsTr("Nextcloud desktop main dialog")
|
2020-08-25 14:16:42 +03:00
|
|
|
|
2019-12-08 13:32:22 +03:00
|
|
|
Rectangle {
|
|
|
|
id: trayWindowHeaderBackground
|
|
|
|
|
2022-07-20 20:56:57 +03:00
|
|
|
anchors.left: trayWindowMainItem.left
|
|
|
|
anchors.right: trayWindowMainItem.right
|
|
|
|
anchors.top: trayWindowMainItem.top
|
2020-01-19 22:13:12 +03:00
|
|
|
height: Style.trayWindowHeaderHeight
|
2022-10-20 14:41:25 +03:00
|
|
|
color: Style.currentUserHeaderColor
|
2020-01-19 22:13:12 +03:00
|
|
|
|
2019-12-08 13:32:22 +03:00
|
|
|
RowLayout {
|
|
|
|
id: trayWindowHeaderLayout
|
2020-01-19 22:13:12 +03:00
|
|
|
|
|
|
|
spacing: 0
|
|
|
|
anchors.fill: parent
|
2019-12-08 13:32:22 +03:00
|
|
|
|
|
|
|
Button {
|
|
|
|
id: currentAccountButton
|
2020-01-19 22:13:12 +03:00
|
|
|
|
|
|
|
Layout.preferredWidth: Style.currentAccountButtonWidth
|
|
|
|
Layout.preferredHeight: Style.trayWindowHeaderHeight
|
|
|
|
display: AbstractButton.IconOnly
|
|
|
|
flat: true
|
2022-02-04 05:39:38 +03:00
|
|
|
palette: Style.systemPalette
|
2019-12-08 13:32:22 +03:00
|
|
|
|
2020-08-25 13:54:56 +03:00
|
|
|
Accessible.role: Accessible.ButtonMenu
|
2020-08-25 15:59:10 +03:00
|
|
|
Accessible.name: qsTr("Current account")
|
2020-09-15 17:45:22 +03:00
|
|
|
Accessible.onPressAction: currentAccountButton.clicked()
|
2020-08-25 13:54:56 +03:00
|
|
|
|
2021-11-12 20:59:33 +03:00
|
|
|
// We call open() instead of popup() because we want to position it
|
|
|
|
// exactly below the dropdown button, not the mouse
|
|
|
|
onClicked: {
|
2022-06-30 17:20:13 +03:00
|
|
|
syncPauseButton.text = Systray.syncIsPaused ? qsTr("Resume sync for all") : qsTr("Pause sync for all")
|
2021-11-12 20:59:33 +03:00
|
|
|
if (accountMenu.visible) {
|
|
|
|
accountMenu.close()
|
|
|
|
} else {
|
|
|
|
accountMenu.open()
|
2019-12-08 13:32:22 +03:00
|
|
|
}
|
2021-11-12 20:59:33 +03:00
|
|
|
}
|
2019-12-08 13:32:22 +03:00
|
|
|
|
2021-11-12 20:59:33 +03:00
|
|
|
Menu {
|
|
|
|
id: accountMenu
|
2020-01-19 22:13:12 +03:00
|
|
|
|
2021-11-12 20:59:33 +03:00
|
|
|
// x coordinate grows towards the right
|
|
|
|
// y coordinate grows towards the bottom
|
|
|
|
x: (currentAccountButton.x + 2)
|
|
|
|
y: (currentAccountButton.y + Style.trayWindowHeaderHeight + 2)
|
2020-01-19 22:13:12 +03:00
|
|
|
|
2021-11-12 20:59:33 +03:00
|
|
|
width: (Style.currentAccountButtonWidth - 2)
|
|
|
|
height: Math.min(implicitHeight, maxMenuHeight)
|
|
|
|
closePolicy: Menu.CloseOnPressOutsideParent | Menu.CloseOnEscape
|
2022-02-04 05:39:38 +03:00
|
|
|
palette: Style.palette
|
2019-12-08 13:32:22 +03:00
|
|
|
|
2021-11-12 20:59:33 +03:00
|
|
|
background: Rectangle {
|
|
|
|
border.color: Style.menuBorder
|
2022-02-04 05:39:38 +03:00
|
|
|
color: Style.backgroundColor
|
2021-11-12 20:59:33 +03:00
|
|
|
radius: Style.currentAccountButtonRadius
|
|
|
|
}
|
2019-12-08 13:32:22 +03:00
|
|
|
|
2022-01-28 15:42:36 +03:00
|
|
|
contentItem: ScrollView {
|
|
|
|
id: accMenuScrollView
|
|
|
|
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
|
|
|
|
|
|
|
|
data: WheelHandler {
|
|
|
|
target: accMenuScrollView.contentItem
|
|
|
|
}
|
|
|
|
ListView {
|
|
|
|
implicitHeight: contentHeight
|
|
|
|
model: accountMenu.contentModel
|
|
|
|
interactive: true
|
|
|
|
clip: true
|
|
|
|
currentIndex: accountMenu.currentIndex
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-11-12 20:59:33 +03:00
|
|
|
onClosed: {
|
|
|
|
// HACK: reload account Instantiator immediately by restting it - could be done better I guess
|
|
|
|
// see also onVisibleChanged above
|
|
|
|
userLineInstantiator.active = false;
|
|
|
|
userLineInstantiator.active = true;
|
|
|
|
}
|
2020-01-12 13:06:48 +03:00
|
|
|
|
2021-11-12 20:59:33 +03:00
|
|
|
Instantiator {
|
|
|
|
id: userLineInstantiator
|
|
|
|
model: UserModel
|
|
|
|
delegate: UserLine {
|
2022-07-20 20:56:57 +03:00
|
|
|
onShowUserStatusSelector: {
|
|
|
|
userStatusDrawer.openUserStatusDrawer(model.index);
|
2022-06-07 19:53:46 +03:00
|
|
|
accountMenu.close();
|
2021-09-09 12:18:22 +03:00
|
|
|
}
|
2022-08-10 16:39:14 +03:00
|
|
|
onClicked: UserModel.currentUserId = model.index;
|
2019-12-08 13:32:22 +03:00
|
|
|
}
|
2021-11-12 20:59:33 +03:00
|
|
|
onObjectAdded: accountMenu.insertItem(index, object)
|
|
|
|
onObjectRemoved: accountMenu.removeItem(object)
|
|
|
|
}
|
2019-12-08 13:32:22 +03:00
|
|
|
|
2021-11-12 20:59:33 +03:00
|
|
|
MenuItem {
|
|
|
|
id: addAccountButton
|
|
|
|
height: Style.addAccountButtonHeight
|
|
|
|
hoverEnabled: true
|
2022-02-04 05:39:38 +03:00
|
|
|
palette: Theme.systemPalette
|
2020-01-11 22:28:00 +03:00
|
|
|
|
2021-11-12 20:59:33 +03:00
|
|
|
background: Item {
|
|
|
|
height: parent.height
|
|
|
|
width: parent.menu.width
|
|
|
|
Rectangle {
|
2020-01-19 22:13:12 +03:00
|
|
|
anchors.fill: parent
|
2021-11-12 20:59:33 +03:00
|
|
|
anchors.margins: 1
|
|
|
|
color: parent.parent.hovered || parent.parent.visualFocus ? Style.lightHover : "transparent"
|
2020-01-11 22:28:00 +03:00
|
|
|
}
|
2020-01-04 19:22:56 +03:00
|
|
|
}
|
|
|
|
|
2021-11-12 20:59:33 +03:00
|
|
|
RowLayout {
|
|
|
|
anchors.fill: parent
|
|
|
|
spacing: 0
|
|
|
|
|
|
|
|
Image {
|
|
|
|
Layout.leftMargin: 12
|
|
|
|
verticalAlignment: Qt.AlignCenter
|
2022-03-21 19:34:21 +03:00
|
|
|
source: Theme.darkMode ? "qrc:///client/theme/white/add.svg" : "qrc:///client/theme/black/add.svg"
|
2021-11-12 20:59:33 +03:00
|
|
|
sourceSize.width: Style.headerButtonIconSize
|
|
|
|
sourceSize.height: Style.headerButtonIconSize
|
|
|
|
}
|
2022-12-02 16:51:09 +03:00
|
|
|
EnforcedPlainTextLabel {
|
2021-11-12 20:59:33 +03:00
|
|
|
Layout.leftMargin: 14
|
|
|
|
text: qsTr("Add account")
|
2022-02-04 05:39:38 +03:00
|
|
|
color: Style.ncTextColor
|
2021-11-12 20:59:33 +03:00
|
|
|
font.pixelSize: Style.topLinePixelSize
|
|
|
|
}
|
|
|
|
// Filler on the right
|
|
|
|
Item {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
2020-06-22 01:49:06 +03:00
|
|
|
}
|
|
|
|
}
|
2021-11-12 20:59:33 +03:00
|
|
|
onClicked: UserModel.addAccount()
|
2020-01-04 19:22:56 +03:00
|
|
|
|
2021-11-12 20:59:33 +03:00
|
|
|
Accessible.role: Accessible.MenuItem
|
|
|
|
Accessible.name: qsTr("Add new account")
|
|
|
|
Accessible.onPressAction: addAccountButton.clicked()
|
|
|
|
}
|
2020-08-25 13:54:56 +03:00
|
|
|
|
2022-08-02 13:54:16 +03:00
|
|
|
Rectangle {
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: parent.right
|
|
|
|
implicitHeight: 1
|
|
|
|
color: Style.menuBorder
|
2021-11-12 20:59:33 +03:00
|
|
|
}
|
2020-01-05 18:25:32 +03:00
|
|
|
|
2021-11-12 20:59:33 +03:00
|
|
|
MenuItem {
|
|
|
|
id: syncPauseButton
|
|
|
|
font.pixelSize: Style.topLinePixelSize
|
2022-02-04 05:39:38 +03:00
|
|
|
palette.windowText: Style.ncTextColor
|
2021-11-12 20:59:33 +03:00
|
|
|
hoverEnabled: true
|
2022-06-30 17:20:13 +03:00
|
|
|
onClicked: Systray.syncIsPaused = !Systray.syncIsPaused
|
2020-08-25 13:54:56 +03:00
|
|
|
|
2021-11-12 20:59:33 +03:00
|
|
|
background: Item {
|
|
|
|
height: parent.height
|
|
|
|
width: parent.menu.width
|
|
|
|
Rectangle {
|
|
|
|
anchors.fill: parent
|
|
|
|
anchors.margins: 1
|
|
|
|
color: parent.parent.hovered || parent.parent.visualFocus ? Style.lightHover : "transparent"
|
|
|
|
}
|
2020-01-04 19:22:56 +03:00
|
|
|
}
|
|
|
|
|
2021-11-12 20:59:33 +03:00
|
|
|
Accessible.role: Accessible.MenuItem
|
2022-06-30 17:20:13 +03:00
|
|
|
Accessible.name: Systray.syncIsPaused ? qsTr("Resume sync for all") : qsTr("Pause sync for all")
|
2021-11-12 20:59:33 +03:00
|
|
|
Accessible.onPressAction: syncPauseButton.clicked()
|
|
|
|
}
|
|
|
|
|
|
|
|
MenuItem {
|
|
|
|
id: settingsButton
|
|
|
|
text: qsTr("Settings")
|
|
|
|
font.pixelSize: Style.topLinePixelSize
|
2022-02-04 05:39:38 +03:00
|
|
|
palette.windowText: Style.ncTextColor
|
2021-11-12 20:59:33 +03:00
|
|
|
hoverEnabled: true
|
|
|
|
onClicked: Systray.openSettings()
|
|
|
|
|
|
|
|
background: Item {
|
|
|
|
height: parent.height
|
|
|
|
width: parent.menu.width
|
|
|
|
Rectangle {
|
|
|
|
anchors.fill: parent
|
|
|
|
anchors.margins: 1
|
|
|
|
color: parent.parent.hovered || parent.parent.visualFocus ? Style.lightHover : "transparent"
|
2020-07-06 14:55:14 +03:00
|
|
|
}
|
2021-11-12 20:59:33 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
Accessible.role: Accessible.MenuItem
|
|
|
|
Accessible.name: text
|
|
|
|
Accessible.onPressAction: settingsButton.clicked()
|
|
|
|
}
|
2020-08-25 13:54:56 +03:00
|
|
|
|
2021-11-12 20:59:33 +03:00
|
|
|
MenuItem {
|
|
|
|
id: exitButton
|
|
|
|
text: qsTr("Exit");
|
|
|
|
font.pixelSize: Style.topLinePixelSize
|
2022-02-04 05:39:38 +03:00
|
|
|
palette.windowText: Style.ncTextColor
|
2021-11-12 20:59:33 +03:00
|
|
|
hoverEnabled: true
|
|
|
|
onClicked: Systray.shutdown()
|
|
|
|
|
|
|
|
background: Item {
|
|
|
|
height: parent.height
|
|
|
|
width: parent.menu.width
|
|
|
|
Rectangle {
|
|
|
|
anchors.fill: parent
|
|
|
|
anchors.margins: 1
|
|
|
|
color: parent.parent.hovered || parent.parent.visualFocus ? Style.lightHover : "transparent"
|
|
|
|
}
|
2020-01-04 19:22:56 +03:00
|
|
|
}
|
2021-11-12 20:59:33 +03:00
|
|
|
|
|
|
|
Accessible.role: Accessible.MenuItem
|
|
|
|
Accessible.name: text
|
|
|
|
Accessible.onPressAction: exitButton.clicked()
|
2019-12-08 13:32:22 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-07-27 18:27:23 +03:00
|
|
|
background: Rectangle {
|
2022-10-20 14:41:25 +03:00
|
|
|
color: parent.hovered || parent.visualFocus ? Style.currentUserHeaderTextColor : "transparent"
|
2020-07-27 18:27:23 +03:00
|
|
|
opacity: 0.2
|
2019-12-08 13:32:22 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
id: accountControlRowLayout
|
2020-01-19 22:13:12 +03:00
|
|
|
|
|
|
|
height: Style.trayWindowHeaderHeight
|
|
|
|
width: Style.currentAccountButtonWidth
|
2019-12-08 13:32:22 +03:00
|
|
|
spacing: 0
|
2020-08-25 13:54:56 +03:00
|
|
|
|
2019-12-08 13:32:22 +03:00
|
|
|
Image {
|
|
|
|
id: currentAccountAvatar
|
2020-01-19 22:13:12 +03:00
|
|
|
|
2022-01-20 14:54:36 +03:00
|
|
|
Layout.leftMargin: Style.trayHorizontalMargin
|
2019-12-08 13:32:22 +03:00
|
|
|
verticalAlignment: Qt.AlignCenter
|
2020-01-03 15:09:29 +03:00
|
|
|
cache: false
|
2020-07-21 14:24:59 +03:00
|
|
|
source: UserModel.currentUser.avatar != "" ? UserModel.currentUser.avatar : "image://avatars/fallbackWhite"
|
2020-01-19 22:13:12 +03:00
|
|
|
Layout.preferredHeight: Style.accountAvatarSize
|
|
|
|
Layout.preferredWidth: Style.accountAvatarSize
|
|
|
|
|
2020-08-25 13:54:56 +03:00
|
|
|
Accessible.role: Accessible.Graphic
|
2022-06-23 12:13:18 +03:00
|
|
|
Accessible.name: qsTr("Current account avatar")
|
2020-08-25 13:54:56 +03:00
|
|
|
|
2020-01-15 22:11:50 +03:00
|
|
|
Rectangle {
|
2021-03-16 22:24:11 +03:00
|
|
|
id: currentAccountStatusIndicatorBackground
|
2021-05-17 22:34:22 +03:00
|
|
|
visible: UserModel.currentUser.isConnected
|
|
|
|
&& UserModel.currentUser.serverHasUserStatus
|
2023-04-21 18:48:44 +03:00
|
|
|
width: Style.accountAvatarStateIndicatorSize + + Style.trayFolderStatusIndicatorSizeOffset
|
2020-01-15 22:11:50 +03:00
|
|
|
height: width
|
|
|
|
anchors.bottom: currentAccountAvatar.bottom
|
|
|
|
anchors.right: currentAccountAvatar.right
|
2022-10-20 14:41:25 +03:00
|
|
|
color: Style.currentUserHeaderColor
|
2023-04-21 18:48:44 +03:00
|
|
|
radius: width * Style.trayFolderStatusIndicatorRadiusFactor
|
2020-01-15 22:11:50 +03:00
|
|
|
}
|
2020-01-19 22:13:12 +03:00
|
|
|
|
2020-10-21 12:24:06 +03:00
|
|
|
Rectangle {
|
2021-04-19 18:19:04 +03:00
|
|
|
id: currentAccountStatusIndicatorMouseHover
|
2021-05-17 22:34:22 +03:00
|
|
|
visible: UserModel.currentUser.isConnected
|
|
|
|
&& UserModel.currentUser.serverHasUserStatus
|
2023-04-21 18:48:44 +03:00
|
|
|
width: Style.accountAvatarStateIndicatorSize + + Style.trayFolderStatusIndicatorSizeOffset
|
2020-10-21 12:24:06 +03:00
|
|
|
height: width
|
|
|
|
anchors.bottom: currentAccountAvatar.bottom
|
|
|
|
anchors.right: currentAccountAvatar.right
|
2022-10-20 14:41:25 +03:00
|
|
|
color: currentAccountButton.hovered ? Style.currentUserHeaderTextColor : "transparent"
|
2023-04-21 18:48:44 +03:00
|
|
|
opacity: Style.trayFolderStatusIndicatorMouseHoverOpacityFactor
|
|
|
|
radius: width * Style.trayFolderStatusIndicatorRadiusFactor
|
2020-10-21 12:24:06 +03:00
|
|
|
}
|
|
|
|
|
2020-01-12 11:10:06 +03:00
|
|
|
Image {
|
2021-03-16 22:24:11 +03:00
|
|
|
id: currentAccountStatusIndicator
|
2021-05-17 22:34:22 +03:00
|
|
|
visible: UserModel.currentUser.isConnected
|
2021-05-18 21:45:34 +03:00
|
|
|
&& UserModel.currentUser.serverHasUserStatus
|
2021-03-16 22:24:11 +03:00
|
|
|
source: UserModel.currentUser.statusIcon
|
2020-01-12 11:10:06 +03:00
|
|
|
cache: false
|
2021-03-16 22:24:11 +03:00
|
|
|
x: currentAccountStatusIndicatorBackground.x + 1
|
|
|
|
y: currentAccountStatusIndicatorBackground.y + 1
|
2020-01-19 22:13:12 +03:00
|
|
|
sourceSize.width: Style.accountAvatarStateIndicatorSize
|
|
|
|
sourceSize.height: Style.accountAvatarStateIndicatorSize
|
2020-08-25 13:54:56 +03:00
|
|
|
|
|
|
|
Accessible.role: Accessible.Indicator
|
2022-06-23 12:13:18 +03:00
|
|
|
Accessible.name: UserModel.desktopNotificationsAllowed ? qsTr("Current account status is online") : qsTr("Current account status is do not disturb")
|
2020-01-12 11:10:06 +03:00
|
|
|
}
|
2019-12-08 13:32:22 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
Column {
|
|
|
|
id: accountLabels
|
2021-05-25 23:17:33 +03:00
|
|
|
spacing: 0
|
|
|
|
Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
|
2021-05-18 23:28:59 +03:00
|
|
|
Layout.leftMargin: Style.userStatusSpacing
|
2021-07-15 14:06:04 +03:00
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.maximumWidth: parent.width
|
|
|
|
|
2022-12-02 16:51:09 +03:00
|
|
|
EnforcedPlainTextLabel {
|
2019-12-08 13:32:22 +03:00
|
|
|
id: currentAccountUser
|
2021-05-25 23:17:33 +03:00
|
|
|
Layout.alignment: Qt.AlignLeft | Qt.AlignBottom
|
2020-01-19 22:13:12 +03:00
|
|
|
width: Style.currentAccountLabelWidth
|
2020-06-16 15:06:30 +03:00
|
|
|
text: UserModel.currentUser.name
|
2020-01-05 23:06:42 +03:00
|
|
|
elide: Text.ElideRight
|
2022-10-20 14:41:25 +03:00
|
|
|
color: Style.currentUserHeaderTextColor
|
2022-02-04 05:39:38 +03:00
|
|
|
|
2020-01-19 22:13:12 +03:00
|
|
|
font.pixelSize: Style.topLinePixelSize
|
2019-12-08 13:32:22 +03:00
|
|
|
font.bold: true
|
|
|
|
}
|
2021-07-15 14:06:04 +03:00
|
|
|
|
2023-03-10 17:08:07 +03:00
|
|
|
EnforcedPlainTextLabel {
|
|
|
|
id: currentAccountServer
|
|
|
|
Layout.alignment: Qt.AlignLeft | Qt.AlignBottom
|
|
|
|
width: Style.currentAccountLabelWidth
|
|
|
|
text: UserModel.currentUser.server
|
|
|
|
elide: Text.ElideRight
|
|
|
|
color: Style.currentUserHeaderTextColor
|
|
|
|
visible: UserModel.numUsers() > 1
|
|
|
|
}
|
|
|
|
|
2021-05-25 23:17:33 +03:00
|
|
|
RowLayout {
|
2020-10-03 18:12:16 +03:00
|
|
|
id: currentUserStatus
|
2021-05-17 22:34:22 +03:00
|
|
|
visible: UserModel.currentUser.isConnected &&
|
2021-05-18 21:45:34 +03:00
|
|
|
UserModel.currentUser.serverHasUserStatus
|
2021-05-25 23:17:33 +03:00
|
|
|
spacing: Style.accountLabelsSpacing
|
2021-07-15 14:06:04 +03:00
|
|
|
width: parent.width
|
|
|
|
|
2022-12-02 16:51:09 +03:00
|
|
|
EnforcedPlainTextLabel {
|
2021-05-18 21:45:34 +03:00
|
|
|
id: emoji
|
|
|
|
visible: UserModel.currentUser.statusEmoji !== ""
|
|
|
|
width: Style.userStatusEmojiSize
|
|
|
|
text: UserModel.currentUser.statusEmoji
|
|
|
|
}
|
2022-12-02 16:51:09 +03:00
|
|
|
EnforcedPlainTextLabel {
|
2021-05-18 21:45:34 +03:00
|
|
|
id: message
|
2021-05-25 23:17:33 +03:00
|
|
|
Layout.alignment: Qt.AlignLeft | Qt.AlignBottom
|
2021-07-15 14:06:04 +03:00
|
|
|
Layout.fillWidth: true
|
2021-05-18 21:45:34 +03:00
|
|
|
visible: UserModel.currentUser.statusMessage !== ""
|
|
|
|
width: Style.currentAccountLabelWidth
|
|
|
|
text: UserModel.currentUser.statusMessage !== ""
|
2021-09-09 14:33:57 +03:00
|
|
|
? UserModel.currentUser.statusMessage
|
2021-05-18 21:45:34 +03:00
|
|
|
: UserModel.currentUser.server
|
|
|
|
elide: Text.ElideRight
|
2022-10-20 14:41:25 +03:00
|
|
|
color: Style.currentUserHeaderTextColor
|
2021-05-18 21:45:34 +03:00
|
|
|
font.pixelSize: Style.subLinePixelSize
|
|
|
|
}
|
2021-04-19 18:19:04 +03:00
|
|
|
}
|
2019-12-08 13:32:22 +03:00
|
|
|
}
|
|
|
|
|
2020-12-10 19:43:45 +03:00
|
|
|
ColorOverlay {
|
|
|
|
cached: true
|
2022-10-20 14:41:25 +03:00
|
|
|
color: Style.currentUserHeaderTextColor
|
2020-12-10 19:43:45 +03:00
|
|
|
width: source.width
|
|
|
|
height: source.height
|
|
|
|
source: Image {
|
|
|
|
Layout.alignment: Qt.AlignRight
|
|
|
|
verticalAlignment: Qt.AlignCenter
|
|
|
|
Layout.margins: Style.accountDropDownCaretMargin
|
|
|
|
source: "qrc:///client/theme/white/caret-down.svg"
|
|
|
|
sourceSize.width: Style.accountDropDownCaretSize
|
|
|
|
sourceSize.height: Style.accountDropDownCaretSize
|
2021-06-08 22:04:53 +03:00
|
|
|
Accessible.role: Accessible.PopupMenu
|
2021-05-25 16:07:21 +03:00
|
|
|
Accessible.name: qsTr("Account switcher and settings menu")
|
2020-12-10 19:43:45 +03:00
|
|
|
}
|
2019-12-08 13:32:22 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-06-21 14:33:22 +03:00
|
|
|
// Add space between items
|
|
|
|
Item {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
}
|
2021-09-09 14:33:57 +03:00
|
|
|
|
2023-04-21 18:48:44 +03:00
|
|
|
TrayFoldersMenuButton {
|
|
|
|
id: openLocalFolderButton
|
2021-09-09 14:33:57 +03:00
|
|
|
|
2023-04-21 18:48:44 +03:00
|
|
|
visible: currentUser.hasLocalFolder
|
|
|
|
currentUser: UserModel.currentUser
|
2021-09-09 14:33:57 +03:00
|
|
|
|
2023-04-21 18:48:44 +03:00
|
|
|
Layout.preferredWidth: Style.iconButtonWidth * Style.trayFolderListButtonWidthScaleFactor
|
|
|
|
Layout.alignment: Qt.AlignHCenter
|
2021-09-09 14:33:57 +03:00
|
|
|
|
2023-04-21 18:48:44 +03:00
|
|
|
onClicked: openLocalFolderButton.userHasGroupFolders ? openLocalFolderButton.toggleMenuOpen() : UserModel.openCurrentAccountLocalFolder()
|
2022-01-28 19:03:39 +03:00
|
|
|
|
2023-04-21 18:48:44 +03:00
|
|
|
onFolderEntryTriggered: isGroupFolder ? UserModel.openCurrentAccountFolderFromTrayInfo(fullFolderPath) : UserModel.openCurrentAccountLocalFolder()
|
2021-03-16 22:24:11 +03:00
|
|
|
}
|
|
|
|
|
2020-06-15 16:35:34 +03:00
|
|
|
HeaderButton {
|
2019-12-08 13:32:22 +03:00
|
|
|
id: trayWindowTalkButton
|
2021-09-09 14:33:57 +03:00
|
|
|
|
2020-06-16 15:06:30 +03:00
|
|
|
visible: UserModel.currentUser.serverHasTalk
|
2019-12-08 13:32:22 +03:00
|
|
|
icon.source: "qrc:///client/theme/white/talk-app.svg"
|
2022-10-20 14:41:25 +03:00
|
|
|
icon.color: Style.currentUserHeaderTextColor
|
2020-06-15 18:01:39 +03:00
|
|
|
onClicked: UserModel.openCurrentAccountTalk()
|
2021-09-09 14:33:57 +03:00
|
|
|
|
2020-08-25 13:54:56 +03:00
|
|
|
Accessible.role: Accessible.Button
|
2020-08-25 17:52:05 +03:00
|
|
|
Accessible.name: qsTr("Open Nextcloud Talk in browser")
|
2020-09-15 17:45:22 +03:00
|
|
|
Accessible.onPressAction: trayWindowTalkButton.clicked()
|
2019-12-08 13:32:22 +03:00
|
|
|
}
|
|
|
|
|
2020-06-15 16:35:34 +03:00
|
|
|
HeaderButton {
|
2019-12-08 13:32:22 +03:00
|
|
|
id: trayWindowAppsButton
|
|
|
|
icon.source: "qrc:///client/theme/white/more-apps.svg"
|
2022-10-20 14:41:25 +03:00
|
|
|
icon.color: Style.currentUserHeaderTextColor
|
2021-09-09 14:33:57 +03:00
|
|
|
|
2020-06-15 16:35:34 +03:00
|
|
|
onClicked: {
|
2022-07-12 19:48:36 +03:00
|
|
|
if(appsMenuListView.count <= 0) {
|
2020-09-14 18:25:20 +03:00
|
|
|
UserModel.openCurrentAccountServer()
|
2020-09-14 19:03:57 +03:00
|
|
|
} else if (appsMenu.visible) {
|
|
|
|
appsMenu.close()
|
|
|
|
} else {
|
|
|
|
appsMenu.open()
|
2019-12-08 13:32:22 +03:00
|
|
|
}
|
2020-06-15 16:35:34 +03:00
|
|
|
}
|
2020-01-15 18:42:06 +03:00
|
|
|
|
2020-08-25 13:54:56 +03:00
|
|
|
Accessible.role: Accessible.ButtonMenu
|
2020-08-25 17:52:05 +03:00
|
|
|
Accessible.name: qsTr("More apps")
|
2020-09-15 17:45:22 +03:00
|
|
|
Accessible.onPressAction: trayWindowAppsButton.clicked()
|
2020-08-25 13:54:56 +03:00
|
|
|
|
2022-07-12 19:48:36 +03:00
|
|
|
Menu {
|
2020-06-15 16:35:34 +03:00
|
|
|
id: appsMenu
|
2023-04-21 18:48:44 +03:00
|
|
|
x: Style.trayWindowMenuOffsetX
|
|
|
|
y: (trayWindowAppsButton.y + trayWindowAppsButton.height + Style.trayWindowMenuOffsetY)
|
|
|
|
width: Style.trayWindowWidth * Style.trayWindowMenuWidthFactor
|
2022-07-12 19:48:36 +03:00
|
|
|
height: implicitHeight + y > Style.trayWindowHeight ? Style.trayWindowHeight - y : implicitHeight
|
2020-09-14 19:03:57 +03:00
|
|
|
closePolicy: Menu.CloseOnPressOutsideParent | Menu.CloseOnEscape
|
2020-01-15 18:42:06 +03:00
|
|
|
|
2020-06-15 16:35:34 +03:00
|
|
|
background: Rectangle {
|
2020-06-15 20:06:59 +03:00
|
|
|
border.color: Style.menuBorder
|
2022-02-04 05:39:38 +03:00
|
|
|
color: Style.backgroundColor
|
2020-06-15 16:35:34 +03:00
|
|
|
radius: 2
|
2020-01-15 18:42:06 +03:00
|
|
|
}
|
2019-12-08 13:32:22 +03:00
|
|
|
|
2022-07-12 19:48:36 +03:00
|
|
|
contentItem: ScrollView {
|
|
|
|
id: appsMenuScrollView
|
|
|
|
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
|
|
|
|
|
|
|
|
data: WheelHandler {
|
2022-08-04 15:52:59 +03:00
|
|
|
target: appsMenuScrollView.contentItem
|
2022-07-12 19:48:36 +03:00
|
|
|
}
|
|
|
|
ListView {
|
|
|
|
id: appsMenuListView
|
|
|
|
implicitHeight: contentHeight
|
|
|
|
model: UserAppsModel
|
|
|
|
interactive: true
|
|
|
|
clip: true
|
|
|
|
currentIndex: appsMenu.currentIndex
|
|
|
|
delegate: MenuItem {
|
|
|
|
id: appEntry
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: parent.right
|
|
|
|
|
|
|
|
text: model.appName
|
|
|
|
font.pixelSize: Style.topLinePixelSize
|
|
|
|
palette.windowText: Style.ncTextColor
|
|
|
|
icon.source: model.appIconUrl
|
|
|
|
icon.color: Style.ncTextColor
|
|
|
|
onTriggered: UserAppsModel.openAppUrl(appUrl)
|
|
|
|
hoverEnabled: true
|
|
|
|
|
|
|
|
background: Item {
|
|
|
|
height: parent.height
|
|
|
|
width: parent.width
|
|
|
|
Rectangle {
|
|
|
|
anchors.fill: parent
|
|
|
|
anchors.margins: 1
|
|
|
|
color: parent.parent.hovered || parent.parent.visualFocus ? Style.lightHover : "transparent"
|
|
|
|
}
|
2022-02-04 05:39:38 +03:00
|
|
|
}
|
|
|
|
|
2022-07-12 19:48:36 +03:00
|
|
|
Accessible.role: Accessible.MenuItem
|
|
|
|
Accessible.name: qsTr("Open %1 in browser").arg(model.appName)
|
|
|
|
Accessible.onPressAction: appEntry.triggered()
|
|
|
|
}
|
2019-12-08 13:32:22 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} // Rectangle trayWindowHeaderBackground
|
|
|
|
|
2021-09-09 14:33:57 +03:00
|
|
|
UnifiedSearchInputContainer {
|
|
|
|
id: trayWindowUnifiedSearchInputContainer
|
|
|
|
height: Style.trayWindowHeaderHeight * 0.65
|
|
|
|
|
|
|
|
anchors {
|
|
|
|
top: trayWindowHeaderBackground.bottom
|
2022-07-20 20:56:57 +03:00
|
|
|
left: trayWindowMainItem.left
|
|
|
|
right: trayWindowMainItem.right
|
2021-09-09 14:33:57 +03:00
|
|
|
|
2022-01-20 14:54:36 +03:00
|
|
|
topMargin: Style.trayHorizontalMargin + controlRoot.padding
|
|
|
|
leftMargin: Style.trayHorizontalMargin + controlRoot.padding
|
|
|
|
rightMargin: Style.trayHorizontalMargin + controlRoot.padding
|
2021-09-09 14:33:57 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
text: UserModel.currentUser.unifiedSearchResultsListModel.searchTerm
|
|
|
|
readOnly: !UserModel.currentUser.isConnected || UserModel.currentUser.unifiedSearchResultsListModel.currentFetchMoreInProgressProviderId
|
|
|
|
isSearchInProgress: UserModel.currentUser.unifiedSearchResultsListModel.isSearchInProgress
|
|
|
|
onTextEdited: { UserModel.currentUser.unifiedSearchResultsListModel.searchTerm = trayWindowUnifiedSearchInputContainer.text }
|
2021-11-03 11:00:33 +03:00
|
|
|
onClearText: { UserModel.currentUser.unifiedSearchResultsListModel.searchTerm = "" }
|
2021-09-09 14:33:57 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
ErrorBox {
|
|
|
|
id: unifiedSearchResultsErrorLabel
|
|
|
|
visible: UserModel.currentUser.unifiedSearchResultsListModel.errorString && !unifiedSearchResultsListView.visible && ! UserModel.currentUser.unifiedSearchResultsListModel.isSearchInProgress && ! UserModel.currentUser.unifiedSearchResultsListModel.currentFetchMoreInProgressProviderId
|
|
|
|
text: UserModel.currentUser.unifiedSearchResultsListModel.errorString
|
|
|
|
anchors.top: trayWindowUnifiedSearchInputContainer.bottom
|
2022-07-20 20:56:57 +03:00
|
|
|
anchors.left: trayWindowMainItem.left
|
|
|
|
anchors.right: trayWindowMainItem.right
|
2022-01-20 14:54:36 +03:00
|
|
|
anchors.margins: Style.trayHorizontalMargin
|
2021-09-09 14:33:57 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
UnifiedSearchResultNothingFound {
|
|
|
|
id: unifiedSearchResultNothingFound
|
2022-07-18 17:27:04 +03:00
|
|
|
|
2021-09-09 14:33:57 +03:00
|
|
|
anchors.top: trayWindowUnifiedSearchInputContainer.bottom
|
2022-07-20 20:56:57 +03:00
|
|
|
anchors.left: trayWindowMainItem.left
|
|
|
|
anchors.right: trayWindowMainItem.right
|
2022-01-20 14:54:36 +03:00
|
|
|
anchors.topMargin: Style.trayHorizontalMargin
|
2021-09-09 14:33:57 +03:00
|
|
|
|
|
|
|
text: UserModel.currentUser.unifiedSearchResultsListModel.searchTerm
|
|
|
|
|
|
|
|
property bool isSearchRunning: UserModel.currentUser.unifiedSearchResultsListModel.isSearchInProgress
|
2022-07-18 17:27:04 +03:00
|
|
|
property bool waitingForSearchTermEditEnd: UserModel.currentUser.unifiedSearchResultsListModel.waitingForSearchTermEditEnd
|
2021-09-09 14:33:57 +03:00
|
|
|
property bool isSearchResultsEmpty: unifiedSearchResultsListView.count === 0
|
|
|
|
property bool nothingFound: text && isSearchResultsEmpty && !UserModel.currentUser.unifiedSearchResultsListModel.errorString
|
|
|
|
|
2022-07-18 17:27:04 +03:00
|
|
|
visible: !isSearchRunning && !waitingForSearchTermEditEnd && nothingFound
|
2021-09-09 14:33:57 +03:00
|
|
|
}
|
|
|
|
|
2022-07-11 18:52:31 +03:00
|
|
|
Loader {
|
|
|
|
id: unifiedSearchResultsListViewSkeletonLoader
|
2022-08-09 00:40:19 +03:00
|
|
|
|
2021-09-09 14:33:57 +03:00
|
|
|
anchors.top: trayWindowUnifiedSearchInputContainer.bottom
|
2022-07-20 20:56:57 +03:00
|
|
|
anchors.left: trayWindowMainItem.left
|
|
|
|
anchors.right: trayWindowMainItem.right
|
|
|
|
anchors.bottom: trayWindowMainItem.bottom
|
2022-08-09 00:40:19 +03:00
|
|
|
anchors.margins: controlRoot.padding
|
2022-07-11 18:52:31 +03:00
|
|
|
|
|
|
|
active: !unifiedSearchResultNothingFound.visible &&
|
|
|
|
!unifiedSearchResultsListView.visible &&
|
|
|
|
!UserModel.currentUser.unifiedSearchResultsListModel.errorString &&
|
|
|
|
UserModel.currentUser.unifiedSearchResultsListModel.searchTerm
|
|
|
|
|
|
|
|
sourceComponent: UnifiedSearchResultItemSkeletonContainer {
|
|
|
|
anchors.fill: parent
|
2022-08-09 00:40:19 +03:00
|
|
|
spacing: unifiedSearchResultsListView.spacing
|
2022-07-11 18:52:31 +03:00
|
|
|
animationRectangleWidth: trayWindow.width
|
|
|
|
}
|
2021-09-09 14:33:57 +03:00
|
|
|
}
|
|
|
|
|
2021-11-12 23:02:58 +03:00
|
|
|
ScrollView {
|
|
|
|
id: controlRoot
|
|
|
|
contentWidth: availableWidth
|
|
|
|
|
|
|
|
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
|
|
|
|
|
|
|
|
data: WheelHandler {
|
|
|
|
target: controlRoot.contentItem
|
|
|
|
}
|
|
|
|
visible: unifiedSearchResultsListView.count > 0
|
|
|
|
|
2021-09-09 14:33:57 +03:00
|
|
|
anchors.top: trayWindowUnifiedSearchInputContainer.bottom
|
2022-07-20 20:56:57 +03:00
|
|
|
anchors.left: trayWindowMainItem.left
|
|
|
|
anchors.right: trayWindowMainItem.right
|
|
|
|
anchors.bottom: trayWindowMainItem.bottom
|
2021-09-09 14:33:57 +03:00
|
|
|
|
2021-11-12 23:02:58 +03:00
|
|
|
ListView {
|
|
|
|
id: unifiedSearchResultsListView
|
|
|
|
spacing: 4
|
|
|
|
clip: true
|
|
|
|
|
|
|
|
keyNavigationEnabled: true
|
|
|
|
|
|
|
|
reuseItems: true
|
|
|
|
|
|
|
|
Accessible.role: Accessible.List
|
|
|
|
Accessible.name: qsTr("Unified search results list")
|
|
|
|
|
|
|
|
model: UserModel.currentUser.unifiedSearchResultsListModel
|
|
|
|
|
|
|
|
delegate: UnifiedSearchResultListItem {
|
|
|
|
width: unifiedSearchResultsListView.width
|
|
|
|
isSearchInProgress: unifiedSearchResultsListView.model.isSearchInProgress
|
|
|
|
currentFetchMoreInProgressProviderId: unifiedSearchResultsListView.model.currentFetchMoreInProgressProviderId
|
|
|
|
fetchMoreTriggerClicked: unifiedSearchResultsListView.model.fetchMoreTriggerClicked
|
|
|
|
resultClicked: unifiedSearchResultsListView.model.resultClicked
|
|
|
|
ListView.onPooled: isPooled = true
|
|
|
|
ListView.onReused: isPooled = false
|
|
|
|
}
|
2021-09-09 14:33:57 +03:00
|
|
|
|
2021-11-12 23:02:58 +03:00
|
|
|
section.property: "providerName"
|
|
|
|
section.criteria: ViewSection.FullString
|
|
|
|
section.delegate: UnifiedSearchResultSectionItem {
|
|
|
|
width: unifiedSearchResultsListView.width
|
|
|
|
}
|
2021-09-09 14:33:57 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-09-14 14:17:03 +03:00
|
|
|
SyncStatus {
|
|
|
|
id: syncStatus
|
|
|
|
|
2022-07-20 20:56:57 +03:00
|
|
|
visible: !trayWindowMainItem.isUnifiedSearchActive
|
2021-09-09 14:33:57 +03:00
|
|
|
|
|
|
|
anchors.top: trayWindowUnifiedSearchInputContainer.bottom
|
2022-07-20 20:56:57 +03:00
|
|
|
anchors.left: trayWindowMainItem.left
|
|
|
|
anchors.right: trayWindowMainItem.right
|
2021-09-14 14:17:03 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
ActivityList {
|
2022-07-20 20:56:57 +03:00
|
|
|
visible: !trayWindowMainItem.isUnifiedSearchActive
|
2021-09-14 14:17:03 +03:00
|
|
|
anchors.top: syncStatus.bottom
|
2022-07-20 20:56:57 +03:00
|
|
|
anchors.left: trayWindowMainItem.left
|
|
|
|
anchors.right: trayWindowMainItem.right
|
|
|
|
anchors.bottom: trayWindowMainItem.bottom
|
2021-09-09 14:33:57 +03:00
|
|
|
|
2021-11-12 22:17:15 +03:00
|
|
|
activeFocusOnTab: true
|
2021-09-14 14:17:03 +03:00
|
|
|
model: activityModel
|
2022-07-18 15:33:55 +03:00
|
|
|
onOpenFile: Qt.openUrlExternally(filePath);
|
2021-09-14 14:17:03 +03:00
|
|
|
onActivityItemClicked: {
|
2022-01-04 17:28:26 +03:00
|
|
|
model.slotTriggerDefaultAction(index)
|
2021-09-14 14:17:03 +03:00
|
|
|
}
|
|
|
|
}
|
2022-07-20 20:56:57 +03:00
|
|
|
} // Item trayWindowMainItem
|
2019-12-08 13:32:22 +03:00
|
|
|
}
|