File indexing completed on 2025-03-09 05:03:36
0001 /* 0002 SPDX-FileCopyrightText: 2014 Eike Hein <hein@kde.org> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 var iconSizes = [Kirigami.Units.iconSizes.smallMedium, 0008 Kirigami.Units.iconSizes.medium, 0009 Kirigami.Units.iconSizes.large, 0010 Kirigami.Units.iconSizes.huge, 0011 Kirigami.Units.iconSizes.large*2, 0012 Kirigami.Units.iconSizes.enormous, 0013 Kirigami.Units.iconSizes.enormous*2]; 0014 0015 function iconSizeFromTheme(size) { 0016 return iconSizes[size]; 0017 } 0018 0019 function effectiveNavDirection(flow, layoutDirection, direction) { 0020 if (direction == Qt.LeftArrow) { 0021 if (flow == GridView.FlowLeftToRight) { 0022 if (layoutDirection == Qt.LeftToRight) { 0023 return Qt.LeftArrow; 0024 } else { 0025 return Qt.RightArrow; 0026 } 0027 } else { 0028 if (layoutDirection == Qt.LeftToRight) { 0029 return Qt.UpArrow; 0030 } else { 0031 return Qt.DownArrow; 0032 } 0033 } 0034 } else if (direction == Qt.RightArrow) { 0035 if (flow == GridView.FlowLeftToRight) { 0036 if (layoutDirection == Qt.LeftToRight) { 0037 return Qt.RightArrow; 0038 } else { 0039 return Qt.LeftArrow; 0040 } 0041 } else { 0042 if (layoutDirection == Qt.LeftToRight) { 0043 return Qt.DownArrow; 0044 } else { 0045 return Qt.UpArrow; 0046 } 0047 } 0048 } else if (direction == Qt.UpArrow) { 0049 if (flow == GridView.FlowLeftToRight) { 0050 return Qt.UpArrow; 0051 } else { 0052 return Qt.LeftArrow; 0053 } 0054 } else if (direction == Qt.DownArrow) { 0055 if (flow == GridView.FlowLeftToRight) { 0056 return Qt.DownArrow; 0057 } else { 0058 return Qt.RightArrow 0059 } 0060 } 0061 } 0062 0063 function isFileDrag(event) { 0064 var taskUrl = event.mimeData.formats.indexOf("text/x-orgkdeplasmataskmanager_taskurl") != -1; 0065 var arkService = event.mimeData.formats.indexOf("application/x-kde-ark-dndextract-service") != -1; 0066 var arkPath = event.mimeData.formats.indexOf("application/x-kde-ark-dndextract-path") != -1; 0067 0068 return (event.mimeData.hasUrls || taskUrl || (arkService && arkPath)); 0069 }