@@ -289,35 +289,40 @@ def show_business_card(self, *, image_name=None, name_string=None, name_scale=1,
289
289
``terminalio.FONT``.
290
290
291
291
"""
292
- business_card_splash = displayio .Group (max_size = 30 )
293
- self .display .show (business_card_splash )
294
- with open (image_name , "rb" ) as file_name :
295
- on_disk_bitmap = displayio .OnDiskBitmap (file_name )
296
- face_image = displayio .TileGrid (on_disk_bitmap , pixel_shader = displayio .ColorConverter ())
297
- business_card_splash .append (face_image )
298
- try :
299
- self .display .refresh (target_frames_per_second = 60 )
300
- except AttributeError :
301
- self .display .wait_for_frame ()
302
-
292
+ business_card_label_groups = []
303
293
if name_string :
304
294
name_group = self ._create_label_group (text = name_string ,
305
295
font = name_font ,
306
296
scale = name_scale ,
307
297
height_adjustment = 0.73 )
308
- business_card_splash .append (name_group )
298
+ business_card_label_groups .append (name_group )
309
299
if email_string_one :
310
300
email_one_group = self ._create_label_group (text = email_string_one ,
311
301
font = email_font_one ,
312
302
scale = email_scale_one ,
313
303
height_adjustment = 0.84 )
314
- business_card_splash .append (email_one_group )
304
+ business_card_label_groups .append (email_one_group )
315
305
if email_string_two :
316
306
email_two_group = self ._create_label_group (text = email_string_two ,
317
307
font = email_font_two ,
318
308
scale = email_scale_two ,
319
309
height_adjustment = 0.91 )
320
- business_card_splash .append (email_two_group )
310
+ business_card_label_groups .append (email_two_group )
311
+
312
+ business_card_splash = displayio .Group (max_size = 4 )
313
+ self .display .show (business_card_splash )
314
+ with open (image_name , "rb" ) as file_name :
315
+ on_disk_bitmap = displayio .OnDiskBitmap (file_name )
316
+ face_image = displayio .TileGrid (on_disk_bitmap , pixel_shader = displayio .ColorConverter ())
317
+ business_card_splash .append (face_image )
318
+ for group in business_card_label_groups :
319
+ business_card_splash .append (group )
320
+ try :
321
+ # Refresh display in CircuitPython 5
322
+ self .display .refresh ()
323
+ except AttributeError :
324
+ # Refresh display in CircuitPython 4
325
+ self .display .wait_for_frame ()
321
326
322
327
# pylint: disable=too-many-locals
323
328
def show_badge (self , * , background_color = 0xFF0000 , foreground_color = 0xFFFFFF ,
0 commit comments