GUI: Icons and IconsAnimation refactoring. Switch assets to new Icon Api (#566)

* GUI: Icons and IconsAnimation refactoring. Switch assets to new Icon API.
* Gui: icon and animation draw now do not accept null pointer
* Format Sources
* Fix no debug build
* Furi: stricter checks in memmgr
This commit is contained in:
あく
2021-07-07 11:57:49 +03:00
committed by GitHub
parent 607e873404
commit a7283280ef
82 changed files with 1093 additions and 1053 deletions

View File

@@ -4,7 +4,7 @@ void IrdaAppSceneEditDeleteDone::on_enter(IrdaApp* app) {
IrdaAppViewManager* view_manager = app->get_view_manager();
Popup* popup = view_manager->get_popup();
popup_set_icon(popup, 0, 2, I_DolphinMafia_115x62);
popup_set_icon(popup, 0, 2, &I_DolphinMafia_115x62);
popup_set_text(popup, "Deleted", 83, 19, AlignLeft, AlignBottom);
popup_set_callback(popup, IrdaApp::popup_callback);

View File

@@ -41,7 +41,7 @@ void IrdaAppSceneEditDelete::on_enter(IrdaApp* app) {
}
dialog_ex_set_text(dialog_ex, app->get_text_store(0), 64, 32, AlignCenter, AlignCenter);
dialog_ex_set_icon(dialog_ex, 0, 0, I_Empty_1x1);
dialog_ex_set_icon(dialog_ex, 0, 0, NULL);
dialog_ex_set_left_button_text(dialog_ex, "Back");
dialog_ex_set_right_button_text(dialog_ex, "Delete");
dialog_ex_set_result_callback(dialog_ex, dialog_result_callback);

View File

@@ -4,7 +4,7 @@ void IrdaAppSceneEditRenameDone::on_enter(IrdaApp* app) {
IrdaAppViewManager* view_manager = app->get_view_manager();
Popup* popup = view_manager->get_popup();
popup_set_icon(popup, 32, 5, I_DolphinNice_96x59);
popup_set_icon(popup, 32, 5, &I_DolphinNice_96x59);
popup_set_text(popup, "Saved!", 13, 22, AlignLeft, AlignTop);

View File

@@ -5,7 +5,7 @@ void IrdaAppSceneLearnDoneAfter::on_enter(IrdaApp* app) {
auto view_manager = app->get_view_manager();
auto popup = view_manager->get_popup();
popup_set_icon(popup, 0, 30, I_IrdaSendShort_128x34);
popup_set_icon(popup, 0, 30, &I_IrdaSendShort_128x34);
popup_set_text(
popup, "Get ready!\nPoint flipper at target.", 64, 16, AlignCenter, AlignCenter);

View File

@@ -4,7 +4,7 @@ void IrdaAppSceneLearnDone::on_enter(IrdaApp* app) {
IrdaAppViewManager* view_manager = app->get_view_manager();
Popup* popup = view_manager->get_popup();
popup_set_icon(popup, 32, 5, I_DolphinNice_96x59);
popup_set_icon(popup, 32, 5, &I_DolphinNice_96x59);
if(app->get_learn_new_remote()) {
popup_set_text(popup, "New remote\ncreated!", 5, 7, AlignLeft, AlignTop);

View File

@@ -33,7 +33,7 @@ void IrdaAppSceneLearnSuccess::on_enter(IrdaApp* app) {
dialog_ex_set_left_button_text(dialog_ex, "Retry");
dialog_ex_set_right_button_text(dialog_ex, "Save");
dialog_ex_set_center_button_text(dialog_ex, "Send");
dialog_ex_set_icon(dialog_ex, 0, 1, I_DolphinExcited_64x63);
dialog_ex_set_icon(dialog_ex, 0, 1, &I_DolphinExcited_64x63);
dialog_ex_set_result_callback(dialog_ex, dialog_result_callback);
dialog_ex_set_context(dialog_ex, app);

View File

@@ -9,7 +9,7 @@ void IrdaAppSceneLearn::on_enter(IrdaApp* app) {
auto popup = view_manager->get_popup();
popup_set_icon(popup, 0, 32, I_IrdaLearnShort_128x31);
popup_set_icon(popup, 0, 32, &I_IrdaLearnShort_128x31);
popup_set_text(
popup, "Point the remote at IR port\nand push the button", 5, 10, AlignLeft, AlignCenter);
popup_set_callback(popup, NULL);

View File

@@ -8,11 +8,29 @@ void IrdaAppSceneUniversalTV::on_enter(IrdaApp* app) {
int i = 0;
button_panel_add_item(
button_panel, i, 0, 0, 3, 19, I_Power_25x27, I_Power_hvr_25x27, irda_app_item_callback, app);
button_panel,
i,
0,
0,
3,
19,
&I_Power_25x27,
&I_Power_hvr_25x27,
irda_app_item_callback,
app);
brute_force.add_record(i, "POWER");
++i;
button_panel_add_item(
button_panel, i, 1, 0, 36, 19, I_Mute_25x27, I_Mute_hvr_25x27, irda_app_item_callback, app);
button_panel,
i,
1,
0,
36,
19,
&I_Mute_25x27,
&I_Mute_hvr_25x27,
irda_app_item_callback,
app);
brute_force.add_record(i, "MUTE");
++i;
button_panel_add_item(
@@ -22,14 +40,14 @@ void IrdaAppSceneUniversalTV::on_enter(IrdaApp* app) {
1,
3,
66,
I_Vol_up_25x27,
I_Vol_up_hvr_25x27,
&I_Vol_up_25x27,
&I_Vol_up_hvr_25x27,
irda_app_item_callback,
app);
brute_force.add_record(i, "VOL+");
++i;
button_panel_add_item(
button_panel, i, 1, 1, 36, 66, I_Up_25x27, I_Up_hvr_25x27, irda_app_item_callback, app);
button_panel, i, 1, 1, 36, 66, &I_Up_25x27, &I_Up_hvr_25x27, irda_app_item_callback, app);
brute_force.add_record(i, "CH+");
++i;
button_panel_add_item(
@@ -39,14 +57,23 @@ void IrdaAppSceneUniversalTV::on_enter(IrdaApp* app) {
2,
3,
98,
I_Vol_down_25x27,
I_Vol_down_hvr_25x27,
&I_Vol_down_25x27,
&I_Vol_down_hvr_25x27,
irda_app_item_callback,
app);
brute_force.add_record(i, "VOL-");
++i;
button_panel_add_item(
button_panel, i, 1, 2, 36, 98, I_Down_25x27, I_Down_hvr_25x27, irda_app_item_callback, app);
button_panel,
i,
1,
2,
36,
98,
&I_Down_25x27,
&I_Down_hvr_25x27,
irda_app_item_callback,
app);
brute_force.add_record(i, "CH-");
button_panel_add_label(button_panel, 6, 11, FontPrimary, "TV remote");