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