-
-
Notifications
You must be signed in to change notification settings - Fork 207
Expand file tree
/
Copy pathmenu.py
More file actions
78 lines (77 loc) · 3.04 KB
/
Copy pathmenu.py
File metadata and controls
78 lines (77 loc) · 3.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
DEFAULTS = {
"animation": {"enabled": True, "type": "fadeInOut", "duration": 200},
"tooltip": True,
"container_padding": {"top": 0, "left": 0, "bottom": 0, "right": 0},
"popup_padding": {"top": 8, "left": 8, "bottom": 8, "right": 8},
"popup_offset": {"top": 0, "left": 0},
"alignment": "left",
"direction": "down",
}
VALIDATION_SCHEMA = {
"label": {"type": "string", "required": False, "default": ""},
"icon": {"type": "string", "required": False, "default": ""},
"class_name": {"type": "string", "required": False, "default": ""},
"image_icon_size": {"type": "integer", "required": False, "default": 14},
"popup_image_icon_size": {"type": "integer", "required": False, "default": 16},
"menu_items": {
"type": "list",
"required": True,
"schema": {
"type": "dict",
"schema": {
"icon": {"type": "string"},
"launch": {"type": "string"},
"name": {"type": "string", "required": False},
},
},
},
"animation": {
"type": "dict",
"required": False,
"schema": {
"enabled": {"type": "boolean", "default": DEFAULTS["animation"]["enabled"]},
"type": {"type": "string", "default": DEFAULTS["animation"]["type"]},
"duration": {"type": "integer", "default": DEFAULTS["animation"]["duration"]},
},
"default": DEFAULTS["animation"],
},
"tooltip": {"type": "boolean", "default": True, "required": False},
"blur": {"type": "boolean", "default": False, "required": False},
"alignment": {
"type": "string",
"default": DEFAULTS["alignment"],
"required": False,
"allowed": ["left", "right", "center"],
},
"direction": {
"type": "string",
"default": DEFAULTS["direction"],
"required": False,
"allowed": ["up", "down"],
},
"popup_offset": {"type": "dict", "default": DEFAULTS["popup_offset"], "required": False},
"label_shadow": {
"type": "dict",
"required": False,
"schema": {
"enabled": {"type": "boolean", "default": False},
"color": {"type": "string", "default": "black"},
"offset": {"type": "list", "default": [1, 1]},
"radius": {"type": "integer", "default": 3},
},
"default": {"enabled": False, "color": "black", "offset": [1, 1], "radius": 3},
},
"container_shadow": {
"type": "dict",
"required": False,
"schema": {
"enabled": {"type": "boolean", "default": False},
"color": {"type": "string", "default": "black"},
"offset": {"type": "list", "default": [1, 1]},
"radius": {"type": "integer", "default": 3},
},
"default": {"enabled": False, "color": "black", "offset": [1, 1], "radius": 3},
},
"container_padding": {"type": "dict", "default": DEFAULTS["container_padding"], "required": False},
"popup_padding": {"type": "dict", "default": DEFAULTS["popup_padding"], "required": False},
}