1
0
mirror of https://github.com/KDE/latte-dock.git synced 2025-03-20 18:50:15 +03:00

improve activate applets for neutral areas

This commit is contained in:
Michail Vourlakos 2017-12-02 20:13:25 +02:00
parent 1c5cebda99
commit efb04895be

View File

@ -161,6 +161,16 @@ Item {
}
/// BEGIN functions
function activateAppletForNeutralAreas(mouse){
//if the event is at the active indicator or spacers area then try to expand the applet,
//unfortunately for other applets there is no other way to activate them yet
//for example the icon-only applets
var choords = mapToItem(container.appletWrapper, mouse.x, mouse.y);
if (choords.x<0 || choords.y<0 || choords.x>=container.appletWrapper.width || choords.y>=container.appletWrapper.height) {
dock.toggleAppletExpanded(applet.id);
}
}
function checkIndex(){
index = -1;
@ -430,6 +440,18 @@ Item {
border.color: "green"
border.width: 1
}*/
MouseArea{
id: appletMouseAreaBottom
anchors.fill: parent
propagateComposedEvents: true
visible: !appletMouseArea.visible && !root.editMode
onPressed: {
container.activateAppletForNeutralAreas(mouse);
mouse.accepted = false;
}
}
Flow{
id: appletFlow
@ -596,13 +618,7 @@ Item {
}
onPressed: {
//if the event is at the active indicator or spacers area then try to expand the applet,
//unfortunately for other applets there is no other way to activate them yet
//for example the icon-only applets
var choords = mapToItem(container.appletWrapper, mouse.x, mouse.y);
if (choords.x<0 || choords.y<0 || choords.x>=container.appletWrapper.width || choords.y>=container.appletWrapper.height) {
dock.toggleAppletExpanded(applet.id);
}
container.activateAppletForNeutralAreas(mouse);
pressed = true;
mouse.accepted = false;