Skip to content

Commit

Permalink
fix ibutton info display
Browse files Browse the repository at this point in the history
  • Loading branch information
xMasterX committed Nov 20, 2023
1 parent 9513ff5 commit 4eb40ce
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions applications/main/ibutton/scenes/ibutton_scene_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,19 @@ void ibutton_scene_info_on_enter(void* context) {
const iButtonProtocolId protocol_id = ibutton_key_get_protocol_id(key);

FuriString* tmp = furi_string_alloc();
FuriString* keynumber = furi_string_alloc();

ibutton_protocols_render_brief_data(ibutton->protocols, key, keynumber);

furi_string_printf(
tmp,
"\e#%s\n[%s]\e#",
"\e#%s\n[%s]\e#\n%s",
ibutton->key_name,
ibutton_protocols_get_name(ibutton->protocols, protocol_id));
ibutton_protocols_get_name(ibutton->protocols, protocol_id),
furi_string_get_cstr(keynumber));

widget_add_text_box_element(
widget, 0, 2, 128, 40, AlignLeft, AlignTop, furi_string_get_cstr(tmp), true);

furi_string_reset(tmp);
ibutton_protocols_render_brief_data(ibutton->protocols, key, tmp);

widget_add_string_multiline_element(
widget, 0, 16, AlignLeft, AlignTop, FontSecondary, furi_string_get_cstr(tmp));
widget, 0, 2, 128, 64, AlignLeft, AlignTop, furi_string_get_cstr(tmp), true);

if(ibutton_protocols_get_features(ibutton->protocols, protocol_id) &
iButtonProtocolFeatureExtData) {
Expand All @@ -32,6 +30,7 @@ void ibutton_scene_info_on_enter(void* context) {

view_dispatcher_switch_to_view(ibutton->view_dispatcher, iButtonViewWidget);
furi_string_free(tmp);
furi_string_free(keynumber);
}

bool ibutton_scene_info_on_event(void* context, SceneManagerEvent event) {
Expand Down

1 comment on commit 4eb40ce

@krolchonok
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

Please sign in to comment.