annotate cagou/kv/dialog.kv @ 203:dbd2274fc78b

core: new core.dialog module with a ConfirmDialog
author Goffi <goffi@goffi.org>
date Fri, 25 May 2018 11:58:06 +0200
parents
children 1abd9d694e67
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
203
dbd2274fc78b core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff changeset
1 # Cagou: desktop/mobile frontend for Salut à Toi XMPP client
dbd2274fc78b core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff changeset
2 # Copyright (C) 2016-2018 Jérôme Poisson (goffi@goffi.org)
dbd2274fc78b core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff changeset
3
dbd2274fc78b core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff changeset
4 # This program is free software: you can redistribute it and/or modify
dbd2274fc78b core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff changeset
5 # it under the terms of the GNU Affero General Public License as published by
dbd2274fc78b core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff changeset
6 # the Free Software Foundation, either version 3 of the License, or
dbd2274fc78b core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff changeset
7 # (at your option) any later version.
dbd2274fc78b core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff changeset
8
dbd2274fc78b core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff changeset
9 # This program is distributed in the hope that it will be useful,
dbd2274fc78b core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff changeset
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
dbd2274fc78b core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff changeset
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
dbd2274fc78b core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff changeset
12 # GNU Affero General Public License for more details.
dbd2274fc78b core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff changeset
13
dbd2274fc78b core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff changeset
14 # You should have received a copy of the GNU Affero General Public License
dbd2274fc78b core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff changeset
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
dbd2274fc78b core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff changeset
16
dbd2274fc78b core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff changeset
17 #:import _ sat.core.i18n._
dbd2274fc78b core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff changeset
18
dbd2274fc78b core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff changeset
19 <ConfirmDialog>:
dbd2274fc78b core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff changeset
20 orientation: "vertical"
dbd2274fc78b core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff changeset
21 spacing: dp(5)
dbd2274fc78b core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff changeset
22 canvas.before:
dbd2274fc78b core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff changeset
23 Color:
dbd2274fc78b core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff changeset
24 rgba: 0, 0, 0, 1
dbd2274fc78b core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff changeset
25 Rectangle:
dbd2274fc78b core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff changeset
26 pos: self.pos
dbd2274fc78b core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff changeset
27 size: self.size
dbd2274fc78b core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff changeset
28 Label:
dbd2274fc78b core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff changeset
29 size_hint: 1, None
dbd2274fc78b core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff changeset
30 text_size: root.width, None
dbd2274fc78b core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff changeset
31 size: self.texture_size
dbd2274fc78b core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff changeset
32 font_size: sp(20)
dbd2274fc78b core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff changeset
33 padding: dp(5), dp(5)
dbd2274fc78b core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff changeset
34 color: 1, 1, 1, 1
dbd2274fc78b core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff changeset
35 text: root.title
dbd2274fc78b core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff changeset
36 halign: "center"
dbd2274fc78b core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff changeset
37 italic: True
dbd2274fc78b core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff changeset
38 bold: True
dbd2274fc78b core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff changeset
39 Label:
dbd2274fc78b core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff changeset
40 text: root.message
dbd2274fc78b core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff changeset
41 text_size: root.width, None
dbd2274fc78b core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff changeset
42 size: self.texture_size
dbd2274fc78b core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff changeset
43 font_size: sp(20)
dbd2274fc78b core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff changeset
44 color: 1, 1, 1, 1
dbd2274fc78b core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff changeset
45 Button:
dbd2274fc78b core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff changeset
46 size_hint: 1, None
dbd2274fc78b core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff changeset
47 height: dp(50)
dbd2274fc78b core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff changeset
48 background_color: 0.33, 1.0, 0.0, 1
dbd2274fc78b core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff changeset
49 text: _("Yes")
dbd2274fc78b core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff changeset
50 bold: True
dbd2274fc78b core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff changeset
51 on_release: root.yes_cb() if root.yes_cb is not None else None
dbd2274fc78b core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff changeset
52 Button:
dbd2274fc78b core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff changeset
53 size_hint: 1, None
dbd2274fc78b core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff changeset
54 height: dp(50)
dbd2274fc78b core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff changeset
55 text: _("No")
dbd2274fc78b core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff changeset
56 bold: True
dbd2274fc78b core: new core.dialog module with a ConfirmDialog
Goffi <goffi@goffi.org>
parents:
diff changeset
57 on_release: root.no_cb() if root.no_cb is not None else None