2020-01-12 18:16:24 +03:00
|
|
|
import QtQml 2.1
|
|
|
|
import QtQml.Models 2.1
|
2019-12-08 13:32:22 +03:00
|
|
|
import QtQuick 2.9
|
2020-01-21 15:54:04 +03:00
|
|
|
import QtQuick.Window 2.3
|
2019-12-08 13:32:22 +03:00
|
|
|
import QtQuick.Controls 2.2
|
|
|
|
import QtQuick.Layouts 1.2
|
|
|
|
import QtGraphicalEffects 1.0
|
|
|
|
|
2020-01-19 22:13:12 +03:00
|
|
|
// Custom qml modules are in /theme (and included by resources.qrc)
|
|
|
|
import Style 1.0
|
2020-05-20 16:17:54 +03:00
|
|
|
import com.nextcloud.gui 1.0
|
2020-01-19 22:13:12 +03:00
|
|
|
|
2019-12-08 13:32:22 +03:00
|
|
|
Window {
|
2020-04-24 19:34:11 +03:00
|
|
|
|
|
|
|
function setTrayWindowPosition()
|
|
|
|
{
|
|
|
|
var trayIconCenter = systrayBackend.calcTrayIconCenter();
|
|
|
|
console.debug("Calculated tray icon center:",trayIconCenter);
|
|
|
|
var currentScreen = systrayBackend.screenIndex();
|
|
|
|
console.debug("Tray menu about to show on screen",currentScreen,".");
|
|
|
|
trayWindow.screen = Qt.application.screens[currentScreen];
|
|
|
|
trayWindow.show();
|
|
|
|
trayWindow.raise();
|
|
|
|
trayWindow.requestActivate();
|
|
|
|
var trayWindowX;
|
|
|
|
var trayWindowY;
|
2020-05-20 11:12:55 +03:00
|
|
|
var tbOrientation = systrayBackend.taskbarOrientation();
|
|
|
|
var taskbarRect = systrayBackend.taskbarRect();
|
2020-04-24 19:34:11 +03:00
|
|
|
|
|
|
|
switch(tbOrientation) {
|
|
|
|
// Platform separation here: Windows and macOS draw coordinates have to be given in screen-coordinates
|
|
|
|
// KDE and most xorg based DEs expect them as virtual coordinates
|
2020-05-20 16:17:54 +03:00
|
|
|
case Systray.Bottom:
|
2020-04-24 19:34:11 +03:00
|
|
|
console.debug("Taskbar is on the bottom.");
|
|
|
|
trayWindowX = trayIconCenter.x - trayWindow.width / 2;
|
2020-05-20 11:12:55 +03:00
|
|
|
trayWindowY = (Qt.platform.os !== "linux") ? (Screen.height - taskbarRect.height - trayWindow.height - 4)
|
|
|
|
: (Screen.height + Screen.virtualY - taskbarRect.height - trayWindow.height - 4);
|
2020-04-24 19:34:11 +03:00
|
|
|
break;
|
2020-05-20 16:17:54 +03:00
|
|
|
case Systray.Left:
|
2020-04-24 19:34:11 +03:00
|
|
|
console.debug("Taskbar is on the left.");
|
2020-05-20 11:12:55 +03:00
|
|
|
trayWindowX = (Qt.platform.os !== "linux") ? (taskbarRect.width + 4)
|
|
|
|
: (Screen.virtualX + taskbarRect.width + 4);
|
2020-04-24 19:34:11 +03:00
|
|
|
trayWindowY = trayIconCenter.y;
|
|
|
|
break;
|
2020-05-20 16:17:54 +03:00
|
|
|
case Systray.Top:
|
2020-04-24 19:34:11 +03:00
|
|
|
console.debug("Taskbar is on the top.");
|
|
|
|
trayWindowX = trayIconCenter.x - trayWindow.width / 2;
|
2020-05-20 11:12:55 +03:00
|
|
|
trayWindowY = Screen.virtualY + taskbarRect.height + 4;
|
2020-04-24 19:34:11 +03:00
|
|
|
break;
|
2020-05-20 16:17:54 +03:00
|
|
|
case Systray.Right:
|
2020-04-24 19:34:11 +03:00
|
|
|
console.debug("Taskbar is on the right.");
|
2020-05-20 11:12:55 +03:00
|
|
|
trayWindowX = (Qt.platform.os !== "linux") ? (Screen.width - taskbarRect.width - trayWindow.width - 4)
|
|
|
|
: (Screen.width + Screen.virtualX - taskbarRect.width - trayWindow.width - 4);
|
2020-04-24 19:34:11 +03:00
|
|
|
trayWindowY = trayIconCenter.y;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2020-05-20 11:12:55 +03:00
|
|
|
console.debug("Screen.height:", Screen.height);
|
|
|
|
console.debug("Screen.desktopAvailableHeight:", Screen.desktopAvailableHeight);
|
|
|
|
console.debug("Screen.virtualY:", Screen.virtualY);
|
|
|
|
console.debug("Screen.width:", Screen.width);
|
|
|
|
console.debug("Screen.desktopAvailableWidth:", Screen.desktopAvailableWidth);
|
|
|
|
console.debug("Screen.virtualX:", Screen.virtualX);
|
|
|
|
console.debug("Taskbar height:", taskbarRect.height);
|
|
|
|
console.debug("Taskbar width:", taskbarRect.width);
|
2020-04-24 19:34:11 +03:00
|
|
|
|
|
|
|
if (Screen.width <= trayWindowX + trayWindow.width) {
|
|
|
|
console.debug("Out-of-screen condition on the right detected. Adjusting window position.");
|
|
|
|
if (Qt.platform.os !== "linux") {
|
|
|
|
trayWindowX = Screen.width - trayWindow.width - 4;
|
|
|
|
} else {
|
2020-05-20 16:17:54 +03:00
|
|
|
trayWindowX = Screen.width + Screen.virtualX - trayWindow.width - 4 - (tbOrientation === Systray.Right ? taskbarRect.width : 0);
|
2020-04-24 19:34:11 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
if (trayWindowX <= Screen.x && Qt.platform.os !== "linux") {
|
|
|
|
console.debug("Out-of-screen condition on the left detected. Adjusting window position.");
|
|
|
|
trayWindowX = Screen.x + 4;
|
|
|
|
}
|
|
|
|
if (trayWindowX <= Screen.virtualX && Qt.platform.os === "linux") {
|
|
|
|
console.debug("Out-of-screen condition on the left detected. Adjusting window position.");
|
2020-05-20 16:17:54 +03:00
|
|
|
trayWindowX = Screen.virtualX + 4 + (tbOrientation === Systray.Left ? taskbarRect.width : 0)
|
2020-04-24 19:34:11 +03:00
|
|
|
}
|
|
|
|
if (trayWindowY <= Screen.y && Qt.platform.os !== "linux") {
|
|
|
|
console.debug("Out-of-screen condition on the top detected. Adjusting window position.");
|
|
|
|
trayWindowY = Screen.y + 4;
|
|
|
|
}
|
|
|
|
if (trayWindowY <= Screen.virtualY && Qt.platform.os === "linux") {
|
|
|
|
console.debug("Out-of-screen condition on the top detected. Adjusting window position.");
|
2020-05-20 16:17:54 +03:00
|
|
|
trayWindowY = Screen.virtualY + 4 + (tbOrientation === Systray.Top ? taskbarRect.height : 0);
|
2020-04-24 19:34:11 +03:00
|
|
|
}
|
|
|
|
if (Screen.height <= trayWindowY - Screen.virtualY + trayWindow.height) {
|
|
|
|
console.debug("Out-of-screen condition on the bottom detected. Adjusting window position.");
|
|
|
|
if (Qt.platform.os !== "linux") {
|
|
|
|
trayWindowY = Screen.height - trayWindow.height - 4;
|
|
|
|
} else {
|
|
|
|
trayWindowY = Screen.height + Screen.virtualY - trayWindow.height - 4;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
console.debug("Tray window position: x =",trayWindowX," y =",trayWindowY);
|
|
|
|
trayWindow.setX(trayWindowX);
|
|
|
|
trayWindow.setY(trayWindowY);
|
|
|
|
}
|
|
|
|
|
2020-01-19 22:13:12 +03:00
|
|
|
id: trayWindow
|
2019-12-08 13:32:22 +03:00
|
|
|
|
2020-01-19 22:13:12 +03:00
|
|
|
width: Style.trayWindowWidth
|
|
|
|
height: Style.trayWindowHeight
|
|
|
|
color: "transparent"
|
2020-05-06 16:50:28 +03:00
|
|
|
flags: Qt.Dialog | Qt.FramelessWindowHint
|
2019-12-08 13:32:22 +03:00
|
|
|
|
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: {
|
|
|
|
if(!active) {
|
|
|
|
trayWindow.hide();
|
2020-01-05 18:25:32 +03:00
|
|
|
systrayBackend.setClosed();
|
2019-12-30 13:39:21 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-01-03 15:09:29 +03:00
|
|
|
onVisibleChanged: {
|
|
|
|
currentAccountAvatar.source = ""
|
|
|
|
currentAccountAvatar.source = "image://avatars/currentUser"
|
|
|
|
currentAccountUser.text = userModelBackend.currentUserName();
|
|
|
|
currentAccountServer.text = userModelBackend.currentUserServer();
|
2020-06-06 22:08:48 +03:00
|
|
|
openLocalFolderButton.visible = userModelBackend.currentUserHasLocalFolder();
|
2020-01-03 15:09:29 +03:00
|
|
|
trayWindowTalkButton.visible = userModelBackend.currentServerHasTalk() ? true : false;
|
2020-01-12 13:06:48 +03:00
|
|
|
currentAccountStateIndicator.source = ""
|
|
|
|
currentAccountStateIndicator.source = userModelBackend.isUserConnected(userModelBackend.currentUserId()) ? "qrc:///client/theme/colored/state-ok.svg" : "qrc:///client/theme/colored/state-offline.svg"
|
2020-01-11 17:05:37 +03:00
|
|
|
|
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;
|
2020-01-03 15:09:29 +03:00
|
|
|
}
|
|
|
|
|
2019-12-08 13:32:22 +03:00
|
|
|
Connections {
|
2019-12-30 13:52:07 +03:00
|
|
|
target: userModelBackend
|
2019-12-08 13:32:22 +03:00
|
|
|
onRefreshCurrentUserGui: {
|
2020-01-03 15:09:29 +03:00
|
|
|
currentAccountAvatar.source = ""
|
|
|
|
currentAccountAvatar.source = "image://avatars/currentUser"
|
|
|
|
currentAccountUser.text = userModelBackend.currentUserName();
|
|
|
|
currentAccountServer.text = userModelBackend.currentUserServer();
|
2020-01-12 11:10:06 +03:00
|
|
|
currentAccountStateIndicator.source = ""
|
|
|
|
currentAccountStateIndicator.source = userModelBackend.isUserConnected(userModelBackend.currentUserId()) ? "qrc:///client/theme/colored/state-ok.svg" : "qrc:///client/theme/colored/state-offline.svg"
|
2019-12-08 13:32:22 +03:00
|
|
|
}
|
|
|
|
onNewUserSelected: {
|
2020-01-03 15:09:29 +03:00
|
|
|
accountMenu.close();
|
2020-06-06 22:08:48 +03:00
|
|
|
openLocalFolderButton.visible = userModelBackend.currentUserHasLocalFolder();
|
2020-01-03 15:09:29 +03:00
|
|
|
trayWindowTalkButton.visible = userModelBackend.currentServerHasTalk() ? true : false;
|
2019-12-08 13:32:22 +03:00
|
|
|
}
|
2019-12-30 13:52:07 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
Connections {
|
|
|
|
target: systrayBackend
|
2019-12-30 13:39:21 +03:00
|
|
|
onShowWindow: {
|
2020-01-05 18:25:32 +03:00
|
|
|
accountMenu.close();
|
2020-04-24 19:34:11 +03:00
|
|
|
setTrayWindowPosition();
|
2020-01-05 18:25:32 +03:00
|
|
|
systrayBackend.setOpened();
|
2020-01-13 16:35:58 +03:00
|
|
|
userModelBackend.fetchCurrentActivityModel();
|
2019-12-30 13:39:21 +03:00
|
|
|
}
|
|
|
|
onHideWindow: {
|
|
|
|
trayWindow.hide();
|
2020-01-05 18:25:32 +03:00
|
|
|
systrayBackend.setClosed();
|
2019-12-30 13:39:21 +03:00
|
|
|
}
|
2019-12-08 13:32:22 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
id: trayWindowBackground
|
2020-01-19 22:13:12 +03:00
|
|
|
|
|
|
|
anchors.fill: parent
|
|
|
|
radius: Style.trayWindowRadius
|
|
|
|
border.width: Style.trayWindowBorderWidth
|
|
|
|
border.color: Style.ncBlue
|
2019-12-08 13:32:22 +03:00
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
id: trayWindowHeaderBackground
|
|
|
|
|
2020-01-19 22:13:12 +03:00
|
|
|
anchors.left: trayWindowBackground.left
|
|
|
|
anchors.top: trayWindowBackground.top
|
|
|
|
height: Style.trayWindowHeaderHeight
|
|
|
|
width: Style.trayWindowWidth
|
|
|
|
radius: (Style.trayWindowRadius > 0) ? (Style.trayWindowRadius - 1) : 0
|
|
|
|
color: Style.ncBlue
|
|
|
|
|
|
|
|
// The overlay rectangle below eliminates the rounded corners from the bottom of the header
|
|
|
|
// as Qt only allows setting the radius for all corners right now, not specific ones
|
2019-12-08 13:32:22 +03:00
|
|
|
Rectangle {
|
2020-01-19 22:13:12 +03:00
|
|
|
id: trayWindowHeaderButtomHalfBackground
|
|
|
|
|
|
|
|
anchors.left: trayWindowHeaderBackground.left
|
2019-12-08 13:32:22 +03:00
|
|
|
anchors.bottom: trayWindowHeaderBackground.bottom
|
2020-01-19 22:13:12 +03:00
|
|
|
height: Style.trayWindowHeaderHeight / 2
|
|
|
|
width: Style.trayWindowWidth
|
|
|
|
color: Style.ncBlue
|
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
|
2019-12-08 13:32:22 +03:00
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
id: accountBtnMouseArea
|
2020-01-19 22:13:12 +03:00
|
|
|
|
|
|
|
anchors.fill: parent
|
|
|
|
hoverEnabled: Style.hoverEffectsEnabled
|
|
|
|
|
|
|
|
// HACK: Imitate Qt hover effect brightness (which is not accessible as property)
|
|
|
|
// so that indicator background also flicks when hovered
|
2020-01-15 22:11:50 +03:00
|
|
|
onContainsMouseChanged: {
|
2020-01-19 22:13:12 +03:00
|
|
|
currentAccountStateIndicatorBackground.color = (containsMouse ? Style.ncBlueHover : Style.ncBlue)
|
2020-01-15 22:11:50 +03:00
|
|
|
}
|
2020-01-19 22:13:12 +03:00
|
|
|
|
|
|
|
// We call open() instead of popup() because we want to position it
|
|
|
|
// exactly below the dropdown button, not the mouse
|
2019-12-08 13:32:22 +03:00
|
|
|
onClicked:
|
|
|
|
{
|
2020-01-14 09:59:28 +03:00
|
|
|
syncPauseButton.text = systrayBackend.syncIsPaused() ? qsTr("Resume sync for all") : qsTr("Pause sync for all")
|
2019-12-08 13:32:22 +03:00
|
|
|
accountMenu.open()
|
|
|
|
}
|
|
|
|
|
|
|
|
Menu {
|
|
|
|
id: accountMenu
|
2020-01-19 22:13:12 +03:00
|
|
|
|
|
|
|
// x coordinate grows towards the right
|
|
|
|
// y coordinate grows towards the bottom
|
2019-12-08 13:32:22 +03:00
|
|
|
x: (currentAccountButton.x + 2)
|
2020-01-19 22:13:12 +03:00
|
|
|
y: (currentAccountButton.y + Style.trayWindowHeaderHeight + 2)
|
|
|
|
|
|
|
|
width: (Style.currentAccountButtonWidth - 2)
|
2020-01-05 23:06:42 +03:00
|
|
|
closePolicy: "CloseOnPressOutside"
|
2019-12-08 13:32:22 +03:00
|
|
|
|
|
|
|
background: Rectangle {
|
2020-01-19 22:13:12 +03:00
|
|
|
border.color: Style.ncBlue
|
|
|
|
radius: Style.currentAccountButtonRadius
|
2019-12-08 13:32:22 +03:00
|
|
|
}
|
|
|
|
|
2020-01-12 13:06:48 +03:00
|
|
|
onClosed: {
|
2020-01-19 22:13:12 +03:00
|
|
|
// HACK: reload account Instantiator immediately by restting it - could be done better I guess
|
|
|
|
// see also onVisibleChanged above
|
2020-01-12 13:06:48 +03:00
|
|
|
userLineInstantiator.active = false;
|
|
|
|
userLineInstantiator.active = true;
|
|
|
|
}
|
|
|
|
|
2019-12-08 13:32:22 +03:00
|
|
|
Instantiator {
|
2020-01-10 18:28:53 +03:00
|
|
|
id: userLineInstantiator
|
2019-12-30 13:52:07 +03:00
|
|
|
model: userModelBackend
|
2019-12-08 13:32:22 +03:00
|
|
|
delegate: UserLine {}
|
2020-01-05 23:06:42 +03:00
|
|
|
onObjectAdded: accountMenu.insertItem(index, object)
|
2019-12-08 13:32:22 +03:00
|
|
|
onObjectRemoved: accountMenu.removeItem(object)
|
|
|
|
}
|
|
|
|
|
2020-01-04 19:22:56 +03:00
|
|
|
MenuItem {
|
2020-01-11 22:28:00 +03:00
|
|
|
id: addAccountButton
|
2020-01-19 22:13:12 +03:00
|
|
|
height: Style.addAccountButtonHeight
|
2020-01-11 22:28:00 +03:00
|
|
|
|
|
|
|
RowLayout {
|
2020-01-19 22:13:12 +03:00
|
|
|
anchors.fill: parent
|
2020-01-11 22:28:00 +03:00
|
|
|
spacing: 0
|
|
|
|
|
|
|
|
Image {
|
2020-01-19 22:13:12 +03:00
|
|
|
Layout.leftMargin: 12
|
2020-01-11 22:28:00 +03:00
|
|
|
verticalAlignment: Qt.AlignCenter
|
|
|
|
source: "qrc:///client/theme/black/add.svg"
|
2020-01-19 22:13:12 +03:00
|
|
|
sourceSize.width: Style.headerButtonIconSize
|
|
|
|
sourceSize.height: Style.headerButtonIconSize
|
2020-01-11 22:28:00 +03:00
|
|
|
}
|
|
|
|
Label {
|
2020-01-15 10:01:54 +03:00
|
|
|
Layout.leftMargin: 14
|
2020-01-14 09:59:28 +03:00
|
|
|
text: qsTr("Add account")
|
2020-01-11 22:28:00 +03:00
|
|
|
color: "black"
|
2020-01-19 22:13:12 +03:00
|
|
|
font.pixelSize: Style.topLinePixelSize
|
2020-01-11 22:28:00 +03:00
|
|
|
}
|
2020-01-19 22:13:12 +03:00
|
|
|
// Filler on the right
|
2020-01-11 22:28:00 +03:00
|
|
|
Item {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
|
|
|
}
|
|
|
|
}
|
2020-01-04 19:22:56 +03:00
|
|
|
onClicked: userModelBackend.addAccount()
|
|
|
|
}
|
|
|
|
|
2020-01-05 23:06:42 +03:00
|
|
|
MenuSeparator { id: accountMenuSeparator }
|
2020-01-04 19:22:56 +03:00
|
|
|
|
2020-01-05 18:25:32 +03:00
|
|
|
MenuItem {
|
2020-01-05 23:06:42 +03:00
|
|
|
id: syncPauseButton
|
2020-01-19 22:13:12 +03:00
|
|
|
font.pixelSize: Style.topLinePixelSize
|
2020-01-05 18:25:32 +03:00
|
|
|
onClicked: systrayBackend.pauseResumeSync()
|
|
|
|
}
|
|
|
|
|
2020-01-04 19:22:56 +03:00
|
|
|
MenuItem {
|
2020-01-14 09:59:28 +03:00
|
|
|
text: qsTr("Open settings")
|
2020-01-19 22:13:12 +03:00
|
|
|
font.pixelSize: Style.topLinePixelSize
|
2020-01-04 19:22:56 +03:00
|
|
|
onClicked: systrayBackend.openSettings()
|
|
|
|
}
|
|
|
|
|
2020-01-05 23:06:42 +03:00
|
|
|
MenuItem {
|
2020-01-14 09:59:28 +03:00
|
|
|
text: qsTr("Help")
|
2020-01-19 22:13:12 +03:00
|
|
|
font.pixelSize: Style.topLinePixelSize
|
2020-01-05 23:06:42 +03:00
|
|
|
onClicked: systrayBackend.openHelp()
|
|
|
|
}
|
|
|
|
|
2020-01-04 19:22:56 +03:00
|
|
|
MenuItem {
|
2020-01-14 09:59:28 +03:00
|
|
|
text: qsTr("Quit Nextcloud")
|
2020-01-19 22:13:12 +03:00
|
|
|
font.pixelSize: Style.topLinePixelSize
|
2020-01-04 19:22:56 +03:00
|
|
|
onClicked: systrayBackend.shutdown()
|
|
|
|
}
|
2019-12-08 13:32:22 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
background:
|
|
|
|
Item {
|
|
|
|
id: leftHoverContainer
|
2020-01-19 22:13:12 +03:00
|
|
|
|
|
|
|
height: Style.trayWindowHeaderHeight
|
|
|
|
width: Style.currentAccountButtonWidth
|
2019-12-08 13:32:22 +03:00
|
|
|
Rectangle {
|
2020-01-19 22:13:12 +03:00
|
|
|
width: Style.currentAccountButtonWidth / 2
|
|
|
|
height: Style.trayWindowHeaderHeight / 2
|
2019-12-08 13:32:22 +03:00
|
|
|
color: "transparent"
|
|
|
|
clip: true
|
|
|
|
Rectangle {
|
2020-01-19 22:13:12 +03:00
|
|
|
width: Style.currentAccountButtonWidth
|
|
|
|
height: Style.trayWindowHeaderHeight
|
|
|
|
radius: Style.trayWindowRadius
|
2019-12-08 13:32:22 +03:00
|
|
|
color: "white"
|
|
|
|
opacity: 0.2
|
|
|
|
visible: accountBtnMouseArea.containsMouse
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Rectangle {
|
2020-01-19 22:13:12 +03:00
|
|
|
width: Style.currentAccountButtonWidth / 2
|
|
|
|
height: Style.trayWindowHeaderHeight / 2
|
2019-12-08 13:32:22 +03:00
|
|
|
anchors.bottom: leftHoverContainer.bottom
|
|
|
|
color: "white"
|
|
|
|
opacity: 0.2
|
|
|
|
visible: accountBtnMouseArea.containsMouse
|
|
|
|
}
|
|
|
|
Rectangle {
|
2020-01-19 22:13:12 +03:00
|
|
|
width: Style.currentAccountButtonWidth / 2
|
|
|
|
height: Style.trayWindowHeaderHeight / 2
|
2019-12-08 13:32:22 +03:00
|
|
|
anchors.right: leftHoverContainer.right
|
|
|
|
color: "white"
|
|
|
|
opacity: 0.2
|
|
|
|
visible: accountBtnMouseArea.containsMouse
|
|
|
|
}
|
|
|
|
Rectangle {
|
2020-01-19 22:13:12 +03:00
|
|
|
width: Style.currentAccountButtonWidth / 2
|
|
|
|
height: Style.trayWindowHeaderHeight / 2
|
2019-12-08 13:32:22 +03:00
|
|
|
anchors.right: leftHoverContainer.right
|
|
|
|
anchors.bottom: leftHoverContainer.bottom
|
|
|
|
color: "white"
|
|
|
|
opacity: 0.2
|
|
|
|
visible: accountBtnMouseArea.containsMouse
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
|
Image {
|
|
|
|
id: currentAccountAvatar
|
2020-01-19 22:13:12 +03:00
|
|
|
|
2019-12-08 13:32:22 +03:00
|
|
|
Layout.leftMargin: 8
|
|
|
|
verticalAlignment: Qt.AlignCenter
|
2020-01-03 15:09:29 +03:00
|
|
|
cache: false
|
|
|
|
source: "image://avatars/currentUser"
|
2020-01-19 22:13:12 +03:00
|
|
|
Layout.preferredHeight: Style.accountAvatarSize
|
|
|
|
Layout.preferredWidth: Style.accountAvatarSize
|
|
|
|
|
2020-01-15 22:11:50 +03:00
|
|
|
Rectangle {
|
|
|
|
id: currentAccountStateIndicatorBackground
|
2020-01-19 22:13:12 +03:00
|
|
|
width: Style.accountAvatarStateIndicatorSize + 2
|
2020-01-15 22:11:50 +03:00
|
|
|
height: width
|
|
|
|
anchors.bottom: currentAccountAvatar.bottom
|
|
|
|
anchors.right: currentAccountAvatar.right
|
2020-01-19 22:13:12 +03:00
|
|
|
color: Style.ncBlue
|
2020-01-15 22:11:50 +03:00
|
|
|
radius: width*0.5
|
|
|
|
}
|
2020-01-19 22:13:12 +03:00
|
|
|
|
2020-01-12 11:10:06 +03:00
|
|
|
Image {
|
|
|
|
id: currentAccountStateIndicator
|
|
|
|
source: userModelBackend.isUserConnected(userModelBackend.currentUserId()) ? "qrc:///client/theme/colored/state-ok.svg" : "qrc:///client/theme/colored/state-offline.svg"
|
|
|
|
cache: false
|
2020-01-15 22:11:50 +03:00
|
|
|
x: currentAccountStateIndicatorBackground.x + 1
|
|
|
|
y: currentAccountStateIndicatorBackground.y + 1
|
2020-01-19 22:13:12 +03:00
|
|
|
sourceSize.width: Style.accountAvatarStateIndicatorSize
|
|
|
|
sourceSize.height: Style.accountAvatarStateIndicatorSize
|
2020-01-12 11:10:06 +03:00
|
|
|
}
|
2019-12-08 13:32:22 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
Column {
|
|
|
|
id: accountLabels
|
|
|
|
spacing: 4
|
|
|
|
Layout.alignment: Qt.AlignLeft
|
|
|
|
Layout.leftMargin: 6
|
|
|
|
Label {
|
|
|
|
id: currentAccountUser
|
2020-01-19 22:13:12 +03:00
|
|
|
width: Style.currentAccountLabelWidth
|
2019-12-30 13:52:07 +03:00
|
|
|
text: userModelBackend.currentUserName()
|
2020-01-05 23:06:42 +03:00
|
|
|
elide: Text.ElideRight
|
2019-12-08 13:32:22 +03:00
|
|
|
color: "white"
|
2020-01-19 22:13:12 +03:00
|
|
|
font.pixelSize: Style.topLinePixelSize
|
2019-12-08 13:32:22 +03:00
|
|
|
font.bold: true
|
|
|
|
}
|
|
|
|
Label {
|
|
|
|
id: currentAccountServer
|
2020-01-19 22:13:12 +03:00
|
|
|
width: Style.currentAccountLabelWidth
|
2019-12-30 13:52:07 +03:00
|
|
|
text: userModelBackend.currentUserServer()
|
2020-01-05 23:06:42 +03:00
|
|
|
elide: Text.ElideRight
|
2019-12-08 13:32:22 +03:00
|
|
|
color: "white"
|
2020-01-19 22:13:12 +03:00
|
|
|
font.pixelSize: Style.subLinePixelSize
|
2019-12-08 13:32:22 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Image {
|
2020-01-05 23:06:42 +03:00
|
|
|
Layout.alignment: Qt.AlignRight
|
2019-12-08 13:32:22 +03:00
|
|
|
verticalAlignment: Qt.AlignCenter
|
2020-01-19 22:13:12 +03:00
|
|
|
Layout.margins: Style.accountDropDownCaretMargin
|
2019-12-08 13:32:22 +03:00
|
|
|
source: "qrc:///client/theme/white/caret-down.svg"
|
2020-01-19 22:13:12 +03:00
|
|
|
sourceSize.width: Style.accountDropDownCaretSize
|
|
|
|
sourceSize.height: Style.accountDropDownCaretSize
|
2019-12-08 13:32:22 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-01-19 22:13:12 +03:00
|
|
|
// Filler between account dropdown and header app buttons
|
2019-12-08 13:32:22 +03:00
|
|
|
Item {
|
|
|
|
id: trayWindowHeaderSpacer
|
|
|
|
Layout.fillWidth: true
|
|
|
|
}
|
|
|
|
|
|
|
|
Button {
|
|
|
|
id: openLocalFolderButton
|
2020-01-19 22:13:12 +03:00
|
|
|
|
2019-12-08 13:32:22 +03:00
|
|
|
Layout.alignment: Qt.AlignRight
|
|
|
|
display: AbstractButton.IconOnly
|
2020-01-19 22:13:12 +03:00
|
|
|
Layout.preferredWidth: Style.trayWindowHeaderHeight
|
|
|
|
Layout.preferredHeight: Style.trayWindowHeaderHeight
|
2019-12-08 13:32:22 +03:00
|
|
|
flat: true
|
2020-06-06 22:08:48 +03:00
|
|
|
visible: userModelBackend.currentUserHasLocalFolder()
|
2019-12-08 13:32:22 +03:00
|
|
|
|
|
|
|
icon.source: "qrc:///client/theme/white/folder.svg"
|
2020-01-19 22:13:12 +03:00
|
|
|
icon.width: Style.headerButtonIconSize
|
|
|
|
icon.height: Style.headerButtonIconSize
|
2019-12-08 13:32:22 +03:00
|
|
|
icon.color: "transparent"
|
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
id: folderBtnMouseArea
|
2020-01-19 22:13:12 +03:00
|
|
|
|
2019-12-08 13:32:22 +03:00
|
|
|
anchors.fill: parent
|
2020-01-19 22:13:12 +03:00
|
|
|
hoverEnabled: Style.hoverEffectsEnabled
|
2019-12-08 13:32:22 +03:00
|
|
|
onClicked:
|
|
|
|
{
|
2020-01-02 11:55:37 +03:00
|
|
|
userModelBackend.openCurrentAccountLocalFolder();
|
2019-12-08 13:32:22 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
background:
|
|
|
|
Rectangle {
|
|
|
|
color: folderBtnMouseArea.containsMouse ? "white" : "transparent"
|
|
|
|
opacity: 0.2
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Button {
|
|
|
|
id: trayWindowTalkButton
|
2020-01-19 22:13:12 +03:00
|
|
|
|
2019-12-08 13:32:22 +03:00
|
|
|
Layout.alignment: Qt.AlignRight
|
|
|
|
display: AbstractButton.IconOnly
|
2020-01-19 22:13:12 +03:00
|
|
|
Layout.preferredWidth: Style.trayWindowHeaderHeight
|
|
|
|
Layout.preferredHeight: Style.trayWindowHeaderHeight
|
2019-12-08 13:32:22 +03:00
|
|
|
flat: true
|
2020-01-03 15:09:29 +03:00
|
|
|
visible: userModelBackend.currentServerHasTalk() ? true : false
|
2019-12-08 13:32:22 +03:00
|
|
|
|
|
|
|
icon.source: "qrc:///client/theme/white/talk-app.svg"
|
2020-01-19 22:13:12 +03:00
|
|
|
icon.width: Style.headerButtonIconSize
|
|
|
|
icon.height: Style.headerButtonIconSize
|
2019-12-08 13:32:22 +03:00
|
|
|
icon.color: "transparent"
|
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
id: talkBtnMouseArea
|
2020-01-19 22:13:12 +03:00
|
|
|
|
2019-12-08 13:32:22 +03:00
|
|
|
anchors.fill: parent
|
2020-01-19 22:13:12 +03:00
|
|
|
hoverEnabled: Style.hoverEffectsEnabled
|
2019-12-08 13:32:22 +03:00
|
|
|
onClicked:
|
|
|
|
{
|
2020-01-03 16:00:07 +03:00
|
|
|
userModelBackend.openCurrentAccountTalk();
|
2019-12-08 13:32:22 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
background:
|
|
|
|
Rectangle {
|
|
|
|
color: talkBtnMouseArea.containsMouse ? "white" : "transparent"
|
|
|
|
opacity: 0.2
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Button {
|
|
|
|
id: trayWindowAppsButton
|
2020-01-19 22:13:12 +03:00
|
|
|
|
2019-12-08 13:32:22 +03:00
|
|
|
Layout.alignment: Qt.AlignRight
|
|
|
|
display: AbstractButton.IconOnly
|
2020-01-19 22:13:12 +03:00
|
|
|
Layout.preferredWidth: Style.trayWindowHeaderHeight
|
|
|
|
Layout.preferredHeight: Style.trayWindowHeaderHeight
|
2019-12-08 13:32:22 +03:00
|
|
|
flat: true
|
|
|
|
|
|
|
|
icon.source: "qrc:///client/theme/white/more-apps.svg"
|
2020-01-19 22:13:12 +03:00
|
|
|
icon.width: Style.headerButtonIconSize
|
|
|
|
icon.height: Style.headerButtonIconSize
|
2019-12-08 13:32:22 +03:00
|
|
|
icon.color: "transparent"
|
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
id: appsBtnMouseArea
|
2020-01-19 22:13:12 +03:00
|
|
|
|
2019-12-08 13:32:22 +03:00
|
|
|
anchors.fill: parent
|
2020-01-19 22:13:12 +03:00
|
|
|
hoverEnabled: Style.hoverEffectsEnabled
|
2019-12-08 13:32:22 +03:00
|
|
|
onClicked:
|
|
|
|
{
|
2020-01-15 18:42:06 +03:00
|
|
|
/*
|
|
|
|
// The count() property was introduced in QtQuick.Controls 2.3 (Qt 5.10)
|
|
|
|
// so we handle this with userModelBackend.openCurrentAccountServer()
|
|
|
|
//
|
|
|
|
// See UserModel::openCurrentAccountServer() to disable this workaround
|
|
|
|
// in the future for Qt >= 5.10
|
|
|
|
|
|
|
|
if(appsMenu.count() > 0) {
|
|
|
|
appsMenu.popup();
|
|
|
|
} else {
|
|
|
|
userModelBackend.openCurrentAccountServer();
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
|
|
|
|
appsMenu.open();
|
2020-01-03 16:00:07 +03:00
|
|
|
userModelBackend.openCurrentAccountServer();
|
2019-12-08 13:32:22 +03:00
|
|
|
}
|
2020-01-15 18:42:06 +03:00
|
|
|
|
|
|
|
Menu {
|
|
|
|
id: appsMenu
|
|
|
|
y: (trayWindowAppsButton.y + trayWindowAppsButton.height + 2)
|
2020-06-07 00:55:31 +03:00
|
|
|
width: Math.min(contentItem.childrenRect.width + 4, Style.trayWindowWidth / 2)
|
2020-01-15 18:42:06 +03:00
|
|
|
closePolicy: "CloseOnPressOutside"
|
|
|
|
|
|
|
|
background: Rectangle {
|
2020-01-19 22:13:12 +03:00
|
|
|
border.color: Style.ncBlue
|
2020-01-15 18:42:06 +03:00
|
|
|
radius: 2
|
|
|
|
}
|
|
|
|
|
|
|
|
Instantiator {
|
|
|
|
id: appsMenuInstantiator
|
|
|
|
model: appsMenuModelBackend
|
|
|
|
onObjectAdded: appsMenu.insertItem(index, object)
|
|
|
|
onObjectRemoved: appsMenu.removeItem(object)
|
|
|
|
delegate: MenuItem {
|
|
|
|
text: appName
|
2020-01-19 22:13:12 +03:00
|
|
|
font.pixelSize: Style.topLinePixelSize
|
2020-01-16 20:43:48 +03:00
|
|
|
icon.source: appIconUrl
|
2020-06-07 00:55:31 +03:00
|
|
|
width: contentItem.implicitWidth + leftPadding + rightPadding
|
2020-01-15 18:42:06 +03:00
|
|
|
onTriggered: appsMenuModelBackend.openAppUrl(appUrl)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-12-08 13:32:22 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
background:
|
|
|
|
Item {
|
|
|
|
id: rightHoverContainer
|
2020-01-19 22:13:12 +03:00
|
|
|
height: Style.trayWindowHeaderHeight
|
|
|
|
width: Style.trayWindowHeaderHeight
|
2019-12-08 13:32:22 +03:00
|
|
|
Rectangle {
|
2020-01-19 22:13:12 +03:00
|
|
|
width: Style.trayWindowHeaderHeight / 2
|
|
|
|
height: Style.trayWindowHeaderHeight / 2
|
2019-12-08 13:32:22 +03:00
|
|
|
color: "white"
|
|
|
|
opacity: 0.2
|
|
|
|
visible: appsBtnMouseArea.containsMouse
|
|
|
|
}
|
|
|
|
Rectangle {
|
2020-01-19 22:13:12 +03:00
|
|
|
width: Style.trayWindowHeaderHeight / 2
|
|
|
|
height: Style.trayWindowHeaderHeight / 2
|
2019-12-08 13:32:22 +03:00
|
|
|
anchors.bottom: rightHoverContainer.bottom
|
|
|
|
color: "white"
|
|
|
|
opacity: 0.2
|
|
|
|
visible: appsBtnMouseArea.containsMouse
|
|
|
|
}
|
|
|
|
Rectangle {
|
2020-01-19 22:13:12 +03:00
|
|
|
width: Style.trayWindowHeaderHeight / 2
|
|
|
|
height: Style.trayWindowHeaderHeight / 2
|
2019-12-08 13:32:22 +03:00
|
|
|
anchors.bottom: rightHoverContainer.bottom
|
|
|
|
anchors.right: rightHoverContainer.right
|
|
|
|
color: "white"
|
|
|
|
opacity: 0.2
|
|
|
|
visible: appsBtnMouseArea.containsMouse
|
|
|
|
}
|
|
|
|
Rectangle {
|
|
|
|
id: rightHoverContainerClipper
|
|
|
|
anchors.right: rightHoverContainer.right
|
2020-01-19 22:13:12 +03:00
|
|
|
width: Style.trayWindowHeaderHeight / 2
|
|
|
|
height: Style.trayWindowHeaderHeight / 2
|
2019-12-08 13:32:22 +03:00
|
|
|
color: "transparent"
|
|
|
|
clip: true
|
|
|
|
Rectangle {
|
2020-01-19 22:13:12 +03:00
|
|
|
width: Style.trayWindowHeaderHeight
|
|
|
|
height: Style.trayWindowHeaderHeight
|
2019-12-08 13:32:22 +03:00
|
|
|
anchors.right: rightHoverContainerClipper.right
|
2020-01-19 22:13:12 +03:00
|
|
|
radius: Style.trayWindowRadius
|
2019-12-08 13:32:22 +03:00
|
|
|
color: "white"
|
|
|
|
opacity: 0.2
|
|
|
|
visible: appsBtnMouseArea.containsMouse
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} // Rectangle trayWindowHeaderBackground
|
|
|
|
|
|
|
|
ListView {
|
|
|
|
id: activityListView
|
2020-01-19 22:13:12 +03:00
|
|
|
|
2019-12-08 13:32:22 +03:00
|
|
|
anchors.top: trayWindowHeaderBackground.bottom
|
2020-01-19 22:13:12 +03:00
|
|
|
anchors.horizontalCenter: trayWindowBackground.horizontalCenter
|
|
|
|
width: Style.trayWindowWidth - Style.trayWindowBorderWidth
|
|
|
|
height: Style.trayWindowHeight - Style.trayWindowHeaderHeight
|
2019-12-08 13:32:22 +03:00
|
|
|
clip: true
|
2020-01-13 11:59:34 +03:00
|
|
|
ScrollBar.vertical: ScrollBar {
|
|
|
|
id: listViewScrollbar
|
|
|
|
}
|
2019-12-08 13:32:22 +03:00
|
|
|
|
2020-01-02 12:39:53 +03:00
|
|
|
model: activityModel
|
2019-12-08 13:32:22 +03:00
|
|
|
|
|
|
|
delegate: RowLayout {
|
|
|
|
id: activityItem
|
2020-01-19 22:13:12 +03:00
|
|
|
|
|
|
|
width: parent.width
|
|
|
|
height: Style.trayWindowHeaderHeight
|
2019-12-08 13:32:22 +03:00
|
|
|
spacing: 0
|
2020-01-14 21:48:21 +03:00
|
|
|
|
2020-04-25 11:17:53 +03:00
|
|
|
MouseArea {
|
2020-05-20 00:25:21 +03:00
|
|
|
enabled: (path !== "")
|
2020-04-25 11:17:53 +03:00
|
|
|
anchors.left: activityItem.left
|
|
|
|
anchors.right: ((shareButton.visible) ? shareButton.left : activityItem.right)
|
|
|
|
height: parent.height
|
|
|
|
anchors.margins: 2
|
|
|
|
hoverEnabled: true
|
|
|
|
onClicked: Qt.openUrlExternally(path)
|
|
|
|
ToolTip.visible: hovered
|
|
|
|
ToolTip.delay: 1000
|
|
|
|
ToolTip.text: qsTr("Open sync item locally")
|
|
|
|
Rectangle {
|
|
|
|
anchors.fill: parent
|
|
|
|
color: (parent.containsMouse ? Style.lightHover : "transparent")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-12-08 13:32:22 +03:00
|
|
|
Image {
|
|
|
|
id: activityIcon
|
2020-04-25 11:17:53 +03:00
|
|
|
anchors.left: activityItem.left
|
|
|
|
anchors.leftMargin: 8
|
|
|
|
anchors.rightMargin: 8
|
|
|
|
Layout.preferredWidth: shareButton.icon.width
|
|
|
|
Layout.preferredHeight: shareButton.icon.height
|
2019-12-08 13:32:22 +03:00
|
|
|
verticalAlignment: Qt.AlignCenter
|
2020-01-13 11:59:34 +03:00
|
|
|
cache: true
|
|
|
|
source: icon
|
2020-01-17 12:38:21 +03:00
|
|
|
sourceSize.height: 64
|
|
|
|
sourceSize.width: 64
|
2019-12-08 13:32:22 +03:00
|
|
|
}
|
2020-04-25 11:17:53 +03:00
|
|
|
|
2019-12-08 13:32:22 +03:00
|
|
|
Column {
|
2020-01-03 18:15:15 +03:00
|
|
|
id: activityTextColumn
|
2020-04-25 11:17:53 +03:00
|
|
|
anchors.left: activityIcon.right
|
|
|
|
anchors.leftMargin: 8
|
2019-12-08 13:32:22 +03:00
|
|
|
spacing: 4
|
|
|
|
Layout.alignment: Qt.AlignLeft
|
|
|
|
Text {
|
|
|
|
id: activityTextTitle
|
2020-01-17 16:50:05 +03:00
|
|
|
text: (type === "Activity" || type === "Notification") ? subject : message
|
2020-01-19 22:13:12 +03:00
|
|
|
width: Style.activityLabelBaseWidth + ((path === "") ? activityItem.height : 0) + ((link === "") ? activityItem.height : 0) - 8
|
2020-01-03 18:15:15 +03:00
|
|
|
elide: Text.ElideRight
|
2020-01-19 22:13:12 +03:00
|
|
|
font.pixelSize: Style.topLinePixelSize
|
2020-01-17 22:26:48 +03:00
|
|
|
color: activityTextTitleColor
|
2019-12-08 13:32:22 +03:00
|
|
|
}
|
2020-01-14 21:48:21 +03:00
|
|
|
|
2019-12-08 13:32:22 +03:00
|
|
|
Text {
|
|
|
|
id: activityTextInfo
|
2020-05-20 01:09:41 +03:00
|
|
|
text: (type === "Activity" || type === "Sync") ? displayPath
|
2020-05-25 21:03:01 +03:00
|
|
|
: (type === "File") ? subject
|
|
|
|
: message
|
2020-01-17 16:50:05 +03:00
|
|
|
height: (text === "") ? 0 : activityTextTitle.height
|
2020-01-19 22:13:12 +03:00
|
|
|
width: Style.activityLabelBaseWidth + ((path === "") ? activityItem.height : 0) + ((link === "") ? activityItem.height : 0) - 8
|
2020-01-03 18:15:15 +03:00
|
|
|
elide: Text.ElideRight
|
2020-01-19 22:13:12 +03:00
|
|
|
font.pixelSize: Style.subLinePixelSize
|
2019-12-08 13:32:22 +03:00
|
|
|
}
|
2020-01-17 22:16:20 +03:00
|
|
|
|
|
|
|
Text {
|
|
|
|
id: activityTextDateTime
|
|
|
|
text: dateTime
|
|
|
|
height: (text === "") ? 0 : activityTextTitle.height
|
2020-01-19 22:13:12 +03:00
|
|
|
width: Style.activityLabelBaseWidth + ((path === "") ? activityItem.height : 0) + ((link === "") ? activityItem.height : 0) - 8
|
2020-01-17 22:16:20 +03:00
|
|
|
elide: Text.ElideRight
|
2020-01-19 22:13:12 +03:00
|
|
|
font.pixelSize: Style.subLinePixelSize
|
2020-01-17 22:16:20 +03:00
|
|
|
color: "#808080"
|
|
|
|
}
|
2019-12-08 13:32:22 +03:00
|
|
|
}
|
|
|
|
Button {
|
2020-04-25 11:17:53 +03:00
|
|
|
id: shareButton
|
|
|
|
anchors.right: activityItem.right
|
2020-01-19 22:13:12 +03:00
|
|
|
|
|
|
|
Layout.preferredWidth: (path === "") ? 0 : parent.height
|
|
|
|
Layout.preferredHeight: parent.height
|
2019-12-08 13:32:22 +03:00
|
|
|
Layout.alignment: Qt.AlignRight
|
|
|
|
flat: true
|
2020-04-25 11:17:53 +03:00
|
|
|
hoverEnabled: true
|
2020-01-15 21:15:25 +03:00
|
|
|
visible: (path === "") ? false : true
|
2019-12-08 13:32:22 +03:00
|
|
|
display: AbstractButton.IconOnly
|
2020-04-27 09:06:58 +03:00
|
|
|
icon.source: "qrc:///client/theme/share.svg"
|
2019-12-08 13:32:22 +03:00
|
|
|
icon.color: "transparent"
|
2020-04-25 11:17:53 +03:00
|
|
|
background: Rectangle {
|
|
|
|
color: parent.hovered ? Style.lightHover : "transparent"
|
2020-01-13 13:46:49 +03:00
|
|
|
}
|
2020-04-25 11:17:53 +03:00
|
|
|
ToolTip.visible: hovered
|
|
|
|
ToolTip.delay: 1000
|
|
|
|
ToolTip.text: qsTr("Open share dialog")
|
2020-05-20 00:25:21 +03:00
|
|
|
onClicked: systrayBackend.openShareDialog(displayPath,absolutePath)
|
2019-12-08 13:32:22 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-01-16 19:11:08 +03:00
|
|
|
/*add: Transition {
|
2019-12-08 13:32:22 +03:00
|
|
|
NumberAnimation { properties: "y"; from: -60; duration: 100; easing.type: Easing.Linear }
|
|
|
|
}
|
|
|
|
|
|
|
|
remove: Transition {
|
|
|
|
NumberAnimation { property: "opacity"; from: 1.0; to: 0; duration: 100 }
|
|
|
|
}
|
|
|
|
|
|
|
|
removeDisplaced: Transition {
|
|
|
|
SequentialAnimation {
|
|
|
|
PauseAnimation { duration: 100}
|
|
|
|
NumberAnimation { properties: "y"; duration: 100; easing.type: Easing.Linear }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
displaced: Transition {
|
|
|
|
NumberAnimation { properties: "y"; duration: 100; easing.type: Easing.Linear }
|
2020-01-16 19:11:08 +03:00
|
|
|
}*/
|
2019-12-08 13:32:22 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
} // Rectangle trayWindowBackground
|
|
|
|
}
|