diff --git a/ui/app/AppMain.qml b/ui/app/AppMain.qml index 585e75ea1e..ca94bc9e49 100644 --- a/ui/app/AppMain.qml +++ b/ui/app/AppMain.qml @@ -28,6 +28,7 @@ Item { anchors.fill: parent property alias appSettings: appSettings + property alias appLayout: appLayout property var newVersionJSON: JSON.parse(utilsModel.newVersion) property bool profilePopupOpened: false property bool networkGuarded: profileModel.network.current === Constants.networkMainnet || (profileModel.network.current === Constants.networkRopsten && appSettings.stickersEnsRopsten) @@ -254,6 +255,8 @@ Item { } StatusAppLayout { + id: appLayout + width: parent.width anchors.top: parent.top anchors.topMargin: (versionWarning.visible || mnemonicBackupWarning.visible) ? 32 : 0 diff --git a/ui/main.qml b/ui/main.qml index 0c13b27b9d..37a190876a 100644 --- a/ui/main.qml +++ b/ui/main.qml @@ -320,12 +320,10 @@ StatusWindow { property alias droppedUrls: rptDraggedPreviews.model readonly property int chatView: Utils.getAppSectionIndex(Constants.chat) readonly property int timelineView: Utils.getAppSectionIndex(Constants.timeline) - property bool enabled: containsDrag && - drag.source.objectName !== "chatItem" && - drag.source.objectName !== "chatListCategory" && loader.item && + property bool enabled: !drag.source && !!loader.item && !!loader.item.appLayout && ( // in chat view - (loader.item.currentView === chatView && + (loader.item.appLayout.appView.currentIndex === chatView && ( // in a one-to-one chat chatsModel.channelView.activeChannel.chatType === Constants.chatTypeOneToOne || @@ -334,7 +332,7 @@ StatusWindow { ) ) || // in timeline view - loader.item.currentView === timelineView || + loader.item.appLayout.appView.currentIndex === timelineView || // In community section chatsModel.communities.activeCommunity.active ) @@ -355,7 +353,7 @@ StatusWindow { cleanup() } onEntered: { - if (!enabled) { + if (!enabled || !!drag.source) { drag.accepted = false return } @@ -378,7 +376,7 @@ StatusWindow { states: [ State { - when: dragTarget.enabled + when: dragTarget.enabled && dragTarget.containsDrag PropertyChanges { target: dropRectangle color: Style.current.background