\r
// Custom qml modules are in /theme (and included by resources.qrc)\r
import Style 1.0\r
+import com.nextcloud.gui 1.0\r
\r
Window {\r
\r
switch(tbOrientation) {\r
// Platform separation here: Windows and macOS draw coordinates have to be given in screen-coordinates\r
// KDE and most xorg based DEs expect them as virtual coordinates\r
- case 0:\r
+ case Systray.Bottom:\r
console.debug("Taskbar is on the bottom.");\r
trayWindowX = trayIconCenter.x - trayWindow.width / 2;\r
trayWindowY = (Qt.platform.os !== "linux") ? (Screen.height - taskbarRect.height - trayWindow.height - 4)\r
: (Screen.height + Screen.virtualY - taskbarRect.height - trayWindow.height - 4);\r
break;\r
- case 1:\r
+ case Systray.Left:\r
console.debug("Taskbar is on the left.");\r
trayWindowX = (Qt.platform.os !== "linux") ? (taskbarRect.width + 4)\r
: (Screen.virtualX + taskbarRect.width + 4);\r
trayWindowY = trayIconCenter.y;\r
break;\r
- case 2:\r
+ case Systray.Top:\r
console.debug("Taskbar is on the top.");\r
trayWindowX = trayIconCenter.x - trayWindow.width / 2;\r
trayWindowY = Screen.virtualY + taskbarRect.height + 4;\r
break;\r
- case 3:\r
+ case Systray.Right:\r
console.debug("Taskbar is on the right.");\r
trayWindowX = (Qt.platform.os !== "linux") ? (Screen.width - taskbarRect.width - trayWindow.width - 4)\r
: (Screen.width + Screen.virtualX - taskbarRect.width - trayWindow.width - 4);\r
if (Qt.platform.os !== "linux") {\r
trayWindowX = Screen.width - trayWindow.width - 4;\r
} else {\r
- trayWindowX = Screen.width + Screen.virtualX - trayWindow.width - 4 - (tbOrientation === 3 ? taskbarRect.width : 0);\r
+ trayWindowX = Screen.width + Screen.virtualX - trayWindow.width - 4 - (tbOrientation === Systray.Right ? taskbarRect.width : 0);\r
}\r
}\r
if (trayWindowX <= Screen.x && Qt.platform.os !== "linux") {\r
}\r
if (trayWindowX <= Screen.virtualX && Qt.platform.os === "linux") {\r
console.debug("Out-of-screen condition on the left detected. Adjusting window position.");\r
- trayWindowX = Screen.virtualX + 4 + (tbOrientation === 1 ? taskbarRect.width : 0)\r
+ trayWindowX = Screen.virtualX + 4 + (tbOrientation === Systray.Left ? taskbarRect.width : 0)\r
}\r
if (trayWindowY <= Screen.y && Qt.platform.os !== "linux") {\r
console.debug("Out-of-screen condition on the top detected. Adjusting window position.");\r
}\r
if (trayWindowY <= Screen.virtualY && Qt.platform.os === "linux") {\r
console.debug("Out-of-screen condition on the top detected. Adjusting window position.");\r
- trayWindowY = Screen.virtualY + 4 + (tbOrientation === 2 ? taskbarRect.height : 0);\r
+ trayWindowY = Screen.virtualY + 4 + (tbOrientation === Systray.Top ? taskbarRect.height : 0);\r
}\r
if (Screen.height <= trayWindowY - Screen.virtualY + trayWindow.height) {\r
console.debug("Out-of-screen condition on the bottom detected. Adjusting window position.");\r