-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDPEAButton.kv
More file actions
38 lines (34 loc) · 1.1 KB
/
DPEAButton.kv
File metadata and controls
38 lines (34 loc) · 1.1 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
# Written by Francis Pan as part of the standard kivy libraries for the DPEA
# 28 February 2018
#
# A Button with the default appearance.
# When using, specify:
# id, text, color, size, position, on_press, and on_release
#
# Modified by Alex Ortiz to simplify structure and replace border image with rectangle shadow
# 14 November 2024
<DPEAButton>:
size_hint: None,None
background_color: 0, 0, 0, 0
background_normal: ''
canvas.after:
#Shadow border
Color:
rgba: 0, 0, 0, 0.3 # Shadow color + transparency
RoundedRectangle:
pos: self.x - 5, self.y - 5 # Offset shadow position
size: self.width + 10, self.height + 10
radius: [25]
canvas.before:
# Main button
Color:
rgba: self.color
RoundedRectangle:
pos: self.pos
size: self.size
Label:
text: root.text
font_size: root.height * 0.45
color: 1, 1, 1, 1
bold: True
center: root.center