improve activate applets for neutral areas

pull/2/head
Michail Vourlakos 7 years ago
parent 1c5cebda99
commit efb04895be

@ -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;

Loading…
Cancel
Save