tap_outside_actions - properties in tool tips

commit_hash:cdd465f1a79e4a33d1fb3092125bb0a278659bf4
This commit is contained in:
xvegau
2025-04-28 17:39:44 +03:00
parent 65960ed372
commit 3b00a404b0
7 changed files with 455 additions and 3 deletions
@@ -1,5 +1,17 @@
{
"log_id": "snapshot_test_card",
"variables": [
{
"type": "string",
"name": "outside_actions_called",
"value": "false"
},
{
"type": "string",
"name": "non_modal_button_clicked",
"value": "false"
}
],
"states": [
{
"state_id": 0,
@@ -156,6 +168,227 @@
}
}
]
},
{
"type": "separator"
},
{
"type": "button",
"text": "tooltip with close_by_tap_outside: false",
"margins": {
"left": 10,
"top": 10,
"right": 10,
"bottom": 10
},
"tooltips": [
{
"id": "tooltip_1",
"position": "bottom",
"gravity": "bottom",
"close_by_tap_outside": false,
"duration": 0,
"offset": {
"x": {
"value": 0
},
"y": {
"value": 4
}
},
"div": {
"type": "text",
"text": "tooltip_text",
"text_color": "#2C3E50",
"background": [
{
"type": "solid",
"color": "#799eb7"
}
],
"paddings": {
"left": 16,
"top": 16,
"right": 16,
"bottom": 16
},
"border": {
"corner_radius": 6
}
}
}
],
"actions": [
{
"log_id": "show_tooltip",
"url": "div-action://show_tooltip?id=tooltip_1&multiple=true"
}
]
},
{
"type": "button",
"text": "tooltip with tap_outside_actions",
"margins": {
"left": 10,
"top": 10,
"right": 10,
"bottom": 10
},
"tooltips": [
{
"id": "tooltip_2",
"position": "bottom",
"gravity": "bottom",
"tap_outside_actions": [
{
"log_id": "outside_actions",
"typed": {
"type": "set_variable",
"variable_name": "outside_actions_called",
"value": {
"type": "string",
"value": "true"
}
}
}
],
"duration": 0,
"offset": {
"x": {
"value": 0
},
"y": {
"value": 4
}
},
"div": {
"type": "text",
"text": "tooltip_text",
"text_color": "#2C3E50",
"background": [
{
"type": "solid",
"color": "#799eb7"
}
],
"paddings": {
"left": 16,
"top": 16,
"right": 16,
"bottom": 16
},
"border": {
"corner_radius": 6
}
}
}
],
"actions": [
{
"log_id": "show_tooltip",
"url": "div-action://show_tooltip?id=tooltip_2&multiple=true"
}
]
},
{
"id": "tooltip_2_result",
"type": "text",
"text": "Outside actions called: @{outside_actions_called}",
"margins": {
"left": 10,
"top": 10,
"right": 10,
"bottom": 10
},
"text_color": "@{(outside_actions_called == 'true') ? '#00FF00' : '#000000'}"
},
{
"type": "container",
"orientation": "horizontal",
"margins": {
"left": 10,
"top": 10,
"right": 10,
"bottom": 10
},
"items": [
{
"type": "button",
"text": "tooltip mode = non_modal",
"gravity": "center",
"margins": {
"right": 10
},
"tooltips": [
{
"id": "tooltip_3",
"position": "top",
"gravity": "top",
"duration": 0,
"mode": {
"type": "non_modal"
},
"close_by_tap_outside": true,
"div": {
"type": "text",
"text": "tooltip_text",
"text_color": "#2C3E50",
"background": [
{
"type": "solid",
"color": "#799eb7"
}
],
"paddings": {
"left": 16,
"top": 16,
"right": 16,
"bottom": 16
},
"border": {
"corner_radius": 6
}
}
}
],
"actions": [
{
"log_id": "show_tooltip",
"url": "div-action://show_tooltip?id=tooltip_3&multiple=true"
}
]
},
{
"type": "button",
"text": "non modal test",
"gravity": "center",
"actions": [
{
"log_id": "non_modal_test",
"typed": {
"type": "set_variable",
"variable_name": "non_modal_button_clicked",
"value": {
"type": "string",
"value": "true"
}
}
}
]
}
]
},
{
"id": "non_modal_result",
"type": "text",
"text": "Non modal button clicked: @{non_modal_button_clicked}",
"margins": {
"left": 10,
"top": 10,
"right": 10,
"bottom": 10
},
"text_color": "@{(non_modal_button_clicked == 'true') ? '#00FF00' : '#000000'}"
}
]
}