Skip to content

Commit c9926b7

Browse files
committed
dragdrop-own-cursor
1 parent da61500 commit c9926b7

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

services/static-webserver/client/source/class/osparc/dashboard/DragWidget.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,24 +40,22 @@ qx.Class.define("osparc.dashboard.DragWidget", {
4040
if (this.getContentElement()) {
4141
const domEl = this.getContentElement().getDomElement();
4242
domEl.style.left = `${e.pageX + 12}px`;
43-
domEl.style.top = `${e.pageY + 12}px`;
43+
domEl.style.top = `${e.pageY + 16}px`;
4444
}
4545
},
4646

4747
start: function() {
4848
this.show();
4949
document.addEventListener("mousemove", this.__onMouseMoveDragging.bind(this), false);
5050

51-
// this widget will give the drop validity feedback
5251
const cursor = qx.ui.core.DragDropCursor.getInstance();
53-
cursor.setAppearance("dragdrop-no-cursor");
52+
cursor.setAppearance("dragdrop-own-cursor");
5453
},
5554

5655
end: function() {
5756
this.exclude();
5857
document.removeEventListener("mousemove", this.__onMouseMoveDragging.bind(this), false);
5958

60-
// reset to default
6159
const cursor = qx.ui.core.DragDropCursor.getInstance();
6260
cursor.setAppearance("dragdrop-cursor");
6361
},

services/static-webserver/client/source/class/osparc/theme/Appearance.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,18 @@ qx.Theme.define("osparc.theme.Appearance", {
1919
extend: osparc.theme.common.Appearance,
2020

2121
appearances: {
22-
"dragdrop-no-cursor": {
22+
"dragdrop-own-cursor": {
2323
style: states => {
24+
let icon = "";
25+
if (states.move) {
26+
icon = "@FontAwesome5Solid/check/14";
27+
} else {
28+
icon = "@FontAwesome5Solid/times/14";
29+
}
2430
return {
25-
source: "",
31+
source: icon,
32+
position: "right-top",
33+
offset: [0, 0, 0, 12],
2634
}
2735
}
2836
},

0 commit comments

Comments
 (0)