File: note.kv

package info (click to toggle)
kivy 2.3.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 35,316 kB
  • sloc: python: 80,678; ansic: 5,326; javascript: 780; objc: 725; lisp: 195; sh: 173; makefile: 150
file content (154 lines) | stat: -rw-r--r-- 3,679 bytes parent folder | download | duplicates (3)
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
#:kivy 1.7.1
#:import Factory kivy.factory.Factory

<Screen>:
    canvas:
        Color:
            rgb: .2, .2, .2
        Rectangle:
            size: self.size

<MutableLabelTextInput@MutableTextInput>:
    Label:
        id: w_label
        pos: root.pos
        text: root.text

    TextInput:
        id: w_textinput
        pos: root.pos
        text: root.text
        multiline: root.multiline
        on_focus: root.check_focus_and_view(self)

<MutableRstDocumentTextInput@MutableTextInput>:
    RstDocument:
        id: w_label
        pos: root.pos
        text: root.text

    TextInput:
        id: w_textinput
        pos: root.pos
        text: root.text
        multiline: root.multiline
        on_focus: root.check_focus_and_view(self)


<NoteView>:

    on_note_content: app.set_note_content(self.note_index, self.note_content)
    on_note_title: app.set_note_title(self.note_index, self.note_title)

    BoxLayout:

        orientation: 'vertical'

        BoxLayout:

            orientation: 'horizontal'
            size_hint_y: None
            height: '48dp'
            padding: '5dp'

            canvas:
                Color:
                    rgb: .3, .3, .3
                Rectangle:
                    pos: self.pos
                    size: self.size

            Button:
                text: '<'
                size_hint_x: None
                width: self.height
                on_release: app.go_notes()

            MutableLabelTextInput:
                text: root.note_title
                font_size: '16sp'
                multiline: False
                on_text: root.note_title = self.text

            Button:
                text: 'X'
                size_hint_x: None
                width: self.height
                on_release: app.del_note(root.note_index)


        MutableRstDocumentTextInput:
            text: root.note_content
            on_text: root.note_content = self.text

<NoteListItem>:

    height: '48sp'
    size_hint_y: None

    canvas:
        Color:
            rgb: .3, .3, .3
        Rectangle:
            pos: self.pos
            size: self.width, 1

    BoxLayout:

        padding: '5dp'

        Label:
            text: root.note_title

        Button:
            text: '>'
            size_hint_x: None
            width: self.height
            on_release: app.edit_note(root.note_index)

<Notes>:

    BoxLayout:

        orientation: 'vertical'

        BoxLayout:

            orientation: 'horizontal'
            size_hint_y: None
            height: '48dp'
            padding: '5dp'

            canvas:
                Color:
                    rgb: .3, .3, .3
                Rectangle:
                    pos: self.pos
                    size: self.size

            Image:
                source: 'data/icon.png'
                mipmap: True
                size_hint_x: None
                width: self.height

            Label:
                text: 'Notes'
                font_size: '16sp'

            Button:
                text: '+'
                size_hint_x: None
                width: self.height
                on_release: app.add_note()

        RecycleView:
            data: root.data_for_widgets
            viewclass: 'NoteListItem'
            RecycleBoxLayout:
                default_size: None, dp(56)
                default_size_hint: 1, None
                size_hint_y: None
                height: self.minimum_height
                orientation: 'vertical'
                spacing: dp(2)