crossword.kv 2.13 KB
Newer Older
Brady James Garvin's avatar
Brady James Garvin committed
1
2
3
4
5
6
7
8
9
BoxLayout:
    orientation: 'vertical'
    canvas.before:
        Color:
            rgba: (1.0, 1.0, 1.0, 1.0)
        Rectangle:
            pos: self.pos
            size: self.size
    AnchorLayout:
10
11
12
        Grid:
            rows: app.row_count
            cells: app.cells
Brady James Garvin's avatar
Brady James Garvin committed
13
14
15
16
17
    ScrollView:
        BoxLayout:
            orientation: 'vertical'
            size_hint: (None, None)
            size: self.minimum_size
18
            Heading:
Brady James Garvin's avatar
Brady James Garvin committed
19
                text: 'ACROSS'
20
21
22
            Clues:
                clues: app.across_clues
            Heading:
Brady James Garvin's avatar
Brady James Garvin committed
23
                text: 'DOWN'
24
25
            Clues:
                clues: app.down_clues
Brady James Garvin's avatar
Brady James Garvin committed
26

27
28
29
30
<Grid>:
    size_hint: (None, None)
    width: min(self.parent.width, self.parent.height)
    height: min(self.parent.width, self.parent.height)
Brady James Garvin's avatar
Brady James Garvin committed
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51

<Box>:
    canvas.before:
        Color:
            rgba: (0.0, 0.0, 0.75, 1.0)
        Rectangle:
            pos: self.pos
            size: self.size
    BoxLabel:
        text: f'{root.character}'
        font_size: self.height
        size_hint: (1.0, 1.0)
        pos_hint: {'x': 0.0, 'y': 0.0}
        opacity: 1.0 if root.character is not None else 0.0
    BoxLabel:
        text: f'{root.number}'
        font_size: 0.5 * self.height
        size_hint: (1 / 3, 1 / 3)
        pos_hint: {'x': 0.0, 'y': 2 / 3}
        opacity: 1.0 if root.number is not None else 0.0

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
<BoxLabel>:
    canvas.before:
        Color:
            rgba: (0.0, 0.0, 0.75, 1.0)
        Rectangle:
            pos: self.pos
            size: self.size
        Color:
            rgba: (1.0, 1.0, 1.0, 1.0)
        Rectangle:
            pos: (self.x + 0.1 * self.width, self.y + 0.1 * self.height)
            size: (0.8 * self.width, 0.8 * self.height)
    text_size: self.size
    halign: 'center'
    valign: 'center'

<Heading>:
    size_hint: (None, None)
    font_size: sp(24)
    padding: (sp(12), sp(12))
    size: self.texture_size

<Clues>:
    orientation: 'vertical'
    size_hint: (None, None)
    size: self.minimum_size

Brady James Garvin's avatar
Brady James Garvin committed
79
<Clue>:
80
    text: f'{root.number}. {root.clue_text}'
Brady James Garvin's avatar
Brady James Garvin committed
81
82
83
    size_hint: (None, None)
    padding: (sp(6), sp(6))
    size: self.texture_size
84
85
86

<Label>:
    color: (0.0, 0.0, 0.75, 1.0)