@@ -215,35 +215,40 @@ def show_business_card(self, *, image_name=None, name_string=None, name_scale=1,
215
215
``terminalio.FONT``.
216
216
217
217
"""
218
- business_card_splash = displayio .Group (max_size = 30 )
219
- self .display .show (business_card_splash )
220
- with open (image_name , "rb" ) as file_name :
221
- on_disk_bitmap = displayio .OnDiskBitmap (file_name )
222
- face_image = displayio .TileGrid (on_disk_bitmap , pixel_shader = displayio .ColorConverter ())
223
- business_card_splash .append (face_image )
224
- try :
225
- self .display .refresh (target_frames_per_second = 60 )
226
- except AttributeError :
227
- self .display .wait_for_frame ()
228
-
218
+ business_card_label_groups = []
229
219
if name_string :
230
220
name_group = self ._create_label_group (text = name_string ,
231
221
font = name_font ,
232
222
scale = name_scale ,
233
223
height_adjustment = 0.73 )
234
- business_card_splash .append (name_group )
224
+ business_card_label_groups .append (name_group )
235
225
if email_string_one :
236
226
email_one_group = self ._create_label_group (text = email_string_one ,
237
227
font = email_font_one ,
238
228
scale = email_scale_one ,
239
229
height_adjustment = 0.84 )
240
- business_card_splash .append (email_one_group )
230
+ business_card_label_groups .append (email_one_group )
241
231
if email_string_two :
242
232
email_two_group = self ._create_label_group (text = email_string_two ,
243
233
font = email_font_two ,
244
234
scale = email_scale_two ,
245
235
height_adjustment = 0.91 )
246
- business_card_splash .append (email_two_group )
236
+ business_card_label_groups .append (email_two_group )
237
+
238
+ business_card_splash = displayio .Group (max_size = 4 )
239
+ self .display .show (business_card_splash )
240
+ with open (image_name , "rb" ) as file_name :
241
+ on_disk_bitmap = displayio .OnDiskBitmap (file_name )
242
+ face_image = displayio .TileGrid (on_disk_bitmap , pixel_shader = displayio .ColorConverter ())
243
+ business_card_splash .append (face_image )
244
+ for group in business_card_label_groups :
245
+ business_card_splash .append (group )
246
+ try :
247
+ # Refresh display in CircuitPython 5
248
+ self .display .refresh ()
249
+ except AttributeError :
250
+ # Refresh display in CircuitPython 4
251
+ self .display .wait_for_frame ()
247
252
248
253
# pylint: disable=too-many-locals
249
254
def show_badge (self , * , background_color = 0xFF0000 , foreground_color = 0xFFFFFF ,
0 commit comments