comparison libervia/desktop_kivy/kv/xmlui.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/xmlui.kv@203755bbe0fe
children
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 #:set common_height 30
18 #:set button_height 50
19
20
21 <EmptyWidget,StringWidget,PasswordWidget,JidInputWidget>:
22 size_hint: 1, None
23 height: dp(common_height)
24
25
26 <TextWidget,LabelWidget,JidWidget>:
27 size_hint: 1, 1
28 size_hint_min_y: max(dp(common_height), self.texture_size[1])
29 text_size: self.width, None
30
31
32 <StringWidget,PasswordWidget,IntWidget>:
33 multiline: False
34 background_normal: app.expand('atlas://data/images/defaulttheme/textinput')
35
36
37 <TextBoxWidget>:
38 multiline: True
39 height: dp(common_height) * 5
40
41
42 <ButtonWidget>:
43 size_hint: 1, None
44 height: dp(button_height)
45
46
47 <BoolWidget>:
48 size_hint: 1, 1
49
50
51 <DividerWidget>:
52 size_hint: 1, None
53 height: dp(12)
54 canvas.before:
55 Color:
56 rgba: 0, 0, 0, 1
57 Line
58 points: self.x, self.y + dp(5), self.x + self.width, self.y + dp(5)
59 width: dp(2)
60
61
62 <ListWidgetItem>:
63 size_hint_y: None
64 height: dp(button_height)
65
66
67 <ListWidget>:
68 size_hint: 1, None
69 layout: layout
70 height: min(layout.minimum_height, dp(250))
71 do_scroll_x: False
72 scroll_type: ['bars', 'content']
73 bar_width: dp(6)
74 BoxLayout:
75 id: layout
76 size_hint: 1, None
77 height: self.minimum_height
78 orientation: "vertical"
79 padding: dp(10)
80
81
82 <AdvancedListRow>:
83 orientation: "horizontal"
84 size_hint: 1, None
85 height: self.minimum_height
86 canvas.before:
87 Color:
88 rgba: app.c_prim_light if self.global_index%2 else app.c_prim_dark
89 Rectangle:
90 pos: self.pos
91 size: self.size
92 canvas.after:
93 Color:
94 rgba: 0, 0, 1, 0.5 if self.selected else 0
95 Rectangle:
96 pos: self.pos
97 size: self.size
98
99
100 <AdvancedListContainer>:
101 size_hint: 1, None
102 height: self.minimum_height
103 orientation: "vertical"
104
105
106 <VerticalContainer>:
107 orientation: "vertical"
108 size_hint: 1, None
109 height: self.minimum_height
110
111 <PairsContainer>:
112 cols: 2
113 size_hint: 1, None
114 height: self.minimum_height
115 padding: dp(10)
116
117
118 <TabsContainer>:
119 size_hint: 1, None
120 height: dp(200)
121
122 <TabsPanelContainer>:
123 layout: layout
124 ScrollView:
125 do_scroll_x: False
126 scroll_type: ['bars', 'content']
127 bar_width: dp(6)
128 canvas.before:
129 Color:
130 rgba: 1, 1, 1, 1
131 Rectangle:
132 pos: self.pos
133 size: self.size
134 BoxLayout:
135 id: layout
136 orientation: "vertical"
137 size_hint: 1, None
138 height: self.minimum_height
139 canvas.before:
140 Color:
141 rgba: 1, 1, 1, 1
142 Rectangle:
143 pos: self.pos
144 size: self.size
145
146
147 <FormButton>:
148 size_hint: 1, None
149 height: dp(button_height)
150 color: 0, 0, 0, 1
151 bold: True
152
153
154 <SubmitButton>:
155 text: _(u"Submit")
156 background_normal: ''
157 background_color: 0.33, 0.67, 0.0, 1
158
159
160 <CancelButton>:
161 text: _(u"Cancel")
162 color: 1, 1, 1, 1
163 bold: False
164
165
166 <SaveButton>:
167 text: _(u"Save")
168 background_normal: ''
169 background_color: 0.33, 0.67, 0.0, 1
170
171
172 <FileDialog>:
173 orientation: "vertical"
174 message: message
175 file_chooser: file_chooser
176 Label:
177 id: message
178 size_hint: 1, None
179 text_size: root.width, None
180 size: self.texture_size
181 FileChooserListView:
182 id: file_chooser
183 Button:
184 size_hint: 1, None
185 height: dp(50)
186 text: "choose"
187 on_release: root.on_select(file_chooser.selection)
188 Button:
189 size_hint: 1, None
190 height: dp(50)
191 text: "cancel"
192 on_release: root.onCancel()
193
194
195 <XMLUIPanel>:
196 size_hint: 1, 1
197 layout: layout
198 do_scroll_x: False
199 scroll_type: ['bars', 'content']
200 bar_width: dp(6)
201 BoxLayout:
202 id: layout
203 orientation: "vertical"
204 size_hint: 1, None
205 padding: app.MARGIN_LEFT, 0, app.MARGIN_RIGHT, 0
206 height: self.minimum_height