Mercurial > libervia-desktop-kivy
comparison libervia/desktop_kivy/kv/share_widget.kv @ 493:b3cedbee561d
refactoring: rename `cagou` to `libervia.desktop_kivy` + update imports and names following backend changes
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 02 Jun 2023 18:26:16 +0200 |
parents | cagou/kv/share_widget.kv@203755bbe0fe |
children | 196483685a63 |
comparison
equal
deleted
inserted
replaced
492:5114bbb5daa3 | 493:b3cedbee561d |
---|---|
1 #Libervia Desktop-Kivy | |
2 # Copyright (C) 2016-2021 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 Path pathlib.Path | |
18 #:import _ libervia.backend.core.i18n._ | |
19 #:import C libervia.desktop_kivy.core.constants.Const | |
20 | |
21 | |
22 <ShareWidget>: | |
23 preview_box: preview_box | |
24 orientation: 'vertical' | |
25 Label: | |
26 size_hint: 1, None | |
27 text_size: self.size | |
28 halign: 'center' | |
29 text: _("share") | |
30 height: self.font_size + dp(5) | |
31 bold: True | |
32 font_size: '35sp' | |
33 BoxLayout: | |
34 id: preview_box | |
35 size_hint: 1, None | |
36 height: self.minimum_height | |
37 orientation: 'vertical' | |
38 text: str(root.data) | |
39 Label: | |
40 size_hint: 1, None | |
41 text_size: self.size | |
42 halign: 'center' | |
43 text: _("with") | |
44 height: self.font_size + dp(5) | |
45 bold: True | |
46 font_size: '25sp' | |
47 JidSelector: | |
48 on_select: root.on_select(args[1]) | |
49 Button: | |
50 size_hint: 1, None | |
51 height: C.BTN_HEIGHT | |
52 text: _("cancel") | |
53 on_press: app.host.close_ui() | |
54 | |
55 | |
56 <TextPreview>: | |
57 size_hint: 1, None | |
58 height: min(data.height, dp(100)) | |
59 ScrollView | |
60 Label: | |
61 id: data | |
62 size_hint: 1, None | |
63 text: root.text | |
64 text_size: self.width, None | |
65 size: self.texture_size | |
66 font_size: sp(20) | |
67 padding_x: dp(10) | |
68 padding_y: dp(5) | |
69 halign: 'center' | |
70 canvas.before: | |
71 Color: | |
72 rgba: 0.95, 0.95, 0.95, 1 | |
73 Rectangle: | |
74 pos: self.pos | |
75 size: self.size | |
76 | |
77 <ImagePreview>: | |
78 reduce_layout: reduce_layout | |
79 reduce_checkbox: reduce_checkbox | |
80 size_hint: 1, None | |
81 height: dp(120) | |
82 orientation: "vertical" | |
83 Image: | |
84 source: root.path | |
85 BoxLayout | |
86 id: reduce_layout | |
87 size_hint: 1, None | |
88 padding_y: None | |
89 opacity: 0 | |
90 height: 0 | |
91 Widget: | |
92 CheckBox: | |
93 id: reduce_checkbox | |
94 size_hint: None, 1 | |
95 width: dp(20) | |
96 active: True | |
97 Label: | |
98 size_hint: None, None | |
99 text: _("reduce image size") | |
100 text_size: None, None | |
101 size: self.texture_size | |
102 padding_x: dp(10) | |
103 font_size: sp(15) | |
104 Widget: | |
105 | |
106 <GenericPreview>: | |
107 size_hint: 1, None | |
108 height: dp(100) | |
109 Widget: | |
110 SymbolButtonLabel: | |
111 symbol: "doc" | |
112 text: Path(root.path).name | |
113 Widget: | |
114 |