[FL-3564] New IR universal remote graphics (#3006)
* New IR universal remote layout * Remove redundant checks Co-authored-by: あく <alleteam@gmail.com>
@ -1,6 +1,7 @@
|
|||||||
#include "../infrared_i.h"
|
#include "../infrared_i.h"
|
||||||
|
|
||||||
#include "common/infrared_scene_universal_common.h"
|
#include "common/infrared_scene_universal_common.h"
|
||||||
|
#include <furi_hal_rtc.h>
|
||||||
|
|
||||||
void infrared_scene_universal_ac_on_enter(void* context) {
|
void infrared_scene_universal_ac_on_enter(void* context) {
|
||||||
infrared_scene_universal_common_on_enter(context);
|
infrared_scene_universal_common_on_enter(context);
|
||||||
@ -18,24 +19,26 @@ void infrared_scene_universal_ac_on_enter(void* context) {
|
|||||||
i,
|
i,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
3,
|
6,
|
||||||
22,
|
15,
|
||||||
&I_Off_25x27,
|
&I_power_19x20,
|
||||||
&I_Off_hvr_25x27,
|
&I_power_hover_19x20,
|
||||||
infrared_scene_universal_common_item_callback,
|
infrared_scene_universal_common_item_callback,
|
||||||
context);
|
context);
|
||||||
|
button_panel_add_icon(button_panel, 4, 37, &I_power_text_24x5);
|
||||||
infrared_brute_force_add_record(brute_force, i++, "Off");
|
infrared_brute_force_add_record(brute_force, i++, "Off");
|
||||||
button_panel_add_item(
|
button_panel_add_item(
|
||||||
button_panel,
|
button_panel,
|
||||||
i,
|
i,
|
||||||
1,
|
1,
|
||||||
0,
|
0,
|
||||||
36,
|
39,
|
||||||
22,
|
15,
|
||||||
&I_Dehumidify_25x27,
|
&I_dry_19x20,
|
||||||
&I_Dehumidify_hvr_25x27,
|
&I_dry_hover_19x20,
|
||||||
infrared_scene_universal_common_item_callback,
|
infrared_scene_universal_common_item_callback,
|
||||||
context);
|
context);
|
||||||
|
button_panel_add_icon(button_panel, 41, 37, &I_dry_text_15x5);
|
||||||
infrared_brute_force_add_record(brute_force, i++, "Dh");
|
infrared_brute_force_add_record(brute_force, i++, "Dh");
|
||||||
button_panel_add_item(
|
button_panel_add_item(
|
||||||
button_panel,
|
button_panel,
|
||||||
@ -43,9 +46,9 @@ void infrared_scene_universal_ac_on_enter(void* context) {
|
|||||||
0,
|
0,
|
||||||
1,
|
1,
|
||||||
3,
|
3,
|
||||||
59,
|
49,
|
||||||
&I_CoolHi_25x27,
|
&I_max_24x23,
|
||||||
&I_CoolHi_hvr_25x27,
|
&I_max_hover_24x23,
|
||||||
infrared_scene_universal_common_item_callback,
|
infrared_scene_universal_common_item_callback,
|
||||||
context);
|
context);
|
||||||
infrared_brute_force_add_record(brute_force, i++, "Cool_hi");
|
infrared_brute_force_add_record(brute_force, i++, "Cool_hi");
|
||||||
@ -54,39 +57,71 @@ void infrared_scene_universal_ac_on_enter(void* context) {
|
|||||||
i,
|
i,
|
||||||
1,
|
1,
|
||||||
1,
|
1,
|
||||||
36,
|
37,
|
||||||
59,
|
49,
|
||||||
&I_HeatHi_25x27,
|
&I_max_24x23,
|
||||||
&I_HeatHi_hvr_25x27,
|
&I_max_hover_24x23,
|
||||||
infrared_scene_universal_common_item_callback,
|
infrared_scene_universal_common_item_callback,
|
||||||
context);
|
context);
|
||||||
infrared_brute_force_add_record(brute_force, i++, "Heat_hi");
|
infrared_brute_force_add_record(brute_force, i++, "Heat_hi");
|
||||||
button_panel_add_item(
|
if(furi_hal_rtc_get_locale_units() == FuriHalRtcLocaleUnitsMetric) {
|
||||||
button_panel,
|
button_panel_add_item(
|
||||||
i,
|
button_panel,
|
||||||
0,
|
i,
|
||||||
2,
|
0,
|
||||||
3,
|
2,
|
||||||
91,
|
3,
|
||||||
&I_CoolLo_25x27,
|
100,
|
||||||
&I_CoolLo_hvr_25x27,
|
&I_celsius_24x23,
|
||||||
infrared_scene_universal_common_item_callback,
|
&I_celsius_hover_24x23,
|
||||||
context);
|
infrared_scene_universal_common_item_callback,
|
||||||
|
context);
|
||||||
|
} else {
|
||||||
|
button_panel_add_item(
|
||||||
|
button_panel,
|
||||||
|
i,
|
||||||
|
0,
|
||||||
|
2,
|
||||||
|
3,
|
||||||
|
100,
|
||||||
|
&I_fahren_24x23,
|
||||||
|
&I_fahren_hover_24x23,
|
||||||
|
infrared_scene_universal_common_item_callback,
|
||||||
|
context);
|
||||||
|
}
|
||||||
infrared_brute_force_add_record(brute_force, i++, "Cool_lo");
|
infrared_brute_force_add_record(brute_force, i++, "Cool_lo");
|
||||||
button_panel_add_item(
|
|
||||||
button_panel,
|
if(furi_hal_rtc_get_locale_units() == FuriHalRtcLocaleUnitsMetric) {
|
||||||
i,
|
button_panel_add_item(
|
||||||
1,
|
button_panel,
|
||||||
2,
|
i,
|
||||||
36,
|
1,
|
||||||
91,
|
2,
|
||||||
&I_HeatLo_25x27,
|
37,
|
||||||
&I_HeatLo_hvr_25x27,
|
100,
|
||||||
infrared_scene_universal_common_item_callback,
|
&I_celsius_24x23,
|
||||||
context);
|
&I_celsius_hover_24x23,
|
||||||
|
infrared_scene_universal_common_item_callback,
|
||||||
|
context);
|
||||||
|
} else {
|
||||||
|
button_panel_add_item(
|
||||||
|
button_panel,
|
||||||
|
i,
|
||||||
|
1,
|
||||||
|
2,
|
||||||
|
37,
|
||||||
|
100,
|
||||||
|
&I_fahren_24x23,
|
||||||
|
&I_fahren_hover_24x23,
|
||||||
|
infrared_scene_universal_common_item_callback,
|
||||||
|
context);
|
||||||
|
}
|
||||||
infrared_brute_force_add_record(brute_force, i++, "Heat_lo");
|
infrared_brute_force_add_record(brute_force, i++, "Heat_lo");
|
||||||
|
|
||||||
button_panel_add_label(button_panel, 6, 10, FontPrimary, "AC remote");
|
button_panel_add_icon(button_panel, 0, 60, &I_cool_30x51);
|
||||||
|
button_panel_add_icon(button_panel, 34, 60, &I_heat_30x51);
|
||||||
|
|
||||||
|
button_panel_add_label(button_panel, 4, 10, FontPrimary, "AC remote");
|
||||||
|
|
||||||
view_set_orientation(view_stack_get_view(infrared->view_stack), ViewOrientationVertical);
|
view_set_orientation(view_stack_get_view(infrared->view_stack), ViewOrientationVertical);
|
||||||
view_dispatcher_switch_to_view(infrared->view_dispatcher, InfraredViewStack);
|
view_dispatcher_switch_to_view(infrared->view_dispatcher, InfraredViewStack);
|
||||||
|
|||||||
@ -18,82 +18,88 @@ void infrared_scene_universal_audio_on_enter(void* context) {
|
|||||||
i,
|
i,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
3,
|
6,
|
||||||
11,
|
13,
|
||||||
&I_Power_25x27,
|
&I_power_19x20,
|
||||||
&I_Power_hvr_25x27,
|
&I_power_hover_19x20,
|
||||||
infrared_scene_universal_common_item_callback,
|
infrared_scene_universal_common_item_callback,
|
||||||
context);
|
context);
|
||||||
|
button_panel_add_icon(button_panel, 4, 35, &I_power_text_24x5);
|
||||||
infrared_brute_force_add_record(brute_force, i++, "Power");
|
infrared_brute_force_add_record(brute_force, i++, "Power");
|
||||||
button_panel_add_item(
|
button_panel_add_item(
|
||||||
button_panel,
|
button_panel,
|
||||||
i,
|
i,
|
||||||
1,
|
1,
|
||||||
0,
|
0,
|
||||||
36,
|
39,
|
||||||
11,
|
13,
|
||||||
&I_Mute_25x27,
|
&I_mute_19x20,
|
||||||
&I_Mute_hvr_25x27,
|
&I_mute_hover_19x20,
|
||||||
infrared_scene_universal_common_item_callback,
|
infrared_scene_universal_common_item_callback,
|
||||||
context);
|
context);
|
||||||
|
button_panel_add_icon(button_panel, 39, 35, &I_mute_text_19x5);
|
||||||
infrared_brute_force_add_record(brute_force, i++, "Mute");
|
infrared_brute_force_add_record(brute_force, i++, "Mute");
|
||||||
button_panel_add_item(
|
button_panel_add_item(
|
||||||
button_panel,
|
button_panel,
|
||||||
i,
|
i,
|
||||||
0,
|
0,
|
||||||
1,
|
1,
|
||||||
3,
|
6,
|
||||||
41,
|
42,
|
||||||
&I_Play_25x27,
|
&I_play_19x20,
|
||||||
&I_Play_hvr_25x27,
|
&I_play_hover_19x20,
|
||||||
infrared_scene_universal_common_item_callback,
|
infrared_scene_universal_common_item_callback,
|
||||||
context);
|
context);
|
||||||
|
button_panel_add_icon(button_panel, 6, 64, &I_play_text_19x5);
|
||||||
infrared_brute_force_add_record(brute_force, i++, "Play");
|
infrared_brute_force_add_record(brute_force, i++, "Play");
|
||||||
button_panel_add_item(
|
button_panel_add_item(
|
||||||
button_panel,
|
button_panel,
|
||||||
i,
|
i,
|
||||||
1,
|
0,
|
||||||
1,
|
2,
|
||||||
36,
|
6,
|
||||||
41,
|
71,
|
||||||
&I_Pause_25x27,
|
&I_pause_19x20,
|
||||||
&I_Pause_hvr_25x27,
|
&I_pause_hover_19x20,
|
||||||
infrared_scene_universal_common_item_callback,
|
infrared_scene_universal_common_item_callback,
|
||||||
context);
|
context);
|
||||||
|
button_panel_add_icon(button_panel, 4, 93, &I_pause_text_23x5);
|
||||||
infrared_brute_force_add_record(brute_force, i++, "Pause");
|
infrared_brute_force_add_record(brute_force, i++, "Pause");
|
||||||
button_panel_add_item(
|
button_panel_add_item(
|
||||||
button_panel,
|
button_panel,
|
||||||
i,
|
i,
|
||||||
0,
|
0,
|
||||||
2,
|
|
||||||
3,
|
3,
|
||||||
71,
|
6,
|
||||||
&I_TrackPrev_25x27,
|
101,
|
||||||
&I_TrackPrev_hvr_25x27,
|
&I_prev_19x20,
|
||||||
|
&I_prev_hover_19x20,
|
||||||
infrared_scene_universal_common_item_callback,
|
infrared_scene_universal_common_item_callback,
|
||||||
context);
|
context);
|
||||||
|
button_panel_add_icon(button_panel, 6, 123, &I_prev_text_19x5);
|
||||||
infrared_brute_force_add_record(brute_force, i++, "Prev");
|
infrared_brute_force_add_record(brute_force, i++, "Prev");
|
||||||
button_panel_add_item(
|
button_panel_add_item(
|
||||||
button_panel,
|
button_panel,
|
||||||
i,
|
i,
|
||||||
1,
|
1,
|
||||||
2,
|
3,
|
||||||
36,
|
39,
|
||||||
71,
|
101,
|
||||||
&I_TrackNext_25x27,
|
&I_next_19x20,
|
||||||
&I_TrackNext_hvr_25x27,
|
&I_next_hover_19x20,
|
||||||
infrared_scene_universal_common_item_callback,
|
infrared_scene_universal_common_item_callback,
|
||||||
context);
|
context);
|
||||||
|
button_panel_add_icon(button_panel, 39, 123, &I_next_text_19x6);
|
||||||
infrared_brute_force_add_record(brute_force, i++, "Next");
|
infrared_brute_force_add_record(brute_force, i++, "Next");
|
||||||
button_panel_add_item(
|
button_panel_add_item(
|
||||||
button_panel,
|
button_panel,
|
||||||
i,
|
i,
|
||||||
0,
|
1,
|
||||||
3,
|
2,
|
||||||
3,
|
37,
|
||||||
101,
|
77,
|
||||||
&I_Vol_down_25x27,
|
&I_voldown_24x21,
|
||||||
&I_Vol_down_hvr_25x27,
|
&I_voldown_hover_24x21,
|
||||||
infrared_scene_universal_common_item_callback,
|
infrared_scene_universal_common_item_callback,
|
||||||
context);
|
context);
|
||||||
infrared_brute_force_add_record(brute_force, i++, "Vol_dn");
|
infrared_brute_force_add_record(brute_force, i++, "Vol_dn");
|
||||||
@ -101,16 +107,17 @@ void infrared_scene_universal_audio_on_enter(void* context) {
|
|||||||
button_panel,
|
button_panel,
|
||||||
i,
|
i,
|
||||||
1,
|
1,
|
||||||
3,
|
1,
|
||||||
36,
|
37,
|
||||||
101,
|
43,
|
||||||
&I_Vol_up_25x27,
|
&I_volup_24x21,
|
||||||
&I_Vol_up_hvr_25x27,
|
&I_volup_hover_24x21,
|
||||||
infrared_scene_universal_common_item_callback,
|
infrared_scene_universal_common_item_callback,
|
||||||
context);
|
context);
|
||||||
infrared_brute_force_add_record(brute_force, i++, "Vol_up");
|
infrared_brute_force_add_record(brute_force, i++, "Vol_up");
|
||||||
|
|
||||||
button_panel_add_label(button_panel, 1, 8, FontPrimary, "Mus. remote");
|
button_panel_add_label(button_panel, 1, 10, FontPrimary, "Mus. remote");
|
||||||
|
button_panel_add_icon(button_panel, 34, 56, &I_vol_ac_text_30x30);
|
||||||
|
|
||||||
view_set_orientation(view_stack_get_view(infrared->view_stack), ViewOrientationVertical);
|
view_set_orientation(view_stack_get_view(infrared->view_stack), ViewOrientationVertical);
|
||||||
view_dispatcher_switch_to_view(infrared->view_dispatcher, InfraredViewStack);
|
view_dispatcher_switch_to_view(infrared->view_dispatcher, InfraredViewStack);
|
||||||
|
|||||||
@ -11,59 +11,62 @@ void infrared_scene_universal_projector_on_enter(void* context) {
|
|||||||
|
|
||||||
infrared_brute_force_set_db_filename(brute_force, EXT_PATH("infrared/assets/projector.ir"));
|
infrared_brute_force_set_db_filename(brute_force, EXT_PATH("infrared/assets/projector.ir"));
|
||||||
|
|
||||||
button_panel_reserve(button_panel, 2, 2);
|
button_panel_reserve(button_panel, 2, 3);
|
||||||
uint32_t i = 0;
|
uint32_t i = 0;
|
||||||
button_panel_add_item(
|
button_panel_add_item(
|
||||||
button_panel,
|
button_panel,
|
||||||
i,
|
i,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
3,
|
6,
|
||||||
19,
|
23,
|
||||||
&I_Power_25x27,
|
&I_power_19x20,
|
||||||
&I_Power_hvr_25x27,
|
&I_power_hover_19x20,
|
||||||
infrared_scene_universal_common_item_callback,
|
infrared_scene_universal_common_item_callback,
|
||||||
context);
|
context);
|
||||||
|
button_panel_add_icon(button_panel, 4, 45, &I_power_text_24x5);
|
||||||
infrared_brute_force_add_record(brute_force, i++, "Power");
|
infrared_brute_force_add_record(brute_force, i++, "Power");
|
||||||
button_panel_add_item(
|
button_panel_add_item(
|
||||||
button_panel,
|
button_panel,
|
||||||
i,
|
i,
|
||||||
1,
|
1,
|
||||||
0,
|
0,
|
||||||
36,
|
39,
|
||||||
19,
|
23,
|
||||||
&I_Mute_25x27,
|
&I_mute_19x20,
|
||||||
&I_Mute_hvr_25x27,
|
&I_mute_hover_19x20,
|
||||||
infrared_scene_universal_common_item_callback,
|
infrared_scene_universal_common_item_callback,
|
||||||
context);
|
context);
|
||||||
|
button_panel_add_icon(button_panel, 39, 45, &I_mute_text_19x5);
|
||||||
infrared_brute_force_add_record(brute_force, i++, "Mute");
|
infrared_brute_force_add_record(brute_force, i++, "Mute");
|
||||||
button_panel_add_item(
|
button_panel_add_item(
|
||||||
button_panel,
|
button_panel,
|
||||||
i,
|
i,
|
||||||
0,
|
0,
|
||||||
1,
|
1,
|
||||||
3,
|
20,
|
||||||
66,
|
59,
|
||||||
&I_Vol_up_25x27,
|
&I_volup_24x21,
|
||||||
&I_Vol_up_hvr_25x27,
|
&I_volup_hover_24x21,
|
||||||
infrared_scene_universal_common_item_callback,
|
infrared_scene_universal_common_item_callback,
|
||||||
context);
|
context);
|
||||||
infrared_brute_force_add_record(brute_force, i++, "Vol_up");
|
infrared_brute_force_add_record(brute_force, i++, "Vol_up");
|
||||||
|
|
||||||
button_panel_add_item(
|
button_panel_add_item(
|
||||||
button_panel,
|
button_panel,
|
||||||
i,
|
i,
|
||||||
1,
|
0,
|
||||||
1,
|
2,
|
||||||
36,
|
20,
|
||||||
66,
|
93,
|
||||||
&I_Vol_down_25x27,
|
&I_voldown_24x21,
|
||||||
&I_Vol_down_hvr_25x27,
|
&I_voldown_hover_24x21,
|
||||||
infrared_scene_universal_common_item_callback,
|
infrared_scene_universal_common_item_callback,
|
||||||
context);
|
context);
|
||||||
infrared_brute_force_add_record(brute_force, i++, "Vol_dn");
|
infrared_brute_force_add_record(brute_force, i++, "Vol_dn");
|
||||||
|
|
||||||
button_panel_add_label(button_panel, 2, 11, FontPrimary, "Proj. remote");
|
button_panel_add_label(button_panel, 3, 11, FontPrimary, "Proj. remote");
|
||||||
button_panel_add_label(button_panel, 17, 62, FontSecondary, "Volume");
|
button_panel_add_icon(button_panel, 17, 72, &I_vol_ac_text_30x30);
|
||||||
|
|
||||||
view_set_orientation(view_stack_get_view(infrared->view_stack), ViewOrientationVertical);
|
view_set_orientation(view_stack_get_view(infrared->view_stack), ViewOrientationVertical);
|
||||||
view_dispatcher_switch_to_view(infrared->view_dispatcher, InfraredViewStack);
|
view_dispatcher_switch_to_view(infrared->view_dispatcher, InfraredViewStack);
|
||||||
|
|||||||
@ -18,77 +18,82 @@ void infrared_scene_universal_tv_on_enter(void* context) {
|
|||||||
i,
|
i,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
3,
|
6,
|
||||||
19,
|
16,
|
||||||
&I_Power_25x27,
|
&I_power_19x20,
|
||||||
&I_Power_hvr_25x27,
|
&I_power_hover_19x20,
|
||||||
infrared_scene_universal_common_item_callback,
|
infrared_scene_universal_common_item_callback,
|
||||||
context);
|
context);
|
||||||
|
button_panel_add_icon(button_panel, 4, 38, &I_power_text_24x5);
|
||||||
infrared_brute_force_add_record(brute_force, i++, "Power");
|
infrared_brute_force_add_record(brute_force, i++, "Power");
|
||||||
button_panel_add_item(
|
button_panel_add_item(
|
||||||
button_panel,
|
button_panel,
|
||||||
i,
|
i,
|
||||||
1,
|
1,
|
||||||
0,
|
0,
|
||||||
36,
|
39,
|
||||||
19,
|
16,
|
||||||
&I_Mute_25x27,
|
&I_mute_19x20,
|
||||||
&I_Mute_hvr_25x27,
|
&I_mute_hover_19x20,
|
||||||
infrared_scene_universal_common_item_callback,
|
infrared_scene_universal_common_item_callback,
|
||||||
context);
|
context);
|
||||||
|
button_panel_add_icon(button_panel, 39, 38, &I_mute_text_19x5);
|
||||||
|
|
||||||
|
button_panel_add_icon(button_panel, 0, 66, &I_ch_text_31x34);
|
||||||
|
button_panel_add_icon(button_panel, 35, 66, &I_vol_tv_text_29x34);
|
||||||
|
|
||||||
infrared_brute_force_add_record(brute_force, i++, "Mute");
|
infrared_brute_force_add_record(brute_force, i++, "Mute");
|
||||||
|
button_panel_add_item(
|
||||||
|
button_panel,
|
||||||
|
i,
|
||||||
|
1,
|
||||||
|
1,
|
||||||
|
38,
|
||||||
|
53,
|
||||||
|
&I_volup_24x21,
|
||||||
|
&I_volup_hover_24x21,
|
||||||
|
infrared_scene_universal_common_item_callback,
|
||||||
|
context);
|
||||||
|
|
||||||
|
infrared_brute_force_add_record(brute_force, i++, "Vol_up");
|
||||||
button_panel_add_item(
|
button_panel_add_item(
|
||||||
button_panel,
|
button_panel,
|
||||||
i,
|
i,
|
||||||
0,
|
0,
|
||||||
1,
|
1,
|
||||||
3,
|
3,
|
||||||
66,
|
53,
|
||||||
&I_Vol_up_25x27,
|
&I_ch_up_24x21,
|
||||||
&I_Vol_up_hvr_25x27,
|
&I_ch_up_hover_24x21,
|
||||||
infrared_scene_universal_common_item_callback,
|
|
||||||
context);
|
|
||||||
infrared_brute_force_add_record(brute_force, i++, "Vol_up");
|
|
||||||
button_panel_add_item(
|
|
||||||
button_panel,
|
|
||||||
i,
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
36,
|
|
||||||
66,
|
|
||||||
&I_Up_25x27,
|
|
||||||
&I_Up_hvr_25x27,
|
|
||||||
infrared_scene_universal_common_item_callback,
|
infrared_scene_universal_common_item_callback,
|
||||||
context);
|
context);
|
||||||
infrared_brute_force_add_record(brute_force, i++, "Ch_next");
|
infrared_brute_force_add_record(brute_force, i++, "Ch_next");
|
||||||
button_panel_add_item(
|
button_panel_add_item(
|
||||||
button_panel,
|
button_panel,
|
||||||
i,
|
i,
|
||||||
0,
|
1,
|
||||||
2,
|
2,
|
||||||
3,
|
38,
|
||||||
98,
|
91,
|
||||||
&I_Vol_down_25x27,
|
&I_voldown_24x21,
|
||||||
&I_Vol_down_hvr_25x27,
|
&I_voldown_hover_24x21,
|
||||||
infrared_scene_universal_common_item_callback,
|
infrared_scene_universal_common_item_callback,
|
||||||
context);
|
context);
|
||||||
infrared_brute_force_add_record(brute_force, i++, "Vol_dn");
|
infrared_brute_force_add_record(brute_force, i++, "Vol_dn");
|
||||||
button_panel_add_item(
|
button_panel_add_item(
|
||||||
button_panel,
|
button_panel,
|
||||||
i,
|
i,
|
||||||
1,
|
0,
|
||||||
2,
|
2,
|
||||||
36,
|
3,
|
||||||
98,
|
91,
|
||||||
&I_Down_25x27,
|
&I_ch_down_24x21,
|
||||||
&I_Down_hvr_25x27,
|
&I_ch_down_hover_24x21,
|
||||||
infrared_scene_universal_common_item_callback,
|
infrared_scene_universal_common_item_callback,
|
||||||
context);
|
context);
|
||||||
infrared_brute_force_add_record(brute_force, i++, "Ch_prev");
|
infrared_brute_force_add_record(brute_force, i++, "Ch_prev");
|
||||||
|
|
||||||
button_panel_add_label(button_panel, 6, 11, FontPrimary, "TV remote");
|
button_panel_add_label(button_panel, 5, 10, FontPrimary, "TV remote");
|
||||||
button_panel_add_label(button_panel, 9, 64, FontSecondary, "Vol");
|
|
||||||
button_panel_add_label(button_panel, 43, 64, FontSecondary, "Ch");
|
|
||||||
|
|
||||||
view_set_orientation(view_stack_get_view(infrared->view_stack), ViewOrientationVertical);
|
view_set_orientation(view_stack_get_view(infrared->view_stack), ViewOrientationVertical);
|
||||||
view_dispatcher_switch_to_view(infrared->view_dispatcher, InfraredViewStack);
|
view_dispatcher_switch_to_view(infrared->view_dispatcher, InfraredViewStack);
|
||||||
|
|||||||
@ -29,6 +29,9 @@ typedef struct {
|
|||||||
const Icon* name_selected;
|
const Icon* name_selected;
|
||||||
} IconElement;
|
} IconElement;
|
||||||
|
|
||||||
|
LIST_DEF(IconList, IconElement, M_POD_OPLIST)
|
||||||
|
#define M_OPL_IconList_t() LIST_OPLIST(IconList)
|
||||||
|
|
||||||
typedef struct ButtonItem {
|
typedef struct ButtonItem {
|
||||||
uint32_t index;
|
uint32_t index;
|
||||||
ButtonItemCallback callback;
|
ButtonItemCallback callback;
|
||||||
@ -47,6 +50,7 @@ struct ButtonPanel {
|
|||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
ButtonMatrix_t button_matrix;
|
ButtonMatrix_t button_matrix;
|
||||||
|
IconList_t icons;
|
||||||
LabelList_t labels;
|
LabelList_t labels;
|
||||||
uint16_t reserve_x;
|
uint16_t reserve_x;
|
||||||
uint16_t reserve_y;
|
uint16_t reserve_y;
|
||||||
@ -146,6 +150,7 @@ void button_panel_reset(ButtonPanel* button_panel) {
|
|||||||
model->selected_item_x = 0;
|
model->selected_item_x = 0;
|
||||||
model->selected_item_y = 0;
|
model->selected_item_y = 0;
|
||||||
LabelList_reset(model->labels);
|
LabelList_reset(model->labels);
|
||||||
|
IconList_reset(model->icons);
|
||||||
ButtonMatrix_reset(model->button_matrix);
|
ButtonMatrix_reset(model->button_matrix);
|
||||||
},
|
},
|
||||||
true);
|
true);
|
||||||
@ -208,9 +213,17 @@ static void button_panel_view_draw_callback(Canvas* canvas, void* _model) {
|
|||||||
canvas_clear(canvas);
|
canvas_clear(canvas);
|
||||||
canvas_set_color(canvas, ColorBlack);
|
canvas_set_color(canvas, ColorBlack);
|
||||||
|
|
||||||
|
for
|
||||||
|
M_EACH(icon, model->icons, IconList_t) {
|
||||||
|
canvas_draw_icon(canvas, icon->x, icon->y, icon->name);
|
||||||
|
}
|
||||||
|
|
||||||
for(size_t x = 0; x < model->reserve_x; ++x) {
|
for(size_t x = 0; x < model->reserve_x; ++x) {
|
||||||
for(size_t y = 0; y < model->reserve_y; ++y) {
|
for(size_t y = 0; y < model->reserve_y; ++y) {
|
||||||
ButtonItem* button_item = *button_panel_get_item(model, x, y);
|
ButtonItem* button_item = *button_panel_get_item(model, x, y);
|
||||||
|
if(!button_item) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
const Icon* icon_name = button_item->icon.name;
|
const Icon* icon_name = button_item->icon.name;
|
||||||
if((model->selected_item_x == x) && (model->selected_item_y == y)) {
|
if((model->selected_item_x == x) && (model->selected_item_y == y)) {
|
||||||
icon_name = button_item->icon.name_selected;
|
icon_name = button_item->icon.name_selected;
|
||||||
@ -406,3 +419,24 @@ void button_panel_add_label(
|
|||||||
},
|
},
|
||||||
true);
|
true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Draw an icon but don't make it a button.
|
||||||
|
void button_panel_add_icon(
|
||||||
|
ButtonPanel* button_panel,
|
||||||
|
uint16_t x,
|
||||||
|
uint16_t y,
|
||||||
|
const Icon* icon_name) {
|
||||||
|
furi_assert(button_panel);
|
||||||
|
|
||||||
|
with_view_model( //-V773
|
||||||
|
button_panel->view,
|
||||||
|
ButtonPanelModel * model,
|
||||||
|
{
|
||||||
|
IconElement* icon = IconList_push_raw(model->icons);
|
||||||
|
icon->x = x;
|
||||||
|
icon->y = y;
|
||||||
|
icon->name = icon_name;
|
||||||
|
icon->name_selected = icon_name;
|
||||||
|
},
|
||||||
|
true);
|
||||||
|
}
|
||||||
@ -100,6 +100,19 @@ void button_panel_add_label(
|
|||||||
Font font,
|
Font font,
|
||||||
const char* label_str);
|
const char* label_str);
|
||||||
|
|
||||||
|
/** Add a non-button icon to button_panel module.
|
||||||
|
*
|
||||||
|
* @param button_panel ButtonPanel instance
|
||||||
|
* @param x x-coordinate to place icon
|
||||||
|
* @param y y-coordinate to place icon
|
||||||
|
* @param icon_name name of the icon to draw
|
||||||
|
*/
|
||||||
|
void button_panel_add_icon(
|
||||||
|
ButtonPanel* button_panel,
|
||||||
|
uint16_t x,
|
||||||
|
uint16_t y,
|
||||||
|
const Icon* icon_name);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 9.3 KiB |
|
Before Width: | Height: | Size: 8.3 KiB |
|
Before Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 3.5 KiB |
BIN
assets/icons/Infrared/back_btn_10x8.png
Normal file
|
After Width: | Height: | Size: 141 B |
BIN
assets/icons/Infrared/celsius_24x23.png
Normal file
|
After Width: | Height: | Size: 257 B |
BIN
assets/icons/Infrared/celsius_hover_24x23.png
Normal file
|
After Width: | Height: | Size: 204 B |
|
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 2.9 KiB |
BIN
assets/icons/Infrared/ch_up_24x21.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
assets/icons/Infrared/ch_up_hover_24x21.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.7 KiB |
BIN
assets/icons/Infrared/dry_19x20.png
Normal file
|
After Width: | Height: | Size: 996 B |
BIN
assets/icons/Infrared/dry_hover_19x20.png
Normal file
|
After Width: | Height: | Size: 978 B |
BIN
assets/icons/Infrared/dry_text_15x5.png
Normal file
|
After Width: | Height: | Size: 968 B |
BIN
assets/icons/Infrared/fahren_24x23.png
Normal file
|
After Width: | Height: | Size: 258 B |
BIN
assets/icons/Infrared/fahren_hover_24x23.png
Normal file
|
After Width: | Height: | Size: 205 B |
|
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.7 KiB |
BIN
assets/icons/Infrared/hourglass0_24x24.png
Normal file
|
After Width: | Height: | Size: 231 B |
BIN
assets/icons/Infrared/hourglass1_24x24.png
Normal file
|
After Width: | Height: | Size: 246 B |
BIN
assets/icons/Infrared/hourglass2_24x24.png
Normal file
|
After Width: | Height: | Size: 237 B |
BIN
assets/icons/Infrared/hourglass3_24x24.png
Normal file
|
After Width: | Height: | Size: 223 B |
BIN
assets/icons/Infrared/hourglass4_24x24.png
Normal file
|
After Width: | Height: | Size: 239 B |
BIN
assets/icons/Infrared/hourglass5_24x24.png
Normal file
|
After Width: | Height: | Size: 218 B |
BIN
assets/icons/Infrared/hourglass6_24x24.png
Normal file
|
After Width: | Height: | Size: 238 B |
BIN
assets/icons/Infrared/max_24x23.png
Normal file
|
After Width: | Height: | Size: 224 B |
BIN
assets/icons/Infrared/max_hover_24x23.png
Normal file
|
After Width: | Height: | Size: 208 B |
BIN
assets/icons/Infrared/mute_19x20.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
assets/icons/Infrared/mute_hover_19x20.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
assets/icons/Infrared/mute_text_19x5.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
assets/icons/Infrared/next_19x20.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
assets/icons/Infrared/next_hover_19x20.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
assets/icons/Infrared/next_text_19x6.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
assets/icons/Infrared/pause_19x20.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
assets/icons/Infrared/pause_hover_19x20.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
assets/icons/Infrared/pause_text_23x5.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
assets/icons/Infrared/play_19x20.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 2.8 KiB |
BIN
assets/icons/Infrared/play_text_19x5.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
assets/icons/Infrared/power_19x20.png
Normal file
|
After Width: | Height: | Size: 1006 B |
BIN
assets/icons/Infrared/power_hover_19x20.png
Normal file
|
After Width: | Height: | Size: 996 B |
BIN
assets/icons/Infrared/power_text_24x5.png
Normal file
|
After Width: | Height: | Size: 981 B |
BIN
assets/icons/Infrared/prev_19x20.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
assets/icons/Infrared/prev_hover_19x20.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
assets/icons/Infrared/prev_text_19x5.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
assets/icons/Infrared/vol_ac_text_30x30.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
assets/icons/Infrared/vol_tv_text_29x34.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
assets/icons/Infrared/voldown_24x21.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
assets/icons/Infrared/voldown_hover_24x21.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
assets/icons/Infrared/volup_24x21.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
assets/icons/Infrared/volup_hover_24x21.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
@ -1,5 +1,5 @@
|
|||||||
entry,status,name,type,params
|
entry,status,name,type,params
|
||||||
Version,+,35.0,,
|
Version,+,35.1,,
|
||||||
Header,+,applications/services/bt/bt_service/bt.h,,
|
Header,+,applications/services/bt/bt_service/bt.h,,
|
||||||
Header,+,applications/services/cli/cli.h,,
|
Header,+,applications/services/cli/cli.h,,
|
||||||
Header,+,applications/services/cli/cli_vcp.h,,
|
Header,+,applications/services/cli/cli_vcp.h,,
|
||||||
@ -557,6 +557,7 @@ Function,+,button_menu_get_view,View*,ButtonMenu*
|
|||||||
Function,+,button_menu_reset,void,ButtonMenu*
|
Function,+,button_menu_reset,void,ButtonMenu*
|
||||||
Function,+,button_menu_set_header,void,"ButtonMenu*, const char*"
|
Function,+,button_menu_set_header,void,"ButtonMenu*, const char*"
|
||||||
Function,+,button_menu_set_selected_item,void,"ButtonMenu*, uint32_t"
|
Function,+,button_menu_set_selected_item,void,"ButtonMenu*, uint32_t"
|
||||||
|
Function,+,button_panel_add_icon,void,"ButtonPanel*, uint16_t, uint16_t, const Icon*"
|
||||||
Function,+,button_panel_add_item,void,"ButtonPanel*, uint32_t, uint16_t, uint16_t, uint16_t, uint16_t, const Icon*, const Icon*, ButtonItemCallback, void*"
|
Function,+,button_panel_add_item,void,"ButtonPanel*, uint32_t, uint16_t, uint16_t, uint16_t, uint16_t, const Icon*, const Icon*, ButtonItemCallback, void*"
|
||||||
Function,+,button_panel_add_label,void,"ButtonPanel*, uint16_t, uint16_t, Font, const char*"
|
Function,+,button_panel_add_label,void,"ButtonPanel*, uint16_t, uint16_t, Font, const char*"
|
||||||
Function,+,button_panel_alloc,ButtonPanel*,
|
Function,+,button_panel_alloc,ButtonPanel*,
|
||||||
|
|||||||
|
@ -1,5 +1,5 @@
|
|||||||
entry,status,name,type,params
|
entry,status,name,type,params
|
||||||
Version,+,35.0,,
|
Version,+,35.1,,
|
||||||
Header,+,applications/drivers/subghz/cc1101_ext/cc1101_ext_interconnect.h,,
|
Header,+,applications/drivers/subghz/cc1101_ext/cc1101_ext_interconnect.h,,
|
||||||
Header,+,applications/services/bt/bt_service/bt.h,,
|
Header,+,applications/services/bt/bt_service/bt.h,,
|
||||||
Header,+,applications/services/cli/cli.h,,
|
Header,+,applications/services/cli/cli.h,,
|
||||||
@ -618,6 +618,7 @@ Function,+,button_menu_get_view,View*,ButtonMenu*
|
|||||||
Function,+,button_menu_reset,void,ButtonMenu*
|
Function,+,button_menu_reset,void,ButtonMenu*
|
||||||
Function,+,button_menu_set_header,void,"ButtonMenu*, const char*"
|
Function,+,button_menu_set_header,void,"ButtonMenu*, const char*"
|
||||||
Function,+,button_menu_set_selected_item,void,"ButtonMenu*, uint32_t"
|
Function,+,button_menu_set_selected_item,void,"ButtonMenu*, uint32_t"
|
||||||
|
Function,+,button_panel_add_icon,void,"ButtonPanel*, uint16_t, uint16_t, const Icon*"
|
||||||
Function,+,button_panel_add_item,void,"ButtonPanel*, uint32_t, uint16_t, uint16_t, uint16_t, uint16_t, const Icon*, const Icon*, ButtonItemCallback, void*"
|
Function,+,button_panel_add_item,void,"ButtonPanel*, uint32_t, uint16_t, uint16_t, uint16_t, uint16_t, const Icon*, const Icon*, ButtonItemCallback, void*"
|
||||||
Function,+,button_panel_add_label,void,"ButtonPanel*, uint16_t, uint16_t, Font, const char*"
|
Function,+,button_panel_add_label,void,"ButtonPanel*, uint16_t, uint16_t, Font, const char*"
|
||||||
Function,+,button_panel_alloc,ButtonPanel*,
|
Function,+,button_panel_alloc,ButtonPanel*,
|
||||||
|
|||||||
|