Skip to content

Commit a25552e

Browse files
Karatorskotopes
andauthored
[FL-2344] iButton deleted back button (flipperdevices#1096)
Co-authored-by: あく <[email protected]>
1 parent b22ad77 commit a25552e

File tree

2 files changed

+6
-27
lines changed

2 files changed

+6
-27
lines changed

applications/ibutton/scene/ibutton_scene_delete_confirm.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ void iButtonSceneDeleteConfirm::on_enter(iButtonApp* app) {
2222
app->set_text_store("\e#Delete %s?\e#", ibutton_key_get_name_p(key));
2323
widget_add_text_box_element(
2424
widget, 0, 0, 128, 27, AlignCenter, AlignCenter, app->get_text_store());
25-
widget_add_button_element(widget, GuiButtonTypeLeft, "Back", widget_callback, app);
25+
widget_add_button_element(widget, GuiButtonTypeLeft, "Cancel", widget_callback, app);
2626
widget_add_button_element(widget, GuiButtonTypeRight, "Delete", widget_callback, app);
2727

2828
switch(ibutton_key_get_type(key)) {

applications/ibutton/scene/ibutton_scene_info.cpp

+5-26
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,6 @@
11
#include "ibutton_scene_info.h"
22
#include "../ibutton_app.h"
33

4-
static void widget_callback(GuiButtonType result, InputType type, void* context) {
5-
furi_assert(context);
6-
iButtonApp* app = static_cast<iButtonApp*>(context);
7-
iButtonEvent event;
8-
9-
if(type == InputTypeShort) {
10-
event.type = iButtonEvent::Type::EventTypeWidgetButtonResult;
11-
event.payload.widget_button_result = result;
12-
app->get_view_manager()->send_event(&event);
13-
}
14-
}
15-
164
void iButtonSceneInfo::on_enter(iButtonApp* app) {
175
iButtonAppViewManager* view_manager = app->get_view_manager();
186
Widget* widget = view_manager->get_widget();
@@ -21,8 +9,7 @@ void iButtonSceneInfo::on_enter(iButtonApp* app) {
219

2210
app->set_text_store("%s", ibutton_key_get_name_p(key));
2311
widget_add_text_box_element(
24-
widget, 0, 0, 128, 27, AlignCenter, AlignCenter, app->get_text_store());
25-
widget_add_button_element(widget, GuiButtonTypeLeft, "Back", widget_callback, app);
12+
widget, 0, 0, 128, 28, AlignCenter, AlignCenter, app->get_text_store());
2613

2714
switch(ibutton_key_get_type(key)) {
2815
case iButtonKeyDS1990:
@@ -37,36 +24,28 @@ void iButtonSceneInfo::on_enter(iButtonApp* app) {
3724
key_data[6],
3825
key_data[7]);
3926
widget_add_string_element(
40-
widget, 64, 45, AlignCenter, AlignBottom, FontSecondary, "Dallas");
27+
widget, 64, 51, AlignCenter, AlignBottom, FontSecondary, "Dallas");
4128
break;
4229
case iButtonKeyMetakom:
4330
app->set_text_store(
4431
"%02X %02X %02X %02X", key_data[0], key_data[1], key_data[2], key_data[3]);
4532
widget_add_string_element(
46-
widget, 64, 45, AlignCenter, AlignBottom, FontSecondary, "Metakom");
33+
widget, 64, 51, AlignCenter, AlignBottom, FontSecondary, "Metakom");
4734
break;
4835
case iButtonKeyCyfral:
4936
app->set_text_store("%02X %02X", key_data[0], key_data[1]);
5037
widget_add_string_element(
51-
widget, 64, 45, AlignCenter, AlignBottom, FontSecondary, "Cyfral");
38+
widget, 64, 51, AlignCenter, AlignBottom, FontSecondary, "Cyfral");
5239
break;
5340
}
5441
widget_add_string_element(
55-
widget, 64, 33, AlignCenter, AlignBottom, FontPrimary, app->get_text_store());
42+
widget, 64, 35, AlignCenter, AlignBottom, FontPrimary, app->get_text_store());
5643

5744
view_manager->switch_to(iButtonAppViewManager::Type::iButtonAppViewWidget);
5845
}
5946

6047
bool iButtonSceneInfo::on_event(iButtonApp* app, iButtonEvent* event) {
6148
bool consumed = false;
62-
63-
if(event->type == iButtonEvent::Type::EventTypeWidgetButtonResult) {
64-
if(event->payload.widget_button_result == GuiButtonTypeLeft) {
65-
app->switch_to_previous_scene();
66-
consumed = true;
67-
}
68-
}
69-
7049
return consumed;
7150
}
7251

0 commit comments

Comments
 (0)