[FL-1250, FL-1252, FL-1323, FL-1324] New IRDA Application (part 1) (#497)

* Add new IrdaApp (half ready), add ButtonMenu

* Fix NEC's extension

* clang-format

* Fix leak

* Add submenu optional header

* IRDA: add Edit button

* clang-format

* IrdaApp: Fix scene flow

* Add IRDA NEC extended protocol

* IRDA: Add address/command length

Co-authored-by: SG <who.just.the.doctor@gmail.com>
This commit is contained in:
Albert Kharisov
2021-06-02 18:16:05 +03:00
committed by GitHub
parent d040515f84
commit 31c31db479
62 changed files with 2568 additions and 375 deletions

View File

@@ -1,6 +1,8 @@
#include "elements.h"
#include "gui/canvas.h"
#include <assets_icons.h>
#include <gui/icon_i.h>
#include <m-string.h>
#include <furi.h>
#include "canvas_i.h"
#include <string.h>
@@ -44,7 +46,7 @@ void elements_scrollbar(Canvas* canvas, uint8_t pos, uint8_t total) {
}
// Position block
if(total) {
uint8_t block_h = ((float)height) / total;
float block_h = ((float)height) / total;
canvas_draw_box(canvas, width - 3, block_h * pos, 3, MAX(block_h, 1));
}
}
@@ -249,13 +251,17 @@ void elements_slightly_rounded_frame(
uint8_t width,
uint8_t height) {
furi_assert(canvas);
canvas_draw_frame(canvas, x, y, width, height);
canvas_invert_color(canvas);
canvas_draw_dot(canvas, x, y);
canvas_draw_dot(canvas, x + width - 1, y + height - 1);
canvas_draw_dot(canvas, x + width - 1, y);
canvas_draw_dot(canvas, x, y + height - 1);
canvas_invert_color(canvas);
canvas_draw_rframe(canvas, x, y, width, height, 1);
}
void elements_slightly_rounded_box(
Canvas* canvas,
uint8_t x,
uint8_t y,
uint8_t width,
uint8_t height) {
furi_assert(canvas);
canvas_draw_rbox(canvas, x, y, width, height, 1);
}
void elements_string_fit_width(Canvas* canvas, string_t string, uint8_t width) {