From 7ec7211bdc047b0c63aabf5db81910c927bc7bbb Mon Sep 17 00:00:00 2001 From: DocGarbanzo Date: Tue, 21 May 2024 22:08:15 +0100 Subject: [PATCH] * fix layout height for ui widgets in macos (i.e. platform darwin) --- donkeycar/management/ui/common.kv | 5 +++-- donkeycar/management/ui/pilot_screen.kv | 6 +++--- donkeycar/management/ui/train_screen.kv | 2 +- donkeycar/management/ui/ui.kv | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/donkeycar/management/ui/common.kv b/donkeycar/management/ui/common.kv index 9499dc8c4..5f9e2df96 100644 --- a/donkeycar/management/ui/common.kv +++ b/donkeycar/management/ui/common.kv @@ -1,6 +1,7 @@ #:import platform sys.platform -#:set common_height 30 +#:set reduced_height 40 if platform == 'darwin' else 20 +#:set common_height 60 if platform == 'darwin' else 30 #:set spacing 10 #:set layout_height common_height + spacing @@ -226,7 +227,7 @@ current_field: data_spinner.text BoxLayout: size_hint_y: None - height: 20 + height: reduced_height spacing: 2 MyLabel: id: label diff --git a/donkeycar/management/ui/pilot_screen.kv b/donkeycar/management/ui/pilot_screen.kv index 511ae3743..d04532c10 100644 --- a/donkeycar/management/ui/pilot_screen.kv +++ b/donkeycar/management/ui/pilot_screen.kv @@ -104,7 +104,7 @@ pilot_loader: pilot_loader DataPanel: size_hint_y: None - height: 20 + (self.minimum_height - 20) * 15 + height: reduced_height + (self.minimum_height - reduced_height) * 15 id: data_panel is_linked: True font_color: [0.2, 0.2, 1, 1] @@ -126,7 +126,7 @@ BackgroundBoxLayout: orientation: 'vertical' size_hint_y: None - height: self.minimum_height +60 + height: self.minimum_height + 2 * common_height Header: title: 'Multi Pilot Loader' description: @@ -217,7 +217,7 @@ BackgroundBoxLayout: orientation: 'vertical' size_hint_y: None - height: self.minimum_height + 90 + height: self.minimum_height + 3 * common_height Slider: size_hint_y: None height: common_height diff --git a/donkeycar/management/ui/train_screen.kv b/donkeycar/management/ui/train_screen.kv index e085d1937..b1cce87de 100644 --- a/donkeycar/management/ui/train_screen.kv +++ b/donkeycar/management/ui/train_screen.kv @@ -123,7 +123,7 @@ orientation: 'vertical' spacing: spacing size_hint_y: None - height: self.minimum_height + 80 + height: self.minimum_height + 4 * reduced_height Header: size_hint_y: 1.5 id: cfg_header diff --git a/donkeycar/management/ui/ui.kv b/donkeycar/management/ui/ui.kv index 44675e874..fdef8c6f6 100644 --- a/donkeycar/management/ui/ui.kv +++ b/donkeycar/management/ui/ui.kv @@ -13,7 +13,7 @@ BoxLayout: ActionView: id: av size_hint_y: None - height: 20 + height: reduced_height ActionPrevious: with_previous: False