Additional custom button on Home page

Solves #1257
This commit is contained in:
Edward Firmo
2023-12-08 02:13:55 +01:00
parent ceb669dfc8
commit 336698cb72
12 changed files with 122 additions and 1 deletions

View File

@@ -498,6 +498,7 @@ api:
bg: int[]
icon: string
icon_color: int[]
icon_font: int
bri: string
bri_color: int[]
label: string
@@ -510,6 +511,7 @@ api:
std::string btntext = id.c_str() + std::string("text");
std::string btnbri = id.c_str() + std::string("bri");
disp1->send_command_printf("%spic.pic=%" PRIu32, id.c_str(), pic);
disp1->send_command_printf("%sicon.font=%" PRIu32, id.c_str(), icon_font);
set_component_color->execute(btnicon.c_str(), icon_color, bg);
set_component_color->execute(btntext.c_str(), label_color, bg);
set_component_color->execute(btnbri.c_str(), bri_color, bg);

Binary file not shown.

View File

@@ -436,6 +436,34 @@ Text button03
printh FF FF FF
}
Text button04
Attributes
ID : 46
Scope : global
Dragging : 0
Send Component ID : on press and release
Associated Keyboard: none
Text :
Max. Text Size : 3
Events
Touch Press Event
click_comp.txt="button04"
click_timer.en=1
Touch Release Event
if(click_timer.en==1)
{
click_timer.en=0
lastclick.txt="{\"page\": \"home\", \"event\": \"short_click\", \"component\": \""+click_comp.txt+"\"}"
printh 92
prints "localevent",0
printh 00
prints lastclick.txt,0
printh 00
printh FF FF FF
}
Picture weather
Attributes
ID : 7

Binary file not shown.

View File

@@ -436,6 +436,34 @@ Text button03
printh FF FF FF
}
Text button04
Attributes
ID : 46
Scope : global
Dragging : 0
Send Component ID : on press and release
Associated Keyboard: none
Text :
Max. Text Size : 3
Events
Touch Press Event
click_comp.txt="button04"
click_timer.en=1
Touch Release Event
if(click_timer.en==1)
{
click_timer.en=0
lastclick.txt="{\"page\": \"home\", \"event\": \"short_click\", \"component\": \""+click_comp.txt+"\"}"
printh 92
prints "localevent",0
printh 00
prints lastclick.txt,0
printh 00
printh FF FF FF
}
Picture weather
Attributes
ID : 7

Binary file not shown.

View File

@@ -436,6 +436,34 @@ Text button03
printh FF FF FF
}
Text button04
Attributes
ID : 46
Scope : global
Dragging : 0
Send Component ID : on press and release
Associated Keyboard: none
Text :
Max. Text Size : 3
Events
Touch Press Event
click_comp.txt="button04"
click_timer.en=1
Touch Release Event
if(click_timer.en==1)
{
click_timer.en=0
lastclick.txt="{\"page\": \"home\", \"event\": \"short_click\", \"component\": \""+click_comp.txt+"\"}"
printh 92
prints "localevent",0
printh 00
prints lastclick.txt,0
printh 00
printh FF FF FF
}
Picture weather
Attributes
ID : 7