diff --git a/.deepsource.toml b/.deepsource.toml new file mode 100644 index 0000000..ae0e43d --- /dev/null +++ b/.deepsource.toml @@ -0,0 +1,7 @@ +version = 1 + +[[analyzers]] +name = "cxx" + +[[transformers]] +name = "clang-format" \ No newline at end of file diff --git a/helpers/gui_top_buttons.c b/helpers/gui_top_buttons.c deleted file mode 100644 index 0415c5a..0000000 --- a/helpers/gui_top_buttons.c +++ /dev/null @@ -1,59 +0,0 @@ -#include "gui_top_buttons.h" - -void elements_button_top_left(Canvas* canvas, const char* str) { - const Icon* icon = &I_ButtonUp_7x4; - - const uint8_t button_height = 12; - const uint8_t vertical_offset = 3; - const uint8_t horizontal_offset = 3; - const uint8_t string_width = canvas_string_width(canvas, str); - const uint8_t icon_h_offset = 3; - const uint8_t icon_width_with_offset = icon_get_width(icon) + icon_h_offset; - const uint8_t icon_v_offset = icon_get_height(icon) + vertical_offset; - const uint8_t button_width = string_width + horizontal_offset * 2 + icon_width_with_offset; - - const uint8_t x = 0; - const uint8_t y = 0 + button_height; - - uint8_t line_x = x + button_width; - uint8_t line_y = y - button_height; - canvas_draw_box(canvas, x, line_y, button_width, button_height); - canvas_draw_line(canvas, line_x + 0, line_y, line_x + 0, y - 1); - canvas_draw_line(canvas, line_x + 1, line_y, line_x + 1, y - 2); - canvas_draw_line(canvas, line_x + 2, line_y, line_x + 2, y - 3); - - canvas_invert_color(canvas); - canvas_draw_icon(canvas, x + horizontal_offset, y - icon_v_offset, icon); - canvas_draw_str( - canvas, x + horizontal_offset + icon_width_with_offset, y - vertical_offset, str); - canvas_invert_color(canvas); -} - -void elements_button_top_right(Canvas* canvas, const char* str) { - const Icon* icon = &I_ButtonDown_7x4; - - const uint8_t button_height = 12; - const uint8_t vertical_offset = 3; - const uint8_t horizontal_offset = 3; - const uint8_t string_width = canvas_string_width(canvas, str); - const uint8_t icon_h_offset = 3; - const uint8_t icon_width_with_offset = icon_get_width(icon) + icon_h_offset; - const uint8_t icon_v_offset = icon_get_height(icon) + vertical_offset + 1; - const uint8_t button_width = string_width + horizontal_offset * 2 + icon_width_with_offset; - - const uint8_t x = canvas_width(canvas); - const uint8_t y = 0 + button_height; - - uint8_t line_x = x - button_width; - uint8_t line_y = y - button_height; - canvas_draw_box(canvas, line_x, line_y, button_width, button_height); - canvas_draw_line(canvas, line_x - 1, line_y, line_x - 1, y - 1); - canvas_draw_line(canvas, line_x - 2, line_y, line_x - 2, y - 2); - canvas_draw_line(canvas, line_x - 3, line_y, line_x - 3, y - 3); - - canvas_invert_color(canvas); - canvas_draw_str(canvas, x - button_width + horizontal_offset, y - vertical_offset, str); - canvas_draw_icon( - canvas, x - horizontal_offset - icon_get_width(icon), y - icon_v_offset, icon); - canvas_invert_color(canvas); -} \ No newline at end of file diff --git a/helpers/gui_top_buttons.h b/helpers/gui_top_buttons.h deleted file mode 100644 index 6862ed6..0000000 --- a/helpers/gui_top_buttons.h +++ /dev/null @@ -1,35 +0,0 @@ -#pragma once - -#include -#include -#include -#include -#include - -/** - * @brief This function draws a button in the top left corner of the canvas with icon and string. - * - * The design and layout of the button is defined within this function. - * - * - * @param[in] canvas This is a pointer to the @c Canvas structure where the button will be drawn. - * @param[in] str This is a pointer to the character string that will be drawn within the button. - * - * @note Thanks to the author of metronome @see https://github.com/panki27/Metronome - * - */ -void elements_button_top_left(Canvas* canvas, const char* str); - -/** - * @brief This function draws a button in the top right corner of the canvas with icon and string. - * - * The design and layout of the button is defined within this function. - * - * - * @param[in] canvas This is a pointer to the @c Canvas structure where the button will be drawn. - * @param[in] str This is a pointer to the character string that will be drawn within the button. - * - * @note Thanks to the author of metronome @see https://github.com/panki27/Metronome - * - */ -void elements_button_top_right(Canvas* canvas, const char* str); diff --git a/scenes/subbrute_scene_load_file.c b/scenes/subbrute_scene_load_file.c index aa78769..936ba72 100644 --- a/scenes/subbrute_scene_load_file.c +++ b/scenes/subbrute_scene_load_file.c @@ -56,7 +56,7 @@ void subbrute_scene_load_file_on_enter(void* context) { } // Ready to run! FURI_LOG_I(TAG, "Ready to run"); - res = true; + load_result = true; } } diff --git a/subbrute_i.h b/subbrute_i.h index 63748ed..8301a88 100644 --- a/subbrute_i.h +++ b/subbrute_i.h @@ -31,7 +31,7 @@ #include "views/subbrute_attack_view.h" #include "views/subbrute_main_view.h" -#define SUB_BRUTE_FORCER_VERSION "Sub-GHz BruteForcer 3.E" +#define SUB_BRUTE_FORCER_VERSION "Sub-GHz BruteForcer 3.F" #ifdef FURI_DEBUG //#define SUBBRUTE_FAST_TRACK false diff --git a/views/subbrute_attack_view.c b/views/subbrute_attack_view.c index 1f5766d..4cd9f56 100644 --- a/views/subbrute_attack_view.c +++ b/views/subbrute_attack_view.c @@ -1,6 +1,5 @@ #include "subbrute_attack_view.h" #include "../subbrute_i.h" -#include "../helpers/gui_top_buttons.h" #include #include @@ -310,8 +309,8 @@ void subbrute_attack_view_draw(Canvas* canvas, void* context) { elements_button_left(canvas, "-1"); elements_button_right(canvas, "+1"); elements_button_center(canvas, "Start"); - elements_button_top_left(canvas, "Save"); - elements_button_top_right(canvas, "Resend"); + elements_button_up(canvas, "Save"); + elements_button_down(canvas, "Resend"); } else { // canvas_draw_icon_animation const uint8_t icon_h_offset = 0; diff --git a/views/subbrute_main_view.c b/views/subbrute_main_view.c index 0a19979..a840fe7 100644 --- a/views/subbrute_main_view.c +++ b/views/subbrute_main_view.c @@ -1,6 +1,5 @@ #include "subbrute_main_view.h" #include "../subbrute_i.h" -#include "../helpers/gui_top_buttons.h" #include #include @@ -126,9 +125,9 @@ void subbrute_main_view_draw_is_byte_selected(Canvas* canvas, SubBruteMainViewMo // Switch to another mode if(model->two_bytes) { - elements_button_top_left(canvas, "One byte"); + elements_button_up(canvas, "One byte"); } else { - elements_button_top_left(canvas, "Two bytes"); + elements_button_up(canvas, "Two bytes"); } }