Skip to content

Commit 5168061

Browse files
committed
UI improvements:
* Improved pilot screen popup screens and layout dynamic under resizing. * Improved LabelBar layout with rounded rectangle grey label backgrounds.
1 parent 42fa5c5 commit 5168061

File tree

9 files changed

+36
-342
lines changed

9 files changed

+36
-342
lines changed

donkeycar/management/ui/common.kv

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@
125125
radius: [10,]
126126
color: font_color
127127

128+
128129
<MySpinner>:
129130
text_size: self.size
130131
halign: 'center'
@@ -146,7 +147,6 @@
146147
size_hint: 1.0, 1.0
147148
auto_dismiss: False
148149
pos_hint: {'center_x': .5, 'center_y': .5}
149-
150150
BoxLayout:
151151
orientation: "vertical"
152152
FileChooser:
@@ -161,10 +161,10 @@
161161
size_hint: (1, 0.1)
162162
pos_hint: {'center_x': .5, 'center_y': .5}
163163
spacing: 20
164-
Button:
164+
RoundedButton:
165165
text: "Cancel"
166166
on_release: root.dismiss()
167-
Button:
167+
RoundedButton:
168168
text: "Load"
169169
on_release: root.load(file_chooser.selection)
170170
disabled: file_chooser.selection==[]
@@ -173,44 +173,38 @@
173173
<LabelBar>:
174174
orientation: 'horizontal'
175175
spacing: 4
176-
Label:
176+
MyLabel:
177177
id: field_label
178178
text_size: self.size
179179
halign: 'left'
180180
valign: 'middle'
181-
font_size: '14sp'
181+
font_size: '12sp'
182182
canvas.before:
183183
Color:
184-
rgba: 0.17, 0.18, 0.25, 1
185-
Rectangle:
184+
rgba: 0.13, 0.14, 0.15, 1
185+
RoundedRectangle:
186186
pos: self.pos
187187
size: self.size
188-
Label:
188+
radius: [5,]
189+
MyLabel:
189190
id: value_label
190191
text_size: self.size
191192
halign: 'right'
192193
valign: 'middle'
193-
font_size: '14sp'
194+
font_size: '12sp'
194195
size_hint_x: 0.8
195196
padding_x: 10
196197
canvas.before:
197198
Color:
198-
rgba: 0.14, 0.15, 0.22, 1
199-
Rectangle:
199+
rgba: 0.13, 0.14, 0.15, 1
200+
RoundedRectangle:
200201
pos: self.pos
201202
size: self.size
203+
radius: [5,]
202204
ProgressBar:
203205
id: bar
204-
canvas.before:
205-
Color:
206-
rgba: 0.12, 0.13, 0.20, 1
207-
Rectangle:
208-
pos: self.pos
209-
size: self.size
210206

211207
<-FullImage>:
212-
# size_hint_x: 1.2
213-
# size_hint_y: 1.2
214208
canvas:
215209
Color:
216210
rgb: (1, 1, 1)
@@ -222,16 +216,17 @@
222216

223217
<DataPanel>
224218
orientation: 'vertical'
219+
spacing: 2
225220
GridLayout:
226221
cols: 2
227222
MyLabel:
228223
text: 'Record field'
229224
size_hint_y: None
230-
height: common_height
225+
height: 20
231226
MySpinner:
232227
id: data_spinner
233228
size_hint_y: None
234-
height: common_height
229+
height: 20
235230
text: root.auto_text if root.link else 'Add/remove'
236231
on_text: root.add_remove()
237232
on_values: root.clear()

donkeycar/management/ui/layout_screen.kv

Lines changed: 0 additions & 158 deletions
This file was deleted.

donkeycar/management/ui/layout_screen.py

Lines changed: 0 additions & 5 deletions
This file was deleted.

donkeycar/management/ui/pilot_screen.kv

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222

2323

2424
<TransformationPopup>:
25-
size_hint: 1.0, 1.0
25+
size_hint: 0.5, 1.0
2626
auto_dismiss: False
27-
pos_hint: {'center_x': .5, 'center_y': .5}
27+
pos_hint: {'center_x': .25 if self.right else 0.75, 'center_y': .5}
2828

2929
BoxLayout:
3030
orientation: "horizontal"
@@ -37,6 +37,7 @@
3737
orientation: 'vertical'
3838
spacing: 20
3939
BoxLayout:
40+
spacing: 10
4041
orientation: 'vertical'
4142
id: trafo_list
4243
RoundedButton:
@@ -52,13 +53,13 @@
5253
padding: 10
5354
spacing: 10
5455
BackgroundBoxLayout:
55-
size_hint_y: 0.25
56+
size_hint_y: None
57+
height: self.minimum_height + layout_height
5658
Header:
57-
title: 'Pilot Loader'
59+
title: 'Multi Pilot Loader'
5860
description:
5961
'Load pilots from the Trainer screen and compare the model '\
60-
'inferencing with the recorded user data.'
61-
62+
'inference with the recorded user data.'
6263
BoxLayout:
6364
orientation: 'horizontal'
6465
size_hint_y: 1.5
@@ -76,6 +77,8 @@
7677
throttle_field: data_in.throttle_field
7778
is_left: True
7879
DataPanel:
80+
size_hint_y: None
81+
height: self.minimum_height + 60
7982
id: data_panel_1
8083
screen: root
8184
record: img_1.pilot_record
@@ -95,6 +98,8 @@
9598
throttle_field: data_in.throttle_field
9699
is_left: False
97100
DataPanel:
101+
size_hint_y: None
102+
height: self.minimum_height + 60
98103
id: data_panel_2
99104
screen: root
100105
record: img_1.pilot_record
@@ -104,7 +109,8 @@
104109

105110
BackgroundBoxLayout:
106111
orientation: 'vertical'
107-
size_hint_y: 0.5
112+
size_hint_y: None
113+
height: self.minimum_height + common_height
108114
Header:
109115
title: 'Augmentations and Transformations'
110116
description:
@@ -160,7 +166,8 @@
160166

161167
BackgroundBoxLayout:
162168
orientation: 'vertical'
163-
size_hint_y: 0.75
169+
size_hint_y: None
170+
height: self.minimum_height + 90
164171
Slider:
165172
size_hint_y: None
166173
height: common_height

donkeycar/management/ui/pilot_screen.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ class TransformationPopup(Popup):
145145
"GRAY2BGR", "CANNY", "BLUR", "RESIZE", "SCALE", "GAMMANORM"]
146146
transformations_obj = ObjectProperty()
147147
selected = ListProperty()
148+
right = BooleanProperty()
148149

149150
def __init__(self, selected, **kwargs):
150151
super().__init__(**kwargs)
@@ -178,7 +179,7 @@ class Transformations(RoundedButton):
178179

179180
def open_popup(self):
180181
popup = TransformationPopup(title=self.title, transformations_obj=self,
181-
selected=self.selected)
182+
selected=self.selected, right=self.is_post)
182183
popup.open()
183184

184185
def on_selected(self, obj, select):

0 commit comments

Comments
 (0)