Warning, /plasma/latte-dock/containment/package/contents/ui/abilities/privates/PositionShortcutsPrivate.qml is written in an unsupported language. File is not indexed.
0001 /*
0002 SPDX-FileCopyrightText: 2020 Michail Vourlakos <mvourlakos@gmail.com>
0003 SPDX-License-Identifier: GPL-2.0-or-later
0004 */
0005
0006 import QtQuick 2.7
0007
0008 import org.kde.latte.abilities.definition 0.1 as AbilityDefinition
0009
0010 AbilityDefinition.PositionShortcuts {
0011 id: _shortcutsprivate
0012 property Item layouts: null
0013 property bool updateIsBlocked: false
0014
0015 readonly property bool unifiedGlobalShortcuts: appletIdStealingPositionShortcuts === -1
0016
0017 property bool showAppletShortcutBadges: false
0018 property bool showMetaBadge: false
0019 property int applicationLauncherId: -1
0020
0021 property int appletIdStealingPositionShortcuts: -1
0022
0023 signal currentAppletStealingPositionShortcuts(int id);
0024
0025 Binding {
0026 target: _shortcutsprivate
0027 property: "badges"
0028 when: !updateIsBlocked && shortcutsEngine
0029 value: shortcutsEngine.badgesForActivate
0030 }
0031
0032 Binding {
0033 target: _shortcutsprivate
0034 property: "appletIdStealingPositionShortcuts"
0035 when: !updateIsBlocked
0036 value: {
0037 var sLayout = layouts.startLayout;
0038 for (var i=0; i<sLayout.children.length; ++i){
0039 var appletItem = sLayout.children[i];
0040 if (appletItem
0041 && appletItem.index>=0
0042 && appletItem.communicator
0043 && appletItem.communicator.positionShortcutsAreSupported
0044 && appletItem.communicator.bridge.shortcuts.client.isStealingGlobalPositionShortcuts) {
0045 return appletItem.index;
0046 }
0047 }
0048
0049 var mLayout = layouts.mainLayout;
0050 for (var i=0; i<mLayout.children.length; ++i){
0051 var appletItem = mLayout.children[i];
0052 if (appletItem
0053 && appletItem.index>=0
0054 && appletItem.communicator
0055 && appletItem.communicator.positionShortcutsAreSupported
0056 && appletItem.communicator.bridge.shortcuts.client.isStealingGlobalPositionShortcuts) {
0057 return appletItem.index;
0058 }
0059 }
0060
0061 var eLayout = layouts.endLayout;
0062 for (var i=0; i<eLayout.children.length; ++i){
0063 var appletItem = eLayout.children[i];
0064 if (appletItem
0065 && appletItem.index>=0
0066 && appletItem.communicator
0067 && appletItem.communicator.positionShortcutsAreSupported
0068 && appletItem.communicator.bridge.shortcuts.client.isStealingGlobalPositionShortcuts) {
0069 return appletItem.index;
0070 }
0071 }
0072
0073 return -1;
0074 }
0075 }
0076 }