|
@@ -6,15 +6,18 @@ import QtQuick.Controls 2.2
|
|
|
import QtQuick.Layouts 1.2
|
|
import QtQuick.Layouts 1.2
|
|
|
import QtGraphicalEffects 1.0
|
|
import QtGraphicalEffects 1.0
|
|
|
|
|
|
|
|
|
|
+// Custom qml modules are in /theme (and included by resources.qrc)
|
|
|
|
|
+import Style 1.0
|
|
|
|
|
+
|
|
|
Window {
|
|
Window {
|
|
|
|
|
+ id: trayWindow
|
|
|
|
|
|
|
|
- id: trayWindow
|
|
|
|
|
- visible: true
|
|
|
|
|
- width: 400
|
|
|
|
|
- height: 510
|
|
|
|
|
- color: "transparent"
|
|
|
|
|
- flags: Qt.FramelessWindowHint
|
|
|
|
|
|
|
+ width: Style.trayWindowWidth
|
|
|
|
|
+ height: Style.trayWindowHeight
|
|
|
|
|
+ color: "transparent"
|
|
|
|
|
+ flags: Qt.FramelessWindowHint
|
|
|
|
|
|
|
|
|
|
+ // Close tray window when focus is lost (e.g. click somewhere else on the screen)
|
|
|
onActiveChanged: {
|
|
onActiveChanged: {
|
|
|
if(!active) {
|
|
if(!active) {
|
|
|
trayWindow.hide();
|
|
trayWindow.hide();
|
|
@@ -31,6 +34,8 @@ Window {
|
|
|
currentAccountStateIndicator.source = ""
|
|
currentAccountStateIndicator.source = ""
|
|
|
currentAccountStateIndicator.source = userModelBackend.isUserConnected(userModelBackend.currentUserId()) ? "qrc:///client/theme/colored/state-ok.svg" : "qrc:///client/theme/colored/state-offline.svg"
|
|
currentAccountStateIndicator.source = userModelBackend.isUserConnected(userModelBackend.currentUserId()) ? "qrc:///client/theme/colored/state-ok.svg" : "qrc:///client/theme/colored/state-offline.svg"
|
|
|
|
|
|
|
|
|
|
+ // HACK: reload account Instantiator immediately by restting it - could be done better I guess
|
|
|
|
|
+ // see also id:accountMenu below
|
|
|
userLineInstantiator.active = false;
|
|
userLineInstantiator.active = false;
|
|
|
userLineInstantiator.active = true;
|
|
userLineInstantiator.active = true;
|
|
|
}
|
|
}
|
|
@@ -71,46 +76,62 @@ Window {
|
|
|
|
|
|
|
|
Rectangle {
|
|
Rectangle {
|
|
|
id: trayWindowBackground
|
|
id: trayWindowBackground
|
|
|
- anchors.fill: parent
|
|
|
|
|
- radius: 10
|
|
|
|
|
- border.color: "#0082c9"
|
|
|
|
|
|
|
+
|
|
|
|
|
+ anchors.fill: parent
|
|
|
|
|
+ radius: Style.trayWindowRadius
|
|
|
|
|
+ border.width: Style.trayWindowBorderWidth
|
|
|
|
|
+ border.color: Style.ncBlue
|
|
|
|
|
|
|
|
Rectangle {
|
|
Rectangle {
|
|
|
id: trayWindowHeaderBackground
|
|
id: trayWindowHeaderBackground
|
|
|
- anchors.left: trayWindowBackground.left
|
|
|
|
|
- anchors.top: trayWindowBackground.top
|
|
|
|
|
- height: 60
|
|
|
|
|
- width: parent.width
|
|
|
|
|
- radius: 9
|
|
|
|
|
- color: "#0082c9"
|
|
|
|
|
|
|
|
|
|
|
|
+ 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
|
|
|
Rectangle {
|
|
Rectangle {
|
|
|
- anchors.left: trayWindowHeaderBackground.left
|
|
|
|
|
|
|
+ id: trayWindowHeaderButtomHalfBackground
|
|
|
|
|
+
|
|
|
|
|
+ anchors.left: trayWindowHeaderBackground.left
|
|
|
anchors.bottom: trayWindowHeaderBackground.bottom
|
|
anchors.bottom: trayWindowHeaderBackground.bottom
|
|
|
- height: 30
|
|
|
|
|
- width: parent.width
|
|
|
|
|
- color: "#0082c9"
|
|
|
|
|
|
|
+ height: Style.trayWindowHeaderHeight / 2
|
|
|
|
|
+ width: Style.trayWindowWidth
|
|
|
|
|
+ color: Style.ncBlue
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
RowLayout {
|
|
RowLayout {
|
|
|
id: trayWindowHeaderLayout
|
|
id: trayWindowHeaderLayout
|
|
|
- spacing: 0
|
|
|
|
|
- anchors.fill: parent
|
|
|
|
|
|
|
+
|
|
|
|
|
+ spacing: 0
|
|
|
|
|
+ anchors.fill: parent
|
|
|
|
|
|
|
|
Button {
|
|
Button {
|
|
|
id: currentAccountButton
|
|
id: currentAccountButton
|
|
|
- Layout.preferredWidth: 220
|
|
|
|
|
- Layout.preferredHeight: (trayWindowHeaderBackground.height)
|
|
|
|
|
- display: AbstractButton.IconOnly
|
|
|
|
|
- flat: true
|
|
|
|
|
|
|
+
|
|
|
|
|
+ Layout.preferredWidth: Style.currentAccountButtonWidth
|
|
|
|
|
+ Layout.preferredHeight: Style.trayWindowHeaderHeight
|
|
|
|
|
+ display: AbstractButton.IconOnly
|
|
|
|
|
+ flat: true
|
|
|
|
|
|
|
|
MouseArea {
|
|
MouseArea {
|
|
|
id: accountBtnMouseArea
|
|
id: accountBtnMouseArea
|
|
|
- anchors.fill: parent
|
|
|
|
|
- hoverEnabled: true
|
|
|
|
|
|
|
+
|
|
|
|
|
+ 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
|
|
|
onContainsMouseChanged: {
|
|
onContainsMouseChanged: {
|
|
|
- currentAccountStateIndicatorBackground.color = (containsMouse ? "#009dd9" : "#0082c9")
|
|
|
|
|
|
|
+ currentAccountStateIndicatorBackground.color = (containsMouse ? Style.ncBlueHover : Style.ncBlue)
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ // We call open() instead of popup() because we want to position it
|
|
|
|
|
+ // exactly below the dropdown button, not the mouse
|
|
|
onClicked:
|
|
onClicked:
|
|
|
{
|
|
{
|
|
|
syncPauseButton.text = systrayBackend.syncIsPaused() ? qsTr("Resume sync for all") : qsTr("Pause sync for all")
|
|
syncPauseButton.text = systrayBackend.syncIsPaused() ? qsTr("Resume sync for all") : qsTr("Pause sync for all")
|
|
@@ -119,17 +140,23 @@ Window {
|
|
|
|
|
|
|
|
Menu {
|
|
Menu {
|
|
|
id: accountMenu
|
|
id: accountMenu
|
|
|
|
|
+
|
|
|
|
|
+ // x coordinate grows towards the right
|
|
|
|
|
+ // y coordinate grows towards the bottom
|
|
|
x: (currentAccountButton.x + 2)
|
|
x: (currentAccountButton.x + 2)
|
|
|
- y: (currentAccountButton.y + currentAccountButton.height + 2)
|
|
|
|
|
- width: (currentAccountButton.width - 2)
|
|
|
|
|
|
|
+ y: (currentAccountButton.y + Style.trayWindowHeaderHeight + 2)
|
|
|
|
|
+
|
|
|
|
|
+ width: (Style.currentAccountButtonWidth - 2)
|
|
|
closePolicy: "CloseOnPressOutside"
|
|
closePolicy: "CloseOnPressOutside"
|
|
|
|
|
|
|
|
background: Rectangle {
|
|
background: Rectangle {
|
|
|
- border.color: "#0082c9"
|
|
|
|
|
- radius: 2
|
|
|
|
|
|
|
+ border.color: Style.ncBlue
|
|
|
|
|
+ radius: Style.currentAccountButtonRadius
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
onClosed: {
|
|
onClosed: {
|
|
|
|
|
+ // HACK: reload account Instantiator immediately by restting it - could be done better I guess
|
|
|
|
|
+ // see also onVisibleChanged above
|
|
|
userLineInstantiator.active = false;
|
|
userLineInstantiator.active = false;
|
|
|
userLineInstantiator.active = true;
|
|
userLineInstantiator.active = true;
|
|
|
}
|
|
}
|
|
@@ -144,26 +171,26 @@ Window {
|
|
|
|
|
|
|
|
MenuItem {
|
|
MenuItem {
|
|
|
id: addAccountButton
|
|
id: addAccountButton
|
|
|
- height: 50
|
|
|
|
|
|
|
+ height: Style.addAccountButtonHeight
|
|
|
|
|
|
|
|
RowLayout {
|
|
RowLayout {
|
|
|
- width: addAccountButton.width
|
|
|
|
|
- height: addAccountButton.height
|
|
|
|
|
|
|
+ anchors.fill: parent
|
|
|
spacing: 0
|
|
spacing: 0
|
|
|
|
|
|
|
|
Image {
|
|
Image {
|
|
|
- Layout.leftMargin: 14
|
|
|
|
|
|
|
+ Layout.leftMargin: 12
|
|
|
verticalAlignment: Qt.AlignCenter
|
|
verticalAlignment: Qt.AlignCenter
|
|
|
source: "qrc:///client/theme/black/add.svg"
|
|
source: "qrc:///client/theme/black/add.svg"
|
|
|
- sourceSize.width: openLocalFolderButton.icon.width
|
|
|
|
|
- sourceSize.height: openLocalFolderButton.icon.height
|
|
|
|
|
|
|
+ sourceSize.width: Style.headerButtonIconSize
|
|
|
|
|
+ sourceSize.height: Style.headerButtonIconSize
|
|
|
}
|
|
}
|
|
|
Label {
|
|
Label {
|
|
|
Layout.leftMargin: 14
|
|
Layout.leftMargin: 14
|
|
|
text: qsTr("Add account")
|
|
text: qsTr("Add account")
|
|
|
color: "black"
|
|
color: "black"
|
|
|
- font.pixelSize: 12
|
|
|
|
|
|
|
+ font.pixelSize: Style.topLinePixelSize
|
|
|
}
|
|
}
|
|
|
|
|
+ // Filler on the right
|
|
|
Item {
|
|
Item {
|
|
|
Layout.fillWidth: true
|
|
Layout.fillWidth: true
|
|
|
Layout.fillHeight: true
|
|
Layout.fillHeight: true
|
|
@@ -176,25 +203,25 @@ Window {
|
|
|
|
|
|
|
|
MenuItem {
|
|
MenuItem {
|
|
|
id: syncPauseButton
|
|
id: syncPauseButton
|
|
|
- font.pixelSize: 12
|
|
|
|
|
|
|
+ font.pixelSize: Style.topLinePixelSize
|
|
|
onClicked: systrayBackend.pauseResumeSync()
|
|
onClicked: systrayBackend.pauseResumeSync()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
MenuItem {
|
|
MenuItem {
|
|
|
text: qsTr("Open settings")
|
|
text: qsTr("Open settings")
|
|
|
- font.pixelSize: 12
|
|
|
|
|
|
|
+ font.pixelSize: Style.topLinePixelSize
|
|
|
onClicked: systrayBackend.openSettings()
|
|
onClicked: systrayBackend.openSettings()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
MenuItem {
|
|
MenuItem {
|
|
|
text: qsTr("Help")
|
|
text: qsTr("Help")
|
|
|
- font.pixelSize: 12
|
|
|
|
|
|
|
+ font.pixelSize: Style.topLinePixelSize
|
|
|
onClicked: systrayBackend.openHelp()
|
|
onClicked: systrayBackend.openHelp()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
MenuItem {
|
|
MenuItem {
|
|
|
text: qsTr("Quit Nextcloud")
|
|
text: qsTr("Quit Nextcloud")
|
|
|
- font.pixelSize: 12
|
|
|
|
|
|
|
+ font.pixelSize: Style.topLinePixelSize
|
|
|
onClicked: systrayBackend.shutdown()
|
|
onClicked: systrayBackend.shutdown()
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -203,41 +230,42 @@ Window {
|
|
|
background:
|
|
background:
|
|
|
Item {
|
|
Item {
|
|
|
id: leftHoverContainer
|
|
id: leftHoverContainer
|
|
|
- height: currentAccountButton.height
|
|
|
|
|
- width: currentAccountButton.width
|
|
|
|
|
|
|
+
|
|
|
|
|
+ height: Style.trayWindowHeaderHeight
|
|
|
|
|
+ width: Style.currentAccountButtonWidth
|
|
|
Rectangle {
|
|
Rectangle {
|
|
|
- width: currentAccountButton.width / 2
|
|
|
|
|
- height: currentAccountButton.height / 2
|
|
|
|
|
|
|
+ width: Style.currentAccountButtonWidth / 2
|
|
|
|
|
+ height: Style.trayWindowHeaderHeight / 2
|
|
|
color: "transparent"
|
|
color: "transparent"
|
|
|
clip: true
|
|
clip: true
|
|
|
Rectangle {
|
|
Rectangle {
|
|
|
- width: currentAccountButton.width
|
|
|
|
|
- height: currentAccountButton.height
|
|
|
|
|
- radius: 10
|
|
|
|
|
|
|
+ width: Style.currentAccountButtonWidth
|
|
|
|
|
+ height: Style.trayWindowHeaderHeight
|
|
|
|
|
+ radius: Style.trayWindowRadius
|
|
|
color: "white"
|
|
color: "white"
|
|
|
opacity: 0.2
|
|
opacity: 0.2
|
|
|
visible: accountBtnMouseArea.containsMouse
|
|
visible: accountBtnMouseArea.containsMouse
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
Rectangle {
|
|
Rectangle {
|
|
|
- width: currentAccountButton.width / 2
|
|
|
|
|
- height: currentAccountButton.height / 2
|
|
|
|
|
|
|
+ width: Style.currentAccountButtonWidth / 2
|
|
|
|
|
+ height: Style.trayWindowHeaderHeight / 2
|
|
|
anchors.bottom: leftHoverContainer.bottom
|
|
anchors.bottom: leftHoverContainer.bottom
|
|
|
color: "white"
|
|
color: "white"
|
|
|
opacity: 0.2
|
|
opacity: 0.2
|
|
|
visible: accountBtnMouseArea.containsMouse
|
|
visible: accountBtnMouseArea.containsMouse
|
|
|
}
|
|
}
|
|
|
Rectangle {
|
|
Rectangle {
|
|
|
- width: currentAccountButton.width / 2
|
|
|
|
|
- height: currentAccountButton.height / 2
|
|
|
|
|
|
|
+ width: Style.currentAccountButtonWidth / 2
|
|
|
|
|
+ height: Style.trayWindowHeaderHeight / 2
|
|
|
anchors.right: leftHoverContainer.right
|
|
anchors.right: leftHoverContainer.right
|
|
|
color: "white"
|
|
color: "white"
|
|
|
opacity: 0.2
|
|
opacity: 0.2
|
|
|
visible: accountBtnMouseArea.containsMouse
|
|
visible: accountBtnMouseArea.containsMouse
|
|
|
}
|
|
}
|
|
|
Rectangle {
|
|
Rectangle {
|
|
|
- width: currentAccountButton.width / 2
|
|
|
|
|
- height: currentAccountButton.height / 2
|
|
|
|
|
|
|
+ width: Style.currentAccountButtonWidth / 2
|
|
|
|
|
+ height: Style.trayWindowHeaderHeight / 2
|
|
|
anchors.right: leftHoverContainer.right
|
|
anchors.right: leftHoverContainer.right
|
|
|
anchors.bottom: leftHoverContainer.bottom
|
|
anchors.bottom: leftHoverContainer.bottom
|
|
|
color: "white"
|
|
color: "white"
|
|
@@ -248,34 +276,38 @@ Window {
|
|
|
|
|
|
|
|
RowLayout {
|
|
RowLayout {
|
|
|
id: accountControlRowLayout
|
|
id: accountControlRowLayout
|
|
|
- height: currentAccountButton.height
|
|
|
|
|
- width: currentAccountButton.width
|
|
|
|
|
|
|
+
|
|
|
|
|
+ height: Style.trayWindowHeaderHeight
|
|
|
|
|
+ width: Style.currentAccountButtonWidth
|
|
|
spacing: 0
|
|
spacing: 0
|
|
|
Image {
|
|
Image {
|
|
|
id: currentAccountAvatar
|
|
id: currentAccountAvatar
|
|
|
|
|
+
|
|
|
Layout.leftMargin: 8
|
|
Layout.leftMargin: 8
|
|
|
verticalAlignment: Qt.AlignCenter
|
|
verticalAlignment: Qt.AlignCenter
|
|
|
cache: false
|
|
cache: false
|
|
|
source: "image://avatars/currentUser"
|
|
source: "image://avatars/currentUser"
|
|
|
- Layout.preferredHeight: (trayWindowHeaderBackground.height -16)
|
|
|
|
|
- Layout.preferredWidth: (trayWindowHeaderBackground.height -16)
|
|
|
|
|
|
|
+ Layout.preferredHeight: Style.accountAvatarSize
|
|
|
|
|
+ Layout.preferredWidth: Style.accountAvatarSize
|
|
|
|
|
+
|
|
|
Rectangle {
|
|
Rectangle {
|
|
|
id: currentAccountStateIndicatorBackground
|
|
id: currentAccountStateIndicatorBackground
|
|
|
- width: currentAccountStateIndicator.sourceSize.width + 2
|
|
|
|
|
|
|
+ width: Style.accountAvatarStateIndicatorSize + 2
|
|
|
height: width
|
|
height: width
|
|
|
anchors.bottom: currentAccountAvatar.bottom
|
|
anchors.bottom: currentAccountAvatar.bottom
|
|
|
anchors.right: currentAccountAvatar.right
|
|
anchors.right: currentAccountAvatar.right
|
|
|
- color: "#0082c9"
|
|
|
|
|
|
|
+ color: Style.ncBlue
|
|
|
radius: width*0.5
|
|
radius: width*0.5
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
Image {
|
|
Image {
|
|
|
id: currentAccountStateIndicator
|
|
id: currentAccountStateIndicator
|
|
|
source: userModelBackend.isUserConnected(userModelBackend.currentUserId()) ? "qrc:///client/theme/colored/state-ok.svg" : "qrc:///client/theme/colored/state-offline.svg"
|
|
source: userModelBackend.isUserConnected(userModelBackend.currentUserId()) ? "qrc:///client/theme/colored/state-ok.svg" : "qrc:///client/theme/colored/state-offline.svg"
|
|
|
cache: false
|
|
cache: false
|
|
|
x: currentAccountStateIndicatorBackground.x + 1
|
|
x: currentAccountStateIndicatorBackground.x + 1
|
|
|
y: currentAccountStateIndicatorBackground.y + 1
|
|
y: currentAccountStateIndicatorBackground.y + 1
|
|
|
- sourceSize.width: 16
|
|
|
|
|
- sourceSize.height: 16
|
|
|
|
|
|
|
+ sourceSize.width: Style.accountAvatarStateIndicatorSize
|
|
|
|
|
+ sourceSize.height: Style.accountAvatarStateIndicatorSize
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -286,34 +318,35 @@ Window {
|
|
|
Layout.leftMargin: 6
|
|
Layout.leftMargin: 6
|
|
|
Label {
|
|
Label {
|
|
|
id: currentAccountUser
|
|
id: currentAccountUser
|
|
|
- width: 128
|
|
|
|
|
|
|
+ width: Style.currentAccountLabelWidth
|
|
|
text: userModelBackend.currentUserName()
|
|
text: userModelBackend.currentUserName()
|
|
|
elide: Text.ElideRight
|
|
elide: Text.ElideRight
|
|
|
color: "white"
|
|
color: "white"
|
|
|
- font.pixelSize: 12
|
|
|
|
|
|
|
+ font.pixelSize: Style.topLinePixelSize
|
|
|
font.bold: true
|
|
font.bold: true
|
|
|
}
|
|
}
|
|
|
Label {
|
|
Label {
|
|
|
id: currentAccountServer
|
|
id: currentAccountServer
|
|
|
- width: 128
|
|
|
|
|
|
|
+ width: Style.currentAccountLabelWidth
|
|
|
text: userModelBackend.currentUserServer()
|
|
text: userModelBackend.currentUserServer()
|
|
|
elide: Text.ElideRight
|
|
elide: Text.ElideRight
|
|
|
color: "white"
|
|
color: "white"
|
|
|
- font.pixelSize: 10
|
|
|
|
|
|
|
+ font.pixelSize: Style.subLinePixelSize
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
Image {
|
|
Image {
|
|
|
Layout.alignment: Qt.AlignRight
|
|
Layout.alignment: Qt.AlignRight
|
|
|
verticalAlignment: Qt.AlignCenter
|
|
verticalAlignment: Qt.AlignCenter
|
|
|
- Layout.margins: 8
|
|
|
|
|
|
|
+ Layout.margins: Style.accountDropDownCaretMargin
|
|
|
source: "qrc:///client/theme/white/caret-down.svg"
|
|
source: "qrc:///client/theme/white/caret-down.svg"
|
|
|
- sourceSize.width: 20
|
|
|
|
|
- sourceSize.height: 20
|
|
|
|
|
|
|
+ sourceSize.width: Style.accountDropDownCaretSize
|
|
|
|
|
+ sourceSize.height: Style.accountDropDownCaretSize
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // Filler between account dropdown and header app buttons
|
|
|
Item {
|
|
Item {
|
|
|
id: trayWindowHeaderSpacer
|
|
id: trayWindowHeaderSpacer
|
|
|
Layout.fillWidth: true
|
|
Layout.fillWidth: true
|
|
@@ -321,19 +354,23 @@ Window {
|
|
|
|
|
|
|
|
Button {
|
|
Button {
|
|
|
id: openLocalFolderButton
|
|
id: openLocalFolderButton
|
|
|
|
|
+
|
|
|
Layout.alignment: Qt.AlignRight
|
|
Layout.alignment: Qt.AlignRight
|
|
|
display: AbstractButton.IconOnly
|
|
display: AbstractButton.IconOnly
|
|
|
- Layout.preferredWidth: (trayWindowHeaderBackground.height)
|
|
|
|
|
- Layout.preferredHeight: (trayWindowHeaderBackground.height)
|
|
|
|
|
|
|
+ Layout.preferredWidth: Style.trayWindowHeaderHeight
|
|
|
|
|
+ Layout.preferredHeight: Style.trayWindowHeaderHeight
|
|
|
flat: true
|
|
flat: true
|
|
|
|
|
|
|
|
icon.source: "qrc:///client/theme/white/folder.svg"
|
|
icon.source: "qrc:///client/theme/white/folder.svg"
|
|
|
|
|
+ icon.width: Style.headerButtonIconSize
|
|
|
|
|
+ icon.height: Style.headerButtonIconSize
|
|
|
icon.color: "transparent"
|
|
icon.color: "transparent"
|
|
|
|
|
|
|
|
MouseArea {
|
|
MouseArea {
|
|
|
id: folderBtnMouseArea
|
|
id: folderBtnMouseArea
|
|
|
|
|
+
|
|
|
anchors.fill: parent
|
|
anchors.fill: parent
|
|
|
- hoverEnabled: true
|
|
|
|
|
|
|
+ hoverEnabled: Style.hoverEffectsEnabled
|
|
|
onClicked:
|
|
onClicked:
|
|
|
{
|
|
{
|
|
|
userModelBackend.openCurrentAccountLocalFolder();
|
|
userModelBackend.openCurrentAccountLocalFolder();
|
|
@@ -349,20 +386,24 @@ Window {
|
|
|
|
|
|
|
|
Button {
|
|
Button {
|
|
|
id: trayWindowTalkButton
|
|
id: trayWindowTalkButton
|
|
|
|
|
+
|
|
|
Layout.alignment: Qt.AlignRight
|
|
Layout.alignment: Qt.AlignRight
|
|
|
display: AbstractButton.IconOnly
|
|
display: AbstractButton.IconOnly
|
|
|
- Layout.preferredWidth: (trayWindowHeaderBackground.height)
|
|
|
|
|
- Layout.preferredHeight: (trayWindowHeaderBackground.height)
|
|
|
|
|
|
|
+ Layout.preferredWidth: Style.trayWindowHeaderHeight
|
|
|
|
|
+ Layout.preferredHeight: Style.trayWindowHeaderHeight
|
|
|
flat: true
|
|
flat: true
|
|
|
visible: userModelBackend.currentServerHasTalk() ? true : false
|
|
visible: userModelBackend.currentServerHasTalk() ? true : false
|
|
|
|
|
|
|
|
icon.source: "qrc:///client/theme/white/talk-app.svg"
|
|
icon.source: "qrc:///client/theme/white/talk-app.svg"
|
|
|
|
|
+ icon.width: Style.headerButtonIconSize
|
|
|
|
|
+ icon.height: Style.headerButtonIconSize
|
|
|
icon.color: "transparent"
|
|
icon.color: "transparent"
|
|
|
|
|
|
|
|
MouseArea {
|
|
MouseArea {
|
|
|
id: talkBtnMouseArea
|
|
id: talkBtnMouseArea
|
|
|
|
|
+
|
|
|
anchors.fill: parent
|
|
anchors.fill: parent
|
|
|
- hoverEnabled: true
|
|
|
|
|
|
|
+ hoverEnabled: Style.hoverEffectsEnabled
|
|
|
onClicked:
|
|
onClicked:
|
|
|
{
|
|
{
|
|
|
userModelBackend.openCurrentAccountTalk();
|
|
userModelBackend.openCurrentAccountTalk();
|
|
@@ -378,19 +419,23 @@ Window {
|
|
|
|
|
|
|
|
Button {
|
|
Button {
|
|
|
id: trayWindowAppsButton
|
|
id: trayWindowAppsButton
|
|
|
|
|
+
|
|
|
Layout.alignment: Qt.AlignRight
|
|
Layout.alignment: Qt.AlignRight
|
|
|
display: AbstractButton.IconOnly
|
|
display: AbstractButton.IconOnly
|
|
|
- Layout.preferredWidth: (trayWindowHeaderBackground.height)
|
|
|
|
|
- Layout.preferredHeight: (trayWindowHeaderBackground.height)
|
|
|
|
|
|
|
+ Layout.preferredWidth: Style.trayWindowHeaderHeight
|
|
|
|
|
+ Layout.preferredHeight: Style.trayWindowHeaderHeight
|
|
|
flat: true
|
|
flat: true
|
|
|
|
|
|
|
|
icon.source: "qrc:///client/theme/white/more-apps.svg"
|
|
icon.source: "qrc:///client/theme/white/more-apps.svg"
|
|
|
|
|
+ icon.width: Style.headerButtonIconSize
|
|
|
|
|
+ icon.height: Style.headerButtonIconSize
|
|
|
icon.color: "transparent"
|
|
icon.color: "transparent"
|
|
|
|
|
|
|
|
MouseArea {
|
|
MouseArea {
|
|
|
id: appsBtnMouseArea
|
|
id: appsBtnMouseArea
|
|
|
|
|
+
|
|
|
anchors.fill: parent
|
|
anchors.fill: parent
|
|
|
- hoverEnabled: true
|
|
|
|
|
|
|
+ hoverEnabled: Style.hoverEffectsEnabled
|
|
|
onClicked:
|
|
onClicked:
|
|
|
{
|
|
{
|
|
|
/*
|
|
/*
|
|
@@ -414,11 +459,11 @@ Window {
|
|
|
Menu {
|
|
Menu {
|
|
|
id: appsMenu
|
|
id: appsMenu
|
|
|
y: (trayWindowAppsButton.y + trayWindowAppsButton.height + 2)
|
|
y: (trayWindowAppsButton.y + trayWindowAppsButton.height + 2)
|
|
|
- width: (trayWindowAppsButton.width * 3)
|
|
|
|
|
|
|
+ width: (Style.headerButtonIconSize * 3)
|
|
|
closePolicy: "CloseOnPressOutside"
|
|
closePolicy: "CloseOnPressOutside"
|
|
|
|
|
|
|
|
background: Rectangle {
|
|
background: Rectangle {
|
|
|
- border.color: "#0082c9"
|
|
|
|
|
|
|
+ border.color: Style.ncBlue
|
|
|
radius: 2
|
|
radius: 2
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -429,7 +474,7 @@ Window {
|
|
|
onObjectRemoved: appsMenu.removeItem(object)
|
|
onObjectRemoved: appsMenu.removeItem(object)
|
|
|
delegate: MenuItem {
|
|
delegate: MenuItem {
|
|
|
text: appName
|
|
text: appName
|
|
|
- font.pixelSize: 12
|
|
|
|
|
|
|
+ font.pixelSize: Style.topLinePixelSize
|
|
|
icon.source: appIconUrl
|
|
icon.source: appIconUrl
|
|
|
onTriggered: appsMenuModelBackend.openAppUrl(appUrl)
|
|
onTriggered: appsMenuModelBackend.openAppUrl(appUrl)
|
|
|
}
|
|
}
|
|
@@ -440,26 +485,26 @@ Window {
|
|
|
background:
|
|
background:
|
|
|
Item {
|
|
Item {
|
|
|
id: rightHoverContainer
|
|
id: rightHoverContainer
|
|
|
- height: trayWindowAppsButton.height
|
|
|
|
|
- width: trayWindowAppsButton.width
|
|
|
|
|
|
|
+ height: Style.trayWindowHeaderHeight
|
|
|
|
|
+ width: Style.trayWindowHeaderHeight
|
|
|
Rectangle {
|
|
Rectangle {
|
|
|
- width: trayWindowAppsButton.width / 2
|
|
|
|
|
- height: trayWindowAppsButton.height / 2
|
|
|
|
|
|
|
+ width: Style.trayWindowHeaderHeight / 2
|
|
|
|
|
+ height: Style.trayWindowHeaderHeight / 2
|
|
|
color: "white"
|
|
color: "white"
|
|
|
opacity: 0.2
|
|
opacity: 0.2
|
|
|
visible: appsBtnMouseArea.containsMouse
|
|
visible: appsBtnMouseArea.containsMouse
|
|
|
}
|
|
}
|
|
|
Rectangle {
|
|
Rectangle {
|
|
|
- width: trayWindowAppsButton.width / 2
|
|
|
|
|
- height: trayWindowAppsButton.height / 2
|
|
|
|
|
|
|
+ width: Style.trayWindowHeaderHeight / 2
|
|
|
|
|
+ height: Style.trayWindowHeaderHeight / 2
|
|
|
anchors.bottom: rightHoverContainer.bottom
|
|
anchors.bottom: rightHoverContainer.bottom
|
|
|
color: "white"
|
|
color: "white"
|
|
|
opacity: 0.2
|
|
opacity: 0.2
|
|
|
visible: appsBtnMouseArea.containsMouse
|
|
visible: appsBtnMouseArea.containsMouse
|
|
|
}
|
|
}
|
|
|
Rectangle {
|
|
Rectangle {
|
|
|
- width: trayWindowAppsButton.width / 2
|
|
|
|
|
- height: trayWindowAppsButton.height / 2
|
|
|
|
|
|
|
+ width: Style.trayWindowHeaderHeight / 2
|
|
|
|
|
+ height: Style.trayWindowHeaderHeight / 2
|
|
|
anchors.bottom: rightHoverContainer.bottom
|
|
anchors.bottom: rightHoverContainer.bottom
|
|
|
anchors.right: rightHoverContainer.right
|
|
anchors.right: rightHoverContainer.right
|
|
|
color: "white"
|
|
color: "white"
|
|
@@ -469,15 +514,15 @@ Window {
|
|
|
Rectangle {
|
|
Rectangle {
|
|
|
id: rightHoverContainerClipper
|
|
id: rightHoverContainerClipper
|
|
|
anchors.right: rightHoverContainer.right
|
|
anchors.right: rightHoverContainer.right
|
|
|
- width: trayWindowAppsButton.width / 2
|
|
|
|
|
- height: trayWindowAppsButton.height / 2
|
|
|
|
|
|
|
+ width: Style.trayWindowHeaderHeight / 2
|
|
|
|
|
+ height: Style.trayWindowHeaderHeight / 2
|
|
|
color: "transparent"
|
|
color: "transparent"
|
|
|
clip: true
|
|
clip: true
|
|
|
Rectangle {
|
|
Rectangle {
|
|
|
- width: trayWindowAppsButton.width
|
|
|
|
|
- height: trayWindowAppsButton.height
|
|
|
|
|
|
|
+ width: Style.trayWindowHeaderHeight
|
|
|
|
|
+ height: Style.trayWindowHeaderHeight
|
|
|
anchors.right: rightHoverContainerClipper.right
|
|
anchors.right: rightHoverContainerClipper.right
|
|
|
- radius: 10
|
|
|
|
|
|
|
+ radius: Style.trayWindowRadius
|
|
|
color: "white"
|
|
color: "white"
|
|
|
opacity: 0.2
|
|
opacity: 0.2
|
|
|
visible: appsBtnMouseArea.containsMouse
|
|
visible: appsBtnMouseArea.containsMouse
|
|
@@ -490,9 +535,11 @@ Window {
|
|
|
|
|
|
|
|
ListView {
|
|
ListView {
|
|
|
id: activityListView
|
|
id: activityListView
|
|
|
|
|
+
|
|
|
anchors.top: trayWindowHeaderBackground.bottom
|
|
anchors.top: trayWindowHeaderBackground.bottom
|
|
|
- width: trayWindowBackground.width
|
|
|
|
|
- height: trayWindowBackground.height - trayWindowHeaderBackground.height
|
|
|
|
|
|
|
+ anchors.horizontalCenter: trayWindowBackground.horizontalCenter
|
|
|
|
|
+ width: Style.trayWindowWidth - Style.trayWindowBorderWidth
|
|
|
|
|
+ height: Style.trayWindowHeight - Style.trayWindowHeaderHeight
|
|
|
clip: true
|
|
clip: true
|
|
|
ScrollBar.vertical: ScrollBar {
|
|
ScrollBar.vertical: ScrollBar {
|
|
|
id: listViewScrollbar
|
|
id: listViewScrollbar
|
|
@@ -502,12 +549,14 @@ Window {
|
|
|
|
|
|
|
|
delegate: RowLayout {
|
|
delegate: RowLayout {
|
|
|
id: activityItem
|
|
id: activityItem
|
|
|
- width: activityListView.width
|
|
|
|
|
- height: trayWindowHeaderLayout.height
|
|
|
|
|
|
|
+
|
|
|
|
|
+ width: parent.width
|
|
|
|
|
+ height: Style.trayWindowHeaderHeight
|
|
|
spacing: 0
|
|
spacing: 0
|
|
|
|
|
|
|
|
Image {
|
|
Image {
|
|
|
id: activityIcon
|
|
id: activityIcon
|
|
|
|
|
+
|
|
|
Layout.leftMargin: 8
|
|
Layout.leftMargin: 8
|
|
|
Layout.rightMargin: 8
|
|
Layout.rightMargin: 8
|
|
|
Layout.preferredWidth: activityButton1.icon.width
|
|
Layout.preferredWidth: activityButton1.icon.width
|
|
@@ -520,14 +569,15 @@ Window {
|
|
|
}
|
|
}
|
|
|
Column {
|
|
Column {
|
|
|
id: activityTextColumn
|
|
id: activityTextColumn
|
|
|
|
|
+
|
|
|
spacing: 4
|
|
spacing: 4
|
|
|
Layout.alignment: Qt.AlignLeft
|
|
Layout.alignment: Qt.AlignLeft
|
|
|
Text {
|
|
Text {
|
|
|
id: activityTextTitle
|
|
id: activityTextTitle
|
|
|
text: (type === "Activity" || type === "Notification") ? subject : message
|
|
text: (type === "Activity" || type === "Notification") ? subject : message
|
|
|
- width: 240 + ((path === "") ? activityItem.height : 0) + ((link === "") ? activityItem.height : 0) - 8
|
|
|
|
|
|
|
+ width: Style.activityLabelBaseWidth + ((path === "") ? activityItem.height : 0) + ((link === "") ? activityItem.height : 0) - 8
|
|
|
elide: Text.ElideRight
|
|
elide: Text.ElideRight
|
|
|
- font.pixelSize: 12
|
|
|
|
|
|
|
+ font.pixelSize: Style.topLinePixelSize
|
|
|
color: activityTextTitleColor
|
|
color: activityTextTitleColor
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -535,18 +585,18 @@ Window {
|
|
|
id: activityTextInfo
|
|
id: activityTextInfo
|
|
|
text: (type === "Activity" || type === "File" || type === "Sync") ? displaypath : message
|
|
text: (type === "Activity" || type === "File" || type === "Sync") ? displaypath : message
|
|
|
height: (text === "") ? 0 : activityTextTitle.height
|
|
height: (text === "") ? 0 : activityTextTitle.height
|
|
|
- width: 240 + ((path === "") ? activityItem.height : 0) + ((link === "") ? activityItem.height : 0) - 8
|
|
|
|
|
|
|
+ width: Style.activityLabelBaseWidth + ((path === "") ? activityItem.height : 0) + ((link === "") ? activityItem.height : 0) - 8
|
|
|
elide: Text.ElideRight
|
|
elide: Text.ElideRight
|
|
|
- font.pixelSize: 10
|
|
|
|
|
|
|
+ font.pixelSize: Style.subLinePixelSize
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
Text {
|
|
Text {
|
|
|
id: activityTextDateTime
|
|
id: activityTextDateTime
|
|
|
text: dateTime
|
|
text: dateTime
|
|
|
height: (text === "") ? 0 : activityTextTitle.height
|
|
height: (text === "") ? 0 : activityTextTitle.height
|
|
|
- width: 240 + ((path === "") ? activityItem.height : 0) + ((link === "") ? activityItem.height : 0) - 8
|
|
|
|
|
|
|
+ width: Style.activityLabelBaseWidth + ((path === "") ? activityItem.height : 0) + ((link === "") ? activityItem.height : 0) - 8
|
|
|
elide: Text.ElideRight
|
|
elide: Text.ElideRight
|
|
|
- font.pixelSize: 10
|
|
|
|
|
|
|
+ font.pixelSize: Style.subLinePixelSize
|
|
|
color: "#808080"
|
|
color: "#808080"
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -556,8 +606,9 @@ Window {
|
|
|
}
|
|
}
|
|
|
Button {
|
|
Button {
|
|
|
id: activityButton1
|
|
id: activityButton1
|
|
|
- Layout.preferredWidth: (path === "") ? 0 : activityItem.height
|
|
|
|
|
- Layout.preferredHeight: activityItem.height
|
|
|
|
|
|
|
+
|
|
|
|
|
+ Layout.preferredWidth: (path === "") ? 0 : parent.height
|
|
|
|
|
+ Layout.preferredHeight: parent.height
|
|
|
Layout.alignment: Qt.AlignRight
|
|
Layout.alignment: Qt.AlignRight
|
|
|
flat: true
|
|
flat: true
|
|
|
hoverEnabled: false
|
|
hoverEnabled: false
|
|
@@ -572,8 +623,9 @@ Window {
|
|
|
}
|
|
}
|
|
|
Button {
|
|
Button {
|
|
|
id: activityButton2
|
|
id: activityButton2
|
|
|
- Layout.preferredWidth: (link === "") ? 0 : activityItem.height
|
|
|
|
|
- Layout.preferredHeight: activityItem.height
|
|
|
|
|
|
|
+
|
|
|
|
|
+ Layout.preferredWidth: (link === "") ? 0 : parent.height
|
|
|
|
|
+ Layout.preferredHeight: parent.height
|
|
|
Layout.alignment: Qt.AlignRight
|
|
Layout.alignment: Qt.AlignRight
|
|
|
flat: true
|
|
flat: true
|
|
|
hoverEnabled: false
|
|
hoverEnabled: false
|