Skip to content

Commit 247f01a

Browse files
author
void
committed
hopefully the last cursor sync (match changes to xarcan)
FossilOrigin-Name: 7e69c1bfa0b96d643049087337a2dd9304526e8efcb81687a1cc4ea96d91663b
1 parent 0bbd0ca commit 247f01a

File tree

10 files changed

+45
-28
lines changed

10 files changed

+45
-28
lines changed

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ and licensed under the Apache-2.0 license.
2626

2727
The included UI font, IBM/Plex, is provided free via the SIL OpenFont License 1.1.
2828

29+
The included cursors, phinger, are provided free (cc-by-sa 4.0)
30+
https://github.com/phisch/phinger-cursors
31+
2932
The included fallback font, Emoji-One, is provided free (cc-by 4.0 attribution)
3033
by http://emojione.com
3134

durden/builtin/mouse.lua

+3-6
Original file line numberDiff line numberDiff line change
@@ -1377,8 +1377,6 @@ function mouse_custom_cursor(ct)
13771377
image_shader(mstate.cursor, "DEFAULT");
13781378
end
13791379

1380-
print("custom-cursor", ct.hotspot_x, ct.hotspot_y);
1381-
13821380
mstate.hotspot_x = ct.hotspot_x;
13831381
mstate.hotspot_y = ct.hotspot_y;
13841382
mstate.active_label = "";
@@ -1387,24 +1385,23 @@ function mouse_custom_cursor(ct)
13871385
mouse_cursor_draw();
13881386
end
13891387

1390-
function mouse_switch_cursor(label)
1388+
function mouse_switch_cursor(label, force)
13911389
if (label == nil) then
13921390
label = "default";
13931391
end
13941392

1395-
if (label == mstate.active_label) then
1393+
if (label == mstate.active_label and not force) then
13961394
return;
13971395
end
13981396

1399-
mstate.active_label = label;
1400-
14011397
if (cursors[label] == nil) then
14021398
hide_image(mstate.cursor);
14031399
return;
14041400
end
14051401

14061402
local ct = cursors[label];
14071403
mouse_custom_cursor(ct);
1404+
mstate.active_label = label;
14081405
end
14091406

14101407
function mouse_cursors()

durden/cursor/default/context.png

915 Bytes
Loading

durden/cursor/default/default.lua

+30-14
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,38 @@
11
return
22
{
3+
-- generic
34
default = {"default.png", 0, 0},
4-
drag = {"drag.png", 8, 7},
55
wait = {"wait.png", 12, 12},
66
forbidden = {"forbidden.png", 12, 12},
77
grabhint = {"grabhint.png", 8, 10},
8-
hand = {"pointer.png", 14, 6},
9-
sizeall = {"sizeall.png", 16, 16},
108
crosshair = {"crosshair.png", 12, 12},
11-
["col-resize"] = {"rz_col.png", 16, 15},
12-
cell = {"cell.png", 12, 12},
13-
typefield = {"typefield.png", 12, 12},
14-
rz_diag_l = {"rz_diag_l.png", 6, 6},
15-
rz_diag_r = {"rz_diag_r.png", 6, 6},
16-
rz_down = {"rz_down.png", 6, 13},
17-
rz_left = {"rz_left.png", 0, 5},
18-
rz_right = {"rz_right.png", 14, 5},
19-
rz_up = {"rz_up.png", 5, 0},
9+
hand = {"pointer.png", 14, 6},
2010
["zoom-in"] = {"zoom-in.png", 11, 11},
21-
["zoom-out"] = {"zoom-out.png", 11, 11}
22-
}
11+
["zoom-out"] = {"zoom-out.png", 11, 11},
12+
help = {"help.png", 0, 0},
13+
["context-menu"] = {"context.png", 1, 1},
14+
-- data oriented
15+
typefield = {"typefield.png", 12, 12},
16+
datafield = {"typefield.png", 12, 12},
17+
["vertical-datafield"] = {"verticaldata.png", 12, 12},
18+
cell = {"cell.png", 12, 12},
19+
alias = {"alias.png", 12, 12},
20+
-- drag and drop
21+
drag = {"drag.png", 8, 7},
22+
["drag-drop"] = {"drag-drop.png", 0, 0},
23+
["drag-reject"] = {"drag-reject.png", 0, 0},
24+
-- resizing operations
25+
sizeall = {"sizeall.png", 16, 16},
26+
west = {"rz_left.png", 0, 5},
27+
east = {"rz_right.png", 16, 15},
28+
north = {"rz_up.png", 5, 0},
29+
south = {"rz_down.png", 5, 0},
30+
["west-east"] = {"rz_leftright.png", 15, 15},
31+
["north-south"] = {"rz_updown.png", 12, 12},
32+
["north-west"] = {"rz_diag_l.png", 6, 6},
33+
["south-west"] = {"rz_diag_l.png", 6, 6},
34+
["north-east"] = {"rz_diag_r.png", 6, 6},
35+
["south-east"] = {"rz_diag_r.png", 6, 6},
36+
["north-west-south-east"] = {"rz_diag_l.png", 6, 6},
37+
["south-west-north-east"] = {"rz_diag_r.png", 6, 6},
38+
}

durden/cursor/default/drag-reject.png

1.67 KB
Loading

durden/cursor/default/forbidden.png

1.56 KB
Loading

durden/cursor/default/help.png

1.84 KB
Loading

durden/cursor/default/rz_updown.png

1.04 KB
Loading

durden/durden.lua

+1
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@ load_configure_mouse = function()
283283

284284
local setname = gconfig_get("mouse_cursorset") or "default"
285285
mouse_load_theme("cursor", setname)
286+
mouse_switch_cursor("default", true)
286287

287288
switch_default_texfilter(FILTER_NONE);
288289

durden/tiler_mh.lua

+8-8
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ end
2121

2222
-- map rectangle edge to mouse-cursor direction and name
2323
local dir_lut = {
24-
ul = {"rz_diag_r", {-1, -1, 1, 1}},
25-
u = {"rz_up", {0, -1, 0, 1}},
26-
ur = {"rz_diag_l", {1, -1, 0, 1}},
27-
r = {"rz_right", {1, 0, 0, 0}},
28-
lr = {"rz_diag_r", {1, 1, 0, 0}},
29-
d = {"rz_down", {0, 1, 0, 0}},
30-
ll = {"rz_diag_l", {-1, 1, 1, 0}},
31-
l = {"rz_left", {-1, 0, 1, 0}}
24+
ul = {"north-west", {-1, -1, 1, 1}},
25+
u = {"north", {0, -1, 0, 1}},
26+
ur = {"north-east", {1, -1, 0, 1}},
27+
r = {"east", {1, 0, 0, 0}},
28+
lr = {"south-east", {1, 1, 0, 0}},
29+
d = {"south", {0, 1, 0, 0}},
30+
ll = {"south-west", {-1, 1, 1, 0}},
31+
l = {"left", {-1, 0, 1, 0}}
3232
};
3333

3434
-- display- local coordinate to window border conversion

0 commit comments

Comments
 (0)