-
-
Notifications
You must be signed in to change notification settings - Fork 104
/
FolderTools.js
69 lines (63 loc) · 2.21 KB
/
FolderTools.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*
SPDX-FileCopyrightText: 2014 Eike Hein <hein@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
var iconSizes = [Kirigami.Units.iconSizes.smallMedium,
Kirigami.Units.iconSizes.medium,
Kirigami.Units.iconSizes.large,
Kirigami.Units.iconSizes.huge,
Kirigami.Units.iconSizes.large*2,
Kirigami.Units.iconSizes.enormous,
Kirigami.Units.iconSizes.enormous*2];
function iconSizeFromTheme(size) {
return iconSizes[size];
}
function effectiveNavDirection(flow, layoutDirection, direction) {
if (direction == Qt.LeftArrow) {
if (flow == GridView.FlowLeftToRight) {
if (layoutDirection == Qt.LeftToRight) {
return Qt.LeftArrow;
} else {
return Qt.RightArrow;
}
} else {
if (layoutDirection == Qt.LeftToRight) {
return Qt.UpArrow;
} else {
return Qt.DownArrow;
}
}
} else if (direction == Qt.RightArrow) {
if (flow == GridView.FlowLeftToRight) {
if (layoutDirection == Qt.LeftToRight) {
return Qt.RightArrow;
} else {
return Qt.LeftArrow;
}
} else {
if (layoutDirection == Qt.LeftToRight) {
return Qt.DownArrow;
} else {
return Qt.UpArrow;
}
}
} else if (direction == Qt.UpArrow) {
if (flow == GridView.FlowLeftToRight) {
return Qt.UpArrow;
} else {
return Qt.LeftArrow;
}
} else if (direction == Qt.DownArrow) {
if (flow == GridView.FlowLeftToRight) {
return Qt.DownArrow;
} else {
return Qt.RightArrow
}
}
}
function isFileDrag(event) {
var taskUrl = event.mimeData.formats.indexOf("text/x-orgkdeplasmataskmanager_taskurl") != -1;
var arkService = event.mimeData.formats.indexOf("application/x-kde-ark-dndextract-service") != -1;
var arkPath = event.mimeData.formats.indexOf("application/x-kde-ark-dndextract-path") != -1;
return (event.mimeData.hasUrls || taskUrl || (arkService && arkPath));
}