aboutsummaryrefslogtreecommitdiffstats
path: root/tagit/dialogues/dialogue.kv
blob: e2cab6683ec7e8abc6eda2d1a9bf5e99ec6b616a (plain)
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
#:import get_root tagit.utils.get_root
# FIXME: remove need for get_root

<-Dialogue>:
    auto_dismiss: True
    ok_on_enter: True

<DialogueContentBase>:
    orientation: 'vertical'
    padding: '12dp'
    size_hint: 0.66, None
    height: self.minimum_height
    

<DialogueContentNoTitle@DialogueContentBase>:
    # nothing to do


<DialogueTitle@Label>:

<DialogueContentTitle@DialogueContentBase>:
    title: ''
    title_color: 1,1,1,1

    DialogueTitle:
        text: root.title
        size_hint_y: None
        height: self.texture_size[1] + dp(16)
        text_size: self.width - dp(16), None
        color: root.title_color

    # small space
    Label:
        size_hint_y: None
        height: 12



<DialogueButton@Button>:

<DialogueButtonRow>:
    orientation: 'vertical'
    size_hint_y: None
    height: dp(48+8)
        
    # small space
    Label:
        size_hint_y: None
        height: dp(8)

    # here come the buttons
    

<DialogueButtons_One@DialogueButtonRow>:
    ok_text: 'OK'

    DialogueButton:
        text: root.ok_text
        on_press: get_root(self).ok()


<DialogueButtons_Two@DialogueButtonRow>:
    cancel_text: 'Cancel'
    ok_text: 'OK'
    ok_enabled: True

    BoxLayout:
        orientation: 'horizontal'
        DialogueButton:
            text: root.cancel_text
            on_press: get_root(self).cancel()
        DialogueButton:
            text: root.ok_text
            on_press: get_root(self).ok()
            disabled: not root.ok_enabled

## EOF ##