diff --git a/icons/remote_scene/Dpad/down.png b/icons/remote_scene/Dpad/down.png new file mode 100644 index 00000000000..198e22ea285 Binary files /dev/null and b/icons/remote_scene/Dpad/down.png differ diff --git a/icons/remote_scene/Dpad/down_hover.png b/icons/remote_scene/Dpad/down_hover.png new file mode 100644 index 00000000000..39ac087e769 Binary files /dev/null and b/icons/remote_scene/Dpad/down_hover.png differ diff --git a/icons/remote_scene/Dpad/left.png b/icons/remote_scene/Dpad/left.png new file mode 100644 index 00000000000..38b83c79bb7 Binary files /dev/null and b/icons/remote_scene/Dpad/left.png differ diff --git a/icons/remote_scene/Dpad/left_hover.png b/icons/remote_scene/Dpad/left_hover.png new file mode 100644 index 00000000000..45f58b8b674 Binary files /dev/null and b/icons/remote_scene/Dpad/left_hover.png differ diff --git a/icons/remote_scene/Dpad/ok.png b/icons/remote_scene/Dpad/ok.png new file mode 100644 index 00000000000..dfd3d2fd112 Binary files /dev/null and b/icons/remote_scene/Dpad/ok.png differ diff --git a/icons/remote_scene/Dpad/ok_hover.png b/icons/remote_scene/Dpad/ok_hover.png new file mode 100644 index 00000000000..9107c1a79aa Binary files /dev/null and b/icons/remote_scene/Dpad/ok_hover.png differ diff --git a/icons/remote_scene/Dpad/right.png b/icons/remote_scene/Dpad/right.png new file mode 100644 index 00000000000..ca6748f9ae7 Binary files /dev/null and b/icons/remote_scene/Dpad/right.png differ diff --git a/icons/remote_scene/Dpad/right_hover.png b/icons/remote_scene/Dpad/right_hover.png new file mode 100644 index 00000000000..2d53ce701c9 Binary files /dev/null and b/icons/remote_scene/Dpad/right_hover.png differ diff --git a/icons/remote_scene/Dpad/up.png b/icons/remote_scene/Dpad/up.png new file mode 100644 index 00000000000..cd032ed1226 Binary files /dev/null and b/icons/remote_scene/Dpad/up.png differ diff --git a/icons/remote_scene/Dpad/up_hover.png b/icons/remote_scene/Dpad/up_hover.png new file mode 100644 index 00000000000..8bc334750d1 Binary files /dev/null and b/icons/remote_scene/Dpad/up_hover.png differ diff --git a/icons/remote_scene/Pin_cell_13x13.png b/icons/remote_scene/Pin_cell_13x13.png deleted file mode 100644 index 1b1ff0c2fbe..00000000000 Binary files a/icons/remote_scene/Pin_cell_13x13.png and /dev/null differ diff --git a/icons/remote_scene/Pin_star_7x7.png b/icons/remote_scene/Pin_star_7x7.png deleted file mode 100644 index 42fdea86e48..00000000000 Binary files a/icons/remote_scene/Pin_star_7x7.png and /dev/null differ diff --git a/icons/remote_scene/back_10px.png b/icons/remote_scene/back_10px.png deleted file mode 100644 index f9c615a99e6..00000000000 Binary files a/icons/remote_scene/back_10px.png and /dev/null differ diff --git a/icons/remote_scene/ButtonDown_7x4.png b/icons/remote_scene/list/ButtonDown_7x4.png similarity index 100% rename from icons/remote_scene/ButtonDown_7x4.png rename to icons/remote_scene/list/ButtonDown_7x4.png diff --git a/icons/remote_scene/ButtonLeft_4x7.png b/icons/remote_scene/list/ButtonLeft_4x7.png similarity index 100% rename from icons/remote_scene/ButtonLeft_4x7.png rename to icons/remote_scene/list/ButtonLeft_4x7.png diff --git a/icons/remote_scene/ButtonRight_4x7.png b/icons/remote_scene/list/ButtonRight_4x7.png similarity index 100% rename from icons/remote_scene/ButtonRight_4x7.png rename to icons/remote_scene/list/ButtonRight_4x7.png diff --git a/icons/remote_scene/ButtonUp_7x4.png b/icons/remote_scene/list/ButtonUp_7x4.png similarity index 100% rename from icons/remote_scene/ButtonUp_7x4.png rename to icons/remote_scene/list/ButtonUp_7x4.png diff --git a/icons/remote_scene/Ok_btn_9x9.png b/icons/remote_scene/list/Ok_btn_9x9.png similarity index 100% rename from icons/remote_scene/Ok_btn_9x9.png rename to icons/remote_scene/list/Ok_btn_9x9.png diff --git a/icons/remote_scene/statusbar/External_antenna_20x12.png b/icons/remote_scene/statusbar/External_antenna_20x12.png new file mode 100644 index 00000000000..940087071a1 Binary files /dev/null and b/icons/remote_scene/statusbar/External_antenna_20x12.png differ diff --git a/icons/remote_scene/statusbar/Internal_antenna_20x12.png b/icons/remote_scene/statusbar/Internal_antenna_20x12.png new file mode 100644 index 00000000000..a8a5be09fb8 Binary files /dev/null and b/icons/remote_scene/statusbar/Internal_antenna_20x12.png differ diff --git a/icons/remote_scene/Pin_arrow_up_7x9.png b/icons/remote_scene/statusbar/Pin_arrow_up_7x9.png similarity index 100% rename from icons/remote_scene/Pin_arrow_up_7x9.png rename to icons/remote_scene/statusbar/Pin_arrow_up_7x9.png diff --git a/icons/remote_scene/statusbar/Status_cube_14x14.png b/icons/remote_scene/statusbar/Status_cube_14x14.png new file mode 100644 index 00000000000..f1e72cbbd00 Binary files /dev/null and b/icons/remote_scene/statusbar/Status_cube_14x14.png differ diff --git a/icons/remote_scene/statusbar/status_bar.png b/icons/remote_scene/statusbar/status_bar.png new file mode 100644 index 00000000000..8136fe32e5f Binary files /dev/null and b/icons/remote_scene/statusbar/status_bar.png differ diff --git a/scenes/subrem_scene_edit_label.c b/scenes/subrem_scene_edit_label.c index af4a33c1abb..25c10bb46a4 100644 --- a/scenes/subrem_scene_edit_label.c +++ b/scenes/subrem_scene_edit_label.c @@ -29,7 +29,7 @@ void subrem_scene_edit_label_widget_callback(GuiButtonType result, InputType typ void subrem_scene_edit_label_on_enter(void* context) { SubGhzRemoteApp* app = context; - SubRemSubFilePreset* sub_preset = app->map_preset->subs_preset[app->chusen_sub]; + SubRemSubFilePreset* sub_preset = app->map_preset->subs_preset[app->chosen_sub]; FuriString* temp_str = furi_string_alloc(); @@ -76,7 +76,7 @@ void subrem_scene_edit_label_on_enter(void* context) { bool subrem_scene_edit_label_on_event(void* context, SceneManagerEvent event) { SubGhzRemoteApp* app = context; - FuriString* label = app->map_preset->subs_preset[app->chusen_sub]->label; + FuriString* label = app->map_preset->subs_preset[app->chosen_sub]->label; if(event.type == SceneManagerEventTypeBack) { if(scene_manager_get_scene_state(app->scene_manager, SubRemSceneEditLabel) == diff --git a/scenes/subrem_scene_edit_menu.c b/scenes/subrem_scene_edit_menu.c index a8882009a83..bc54311c56b 100644 --- a/scenes/subrem_scene_edit_menu.c +++ b/scenes/subrem_scene_edit_menu.c @@ -101,7 +101,7 @@ bool subrem_scene_edit_menu_on_event(void* context, SceneManagerEvent event) { return true; } else if(event.event == SubRemCustomEventViewEditMenuEdit) { - app->chusen_sub = subrem_view_edit_menu_get_index(app->subrem_edit_menu); + app->chosen_sub = subrem_view_edit_menu_get_index(app->subrem_edit_menu); scene_manager_set_scene_state( app->scene_manager, SubRemSceneEditSubMenu, EditSubmenuIndexEditLabel); scene_manager_next_scene(app->scene_manager, SubRemSceneEditSubMenu); diff --git a/scenes/subrem_scene_open_sub_file.c b/scenes/subrem_scene_open_sub_file.c index 03f534b8885..5431a61dcda 100644 --- a/scenes/subrem_scene_open_sub_file.c +++ b/scenes/subrem_scene_open_sub_file.c @@ -9,7 +9,7 @@ void subrem_scene_open_sub_file_error_popup_callback(void* context) { SubRemLoadSubState subrem_scene_open_sub_file_dialog(SubGhzRemoteApp* app) { furi_assert(app); - SubRemSubFilePreset* sub = app->map_preset->subs_preset[app->chusen_sub]; + SubRemSubFilePreset* sub = app->map_preset->subs_preset[app->chosen_sub]; FuriString* temp_file_path = furi_string_alloc(); @@ -47,8 +47,8 @@ SubRemLoadSubState subrem_scene_open_sub_file_dialog(SubGhzRemoteApp* app) { furi_record_close(RECORD_STORAGE); if(ret == SubRemLoadSubStateOK) { - subrem_sub_file_preset_free(app->map_preset->subs_preset[app->chusen_sub]); - app->map_preset->subs_preset[app->chusen_sub] = sub_candidate; + subrem_sub_file_preset_free(app->map_preset->subs_preset[app->chosen_sub]); + app->map_preset->subs_preset[app->chosen_sub] = sub_candidate; app->map_not_saved = true; } else { subrem_sub_file_preset_free(sub_candidate); diff --git a/scenes/subrem_scene_remote.c b/scenes/subrem_scene_remote.c index e8d57dae7e9..efe289871a8 100644 --- a/scenes/subrem_scene_remote.c +++ b/scenes/subrem_scene_remote.c @@ -66,19 +66,19 @@ bool subrem_scene_remote_on_event(void* context, SceneManagerEvent event) { // Start sending sub subrem_tx_stop_sub(app, true); - uint8_t chusen_sub = subrem_scene_remote_event_to_index(event.event); - app->chusen_sub = chusen_sub; + uint8_t chosen_sub = subrem_scene_remote_event_to_index(event.event); + app->chosen_sub = chosen_sub; subrem_view_remote_set_state( - app->subrem_remote_view, SubRemViewRemoteStateLoading, chusen_sub); + app->subrem_remote_view, SubRemViewRemoteStateLoading, chosen_sub); - if(subrem_tx_start_sub(app, app->map_preset->subs_preset[chusen_sub])) { - if(app->map_preset->subs_preset[chusen_sub]->type == SubGhzProtocolTypeRAW) { + if(subrem_tx_start_sub(app, app->map_preset->subs_preset[chosen_sub])) { + if(app->map_preset->subs_preset[chosen_sub]->type == SubGhzProtocolTypeRAW) { subghz_txrx_set_raw_file_encoder_worker_callback_end( app->txrx, subrem_scene_remote_raw_callback_end_tx, app); } subrem_view_remote_set_state( - app->subrem_remote_view, SubRemViewRemoteStateSending, chusen_sub); + app->subrem_remote_view, SubRemViewRemoteStateSending, chosen_sub); notification_message(app->notifications, &sequence_blink_start_magenta); } else { subrem_view_remote_set_state( diff --git a/subghz_remote_app_i.c b/subghz_remote_app_i.c index ca54a997b5c..45321441d4f 100644 --- a/subghz_remote_app_i.c +++ b/subghz_remote_app_i.c @@ -196,7 +196,7 @@ void subrem_save_active_sub(void* context) { furi_assert(context); SubGhzRemoteApp* app = context; - SubRemSubFilePreset* sub_preset = app->map_preset->subs_preset[app->chusen_sub]; + SubRemSubFilePreset* sub_preset = app->map_preset->subs_preset[app->chosen_sub]; subrem_save_protocol_to_file( sub_preset->fff_data, furi_string_get_cstr(sub_preset->file_path)); } @@ -235,7 +235,7 @@ bool subrem_tx_start_sub(SubGhzRemoteApp* app, SubRemSubFilePreset* sub_preset) bool subrem_tx_stop_sub(SubGhzRemoteApp* app, bool forced) { furi_assert(app); - SubRemSubFilePreset* sub_preset = app->map_preset->subs_preset[app->chusen_sub]; + SubRemSubFilePreset* sub_preset = app->map_preset->subs_preset[app->chosen_sub]; if(forced || (sub_preset->type != SubGhzProtocolTypeRAW)) { subghz_txrx_stop(app->txrx); diff --git a/subghz_remote_app_i.h b/subghz_remote_app_i.h index 2300b3e52d9..89023137796 100644 --- a/subghz_remote_app_i.h +++ b/subghz_remote_app_i.h @@ -50,7 +50,7 @@ typedef struct { bool map_not_saved; - uint8_t chusen_sub; + uint8_t chosen_sub; } SubGhzRemoteApp; SubRemLoadMapState subrem_load_from_file(SubGhzRemoteApp* app); diff --git a/views/edit_menu.c b/views/edit_menu.c index 9b88182b51b..6dd590ed001 100644 --- a/views/edit_menu.c +++ b/views/edit_menu.c @@ -19,7 +19,7 @@ typedef struct { FuriString* file_path; SubRemLoadSubState sub_state; - uint8_t chusen; + uint8_t chosen; } SubRemViewEditMenuModel; void subrem_view_edit_menu_set_callback( @@ -44,7 +44,7 @@ void subrem_view_edit_menu_add_data_to_show( subrem_view_edit_remote->view, SubRemViewEditMenuModel * model, { - model->chusen = index; + model->chosen = index; if(!furi_string_empty(label)) { furi_string_set(model->label, label); } else { @@ -63,7 +63,7 @@ uint8_t subrem_view_edit_menu_get_index(SubRemViewEditMenu* subrem_view_edit_rem with_view_model( subrem_view_edit_remote->view, SubRemViewEditMenuModel * model, - { index = model->chusen; }, + { index = model->chosen; }, true); return index; } @@ -89,7 +89,7 @@ void subrem_view_edit_menu_draw(Canvas* canvas, SubRemViewEditMenuModel* model) // Draw btn name canvas_set_font(canvas, FontPrimary); - switch(model->chusen) { + switch(model->chosen) { case SubRemSubKeyNameUp: canvas_draw_str(canvas, 3, FRAME_HEIGHT - 2, "UP"); break; @@ -129,10 +129,10 @@ void subrem_view_edit_menu_draw(Canvas* canvas, SubRemViewEditMenuModel* model) // Draw arrow canvas_set_color(canvas, ColorBlack); - if(model->chusen != 0) { + if(model->chosen != 0) { canvas_draw_icon(canvas, 119, 13, &I_Pin_arrow_up_7x9); } - if(model->chusen != 4) { + if(model->chosen != 4) { canvas_draw_icon_ex(canvas, 119, 42, &I_Pin_arrow_up_7x9, IconRotation180); } @@ -200,8 +200,8 @@ bool subrem_view_edit_menu_input(InputEvent* event, void* context) { subrem_view_edit_menu->view, SubRemViewEditMenuModel * model, { - if(model->chusen > 0) { - model->chusen -= 1; + if(model->chosen > 0) { + model->chosen -= 1; }; }, true); @@ -213,8 +213,8 @@ bool subrem_view_edit_menu_input(InputEvent* event, void* context) { subrem_view_edit_menu->view, SubRemViewEditMenuModel * model, { - if(model->chusen < 4) { - model->chusen += 1; + if(model->chosen < 4) { + model->chosen += 1; }; }, true); @@ -263,7 +263,7 @@ SubRemViewEditMenu* subrem_view_edit_menu_alloc() { model->label = furi_string_alloc(); // furi_string_alloc_set_str("LABEL"); model->file_path = furi_string_alloc(); // furi_string_alloc_set_str("FILE_PATH"); - model->chusen = 0; + model->chosen = 0; }, true); return subrem_view_edit_menu; diff --git a/views/remote.c b/views/remote.c index fc760862410..65908ed11b4 100644 --- a/views/remote.c +++ b/views/remote.c @@ -8,7 +8,7 @@ #define SUBREM_VIEW_REMOTE_MAX_LABEL_LENGTH 30 #define SUBREM_VIEW_REMOTE_LEFT_OFFSET 10 -#define SUBREM_VIEW_REMOTE_RIGHT_OFFSET 22 +#define SUBREM_VIEW_REMOTE_RIGHT_OFFSET 0 struct SubRemViewRemote { View* view; @@ -120,26 +120,43 @@ void subrem_view_remote_draw(Canvas* canvas, SubRemViewRemoteModel* model) { canvas_clear(canvas); canvas_set_color(canvas, ColorBlack); - canvas_clear(canvas); + // Statusbar + canvas_draw_icon(canvas, 0, 0, &I_status_bar); + if(model->state == SubRemViewRemoteStateOFF) { + canvas_invert_color(canvas); + canvas_draw_rbox(canvas, 12, 0, 52 - 12, 13, 2); + canvas_invert_color(canvas); + canvas_draw_rframe(canvas, 12, 0, 52 - 12, 13, 2); + canvas_draw_str_aligned(canvas, 32, 3, AlignCenter, AlignTop, "Preview"); + } else { + canvas_draw_icon( + canvas, + 0, + 2, + (model->is_external) ? &I_External_antenna_20x12 : &I_Internal_antenna_20x12); + canvas_draw_icon(canvas, 50, 0, &I_Status_cube_14x14); + if(model->state == SubRemViewRemoteStateSending) { + canvas_draw_icon_ex(canvas, 52, 3, &I_Pin_arrow_up_7x9, IconRotation90); + } + } //Icons for Labels - //canvas_draw_icon(canvas, 0, 0, &I_SubGHzRemote_LeftAlignedButtons_9x64); - canvas_draw_icon(canvas, 1, 5, &I_ButtonUp_7x4); - canvas_draw_icon(canvas, 1, 15, &I_ButtonDown_7x4); - canvas_draw_icon(canvas, 2, 23, &I_ButtonLeft_4x7); - canvas_draw_icon(canvas, 2, 33, &I_ButtonRight_4x7); - canvas_draw_icon(canvas, 0, 42, &I_Ok_btn_9x9); - canvas_draw_icon(canvas, 0, 53, &I_back_10px); + const uint8_t list_y = 14; + canvas_draw_icon(canvas, 1, list_y + 5, &I_ButtonUp_7x4); + canvas_draw_icon(canvas, 1, list_y + 15, &I_ButtonDown_7x4); + canvas_draw_icon(canvas, 2, list_y + 23, &I_ButtonLeft_4x7); + canvas_draw_icon(canvas, 2, list_y + 33, &I_ButtonRight_4x7); + canvas_draw_icon(canvas, 0, list_y + 42, &I_Ok_btn_9x9); //Labels canvas_set_font(canvas, FontSecondary); - uint8_t y = 0; + uint8_t y = list_y; for(uint8_t i = 0; i < SubRemSubKeyNameMaxCount; i++) { elements_text_box( canvas, SUBREM_VIEW_REMOTE_LEFT_OFFSET, y + 2, - 126 - SUBREM_VIEW_REMOTE_LEFT_OFFSET - SUBREM_VIEW_REMOTE_RIGHT_OFFSET, + 64 - SUBREM_VIEW_REMOTE_LEFT_OFFSET - SUBREM_VIEW_REMOTE_RIGHT_OFFSET, 12, AlignLeft, AlignBottom, @@ -148,52 +165,50 @@ void subrem_view_remote_draw(Canvas* canvas, SubRemViewRemoteModel* model) { y += 10; } - if(model->state == SubRemViewRemoteStateOFF) { - elements_button_left(canvas, "Back"); - elements_button_right(canvas, "Save"); - } else { - canvas_draw_str_aligned(canvas, 11, 62, AlignLeft, AlignBottom, "Hold=Exit."); - canvas_draw_str_aligned( - canvas, 126, 62, AlignRight, AlignBottom, ((model->is_external) ? "Ext" : "Int")); - } - - //Status text and indicator - canvas_draw_icon(canvas, 113, 15, &I_Pin_cell_13x13); - - if(model->state == SubRemViewRemoteStateIdle || model->state == SubRemViewRemoteStateOFF) { - canvas_draw_str_aligned(canvas, 126, 10, AlignRight, AlignBottom, "Idle"); - } else { - switch(model->state) { - case SubRemViewRemoteStateSending: - canvas_draw_str_aligned(canvas, 126, 10, AlignRight, AlignBottom, "Send"); - break; - case SubRemViewRemoteStateLoading: - canvas_draw_str_aligned(canvas, 126, 10, AlignRight, AlignBottom, "Load"); - break; - default: -#if FURI_DEBUG - canvas_draw_str_aligned(canvas, 126, 10, AlignRight, AlignBottom, "Wrong_state"); -#endif - break; + if(model->state != SubRemViewRemoteStateOFF) { + // D-pad 59x62 + const uint8_t d_pad_x = 3; + const uint8_t d_pad_y = 66; + + canvas_draw_icon(canvas, d_pad_x + 1 * (19 + 1), d_pad_y + 0 * (20 + 1), &I_up); + + canvas_draw_icon(canvas, d_pad_x + 0 * (19 + 1), d_pad_y + 1 * (20 + 1), &I_left); + canvas_draw_icon(canvas, d_pad_x + 1 * (19 + 1), d_pad_y + 1 * (20 + 1), &I_ok); + canvas_draw_icon(canvas, d_pad_x + 2 * (19 + 1), d_pad_y + 1 * (20 + 1), &I_right); + + canvas_draw_icon(canvas, d_pad_x + 1 * (19 + 1), d_pad_y + 2 * (20 + 1), &I_down); + if(model->state == SubRemViewRemoteStateSending) { + switch(model->pressed_btn) { + case SubRemSubKeyNameUp: + canvas_draw_icon( + canvas, d_pad_x + 1 * (19 + 1), d_pad_y + 0 * (20 + 1), &I_up_hover); + break; + case SubRemSubKeyNameDown: + canvas_draw_icon( + canvas, d_pad_x + 1 * (19 + 1), d_pad_y + 2 * (20 + 1), &I_down_hover); + break; + case SubRemSubKeyNameLeft: + canvas_draw_icon( + canvas, d_pad_x + 0 * (19 + 1), d_pad_y + 1 * (20 + 1), &I_left_hover); + break; + case SubRemSubKeyNameRight: + canvas_draw_icon( + canvas, d_pad_x + 2 * (19 + 1), d_pad_y + 1 * (20 + 1), &I_right_hover); + break; + case SubRemSubKeyNameOk: + canvas_draw_icon( + canvas, d_pad_x + 1 * (19 + 1), d_pad_y + 1 * (20 + 1), &I_ok_hover); + break; + default: + break; + } } + } else { + canvas_draw_icon(canvas, 2, 128 - 11, &I_ButtonLeft_4x7); + canvas_draw_str_aligned(canvas, 8, 128 - 4, AlignLeft, AlignBottom, "Back"); - switch(model->pressed_btn) { - case SubRemSubKeyNameUp: - canvas_draw_icon(canvas, 116, 17, &I_Pin_arrow_up_7x9); - break; - case SubRemSubKeyNameDown: - canvas_draw_icon_ex(canvas, 116, 17, &I_Pin_arrow_up_7x9, IconRotation180); - break; - case SubRemSubKeyNameLeft: - canvas_draw_icon_ex(canvas, 115, 18, &I_Pin_arrow_up_7x9, IconRotation270); - break; - case SubRemSubKeyNameRight: - canvas_draw_icon_ex(canvas, 115, 18, &I_Pin_arrow_up_7x9, IconRotation90); - break; - case SubRemSubKeyNameOk: - canvas_draw_icon(canvas, 116, 18, &I_Pin_star_7x7); - break; - } + canvas_draw_icon(canvas, 58, 128 - 11, &I_ButtonRight_4x7); + canvas_draw_str_aligned(canvas, 56, 128 - 4, AlignRight, AlignBottom, "Save"); } } @@ -262,6 +277,7 @@ SubRemViewRemote* subrem_view_remote_alloc() { view_allocate_model( subrem_view_remote->view, ViewModelTypeLocking, sizeof(SubRemViewRemoteModel)); view_set_context(subrem_view_remote->view, subrem_view_remote); + view_set_orientation(subrem_view_remote->view, ViewOrientationVertical); view_set_draw_callback(subrem_view_remote->view, (ViewDrawCallback)subrem_view_remote_draw); view_set_input_callback(subrem_view_remote->view, subrem_view_remote_input); view_set_enter_callback(subrem_view_remote->view, subrem_view_remote_enter);