Skip to content

Commit 2db7b4e

Browse files
committed
async operation in progress visuals changed
1 parent 828f7a7 commit 2db7b4e

31 files changed

+136336
-135869
lines changed

CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,7 @@ set(src_eez_gui_widgets
313313
src/eez/gui/widgets/list.cpp
314314
src/eez/gui/widgets/list_graph.cpp
315315
src/eez/gui/widgets/multiline_text.cpp
316+
src/eez/gui/widgets/progress.cpp
316317
src/eez/gui/widgets/rectangle.cpp
317318
src/eez/gui/widgets/scroll_bar.cpp
318319
src/eez/gui/widgets/select.cpp
@@ -335,6 +336,7 @@ set(header_eez_gui_widgets
335336
src/eez/gui/widgets/list.h
336337
src/eez/gui/widgets/list_graph.h
337338
src/eez/gui/widgets/multiline_text.h
339+
src/eez/gui/widgets/progress.h
338340
src/eez/gui/widgets/rectangle.h
339341
src/eez/gui/widgets/scroll_bar.h
340342
src/eez/gui/widgets/select.h

modular-psu-firmware.eez-project

+164-29
Original file line numberDiff line numberDiff line change
@@ -1354,11 +1354,6 @@
13541354
"type": "string",
13551355
"defaultValue": "0.pool.ntp.org"
13561356
},
1357-
{
1358-
"name": "async_operation_throbber",
1359-
"type": "string",
1360-
"defaultValue": "|"
1361-
},
13621357
{
13631358
"name": "sys_display_background_luminosity_step",
13641359
"type": "integer",
@@ -2204,6 +2199,27 @@
22042199
"name": "file_manager_file_has_description",
22052200
"type": "boolean",
22062201
"defaultValue": "1"
2202+
},
2203+
{
2204+
"name": "file_manager_image_open_state",
2205+
"type": "enum",
2206+
"enumItems": "[\n \"loading\",\n \"loaded\",\n \"failed\"\n]",
2207+
"defaultValue": "1"
2208+
},
2209+
{
2210+
"name": "file_manager_image_open_progress",
2211+
"type": "float",
2212+
"defaultValue": "33"
2213+
},
2214+
{
2215+
"name": "alert_message_is_set",
2216+
"type": "boolean",
2217+
"defaultValue": "1"
2218+
},
2219+
{
2220+
"name": "async_progress",
2221+
"type": "integer",
2222+
"defaultValue": "33"
22072223
}
22082224
],
22092225
"actions": [
@@ -9840,28 +9856,75 @@
98409856
"style": "async_operation",
98419857
"widgets": [
98429858
{
9843-
"type": "Text",
9859+
"type": "Select",
98449860
"style": {
9845-
"inheritFrom": "async_operation"
9861+
"inheritFrom": "default"
98469862
},
9847-
"data": "alert_message",
9863+
"data": "alert_message_is_set",
98489864
"left": 0,
98499865
"top": 14,
98509866
"width": 280,
9851-
"height": 32,
9852-
"text": ""
9853-
},
9854-
{
9855-
"type": "Text",
9856-
"style": {
9857-
"inheritFrom": "async_operation"
9858-
},
9859-
"data": "async_operation_throbber",
9860-
"left": 0,
9861-
"top": 46,
9862-
"width": 280,
9863-
"height": 28,
9864-
"text": ""
9867+
"height": 60,
9868+
"widgets": [
9869+
{
9870+
"type": "Container",
9871+
"style": {
9872+
"inheritFrom": "async_operation"
9873+
},
9874+
"left": 0,
9875+
"top": 0,
9876+
"width": 280,
9877+
"height": 60,
9878+
"widgets": [
9879+
{
9880+
"type": "Progress",
9881+
"style": {
9882+
"inheritFrom": "progress"
9883+
},
9884+
"data": "async_progress",
9885+
"left": 28,
9886+
"top": 28,
9887+
"width": 224,
9888+
"height": 4
9889+
}
9890+
]
9891+
},
9892+
{
9893+
"type": "Container",
9894+
"style": {
9895+
"inheritFrom": "async_operation"
9896+
},
9897+
"left": 0,
9898+
"top": 0,
9899+
"width": 280,
9900+
"height": 60,
9901+
"widgets": [
9902+
{
9903+
"type": "Text",
9904+
"style": {
9905+
"inheritFrom": "async_operation"
9906+
},
9907+
"data": "alert_message",
9908+
"left": 0,
9909+
"top": 0,
9910+
"width": 280,
9911+
"height": 32,
9912+
"text": ""
9913+
},
9914+
{
9915+
"type": "Progress",
9916+
"style": {
9917+
"inheritFrom": "progress"
9918+
},
9919+
"data": "async_progress",
9920+
"left": 28,
9921+
"top": 46,
9922+
"width": 224,
9923+
"height": 4
9924+
}
9925+
]
9926+
}
9927+
]
98659928
}
98669929
],
98679930
"left": 100,
@@ -43984,16 +44047,68 @@
4398444047
"style": "default",
4398544048
"widgets": [
4398644049
{
43987-
"type": "Bitmap",
44050+
"type": "Select",
4398844051
"style": {
4398944052
"inheritFrom": "default"
4399044053
},
43991-
"data": "file_manager_opened_image",
43992-
"action": "show_previous_page",
44054+
"data": "file_manager_image_open_state",
4399344055
"left": 0,
4399444056
"top": 0,
4399544057
"width": 480,
43996-
"height": 272
44058+
"height": 272,
44059+
"widgets": [
44060+
{
44061+
"type": "Container",
44062+
"style": {
44063+
"inheritFrom": "default"
44064+
},
44065+
"left": 0,
44066+
"top": 0,
44067+
"width": 480,
44068+
"height": 272,
44069+
"widgets": [
44070+
{
44071+
"type": "Progress",
44072+
"style": {
44073+
"inheritFrom": "progress"
44074+
},
44075+
"data": "file_manager_image_open_progress",
44076+
"left": 140,
44077+
"top": 132,
44078+
"width": 200,
44079+
"height": 4
44080+
}
44081+
]
44082+
},
44083+
{
44084+
"type": "Bitmap",
44085+
"style": {
44086+
"inheritFrom": "default"
44087+
},
44088+
"data": "file_manager_opened_image",
44089+
"action": "show_previous_page",
44090+
"left": 0,
44091+
"top": 0,
44092+
"width": 480,
44093+
"height": 272
44094+
},
44095+
{
44096+
"type": "Text",
44097+
"style": {
44098+
"inheritFrom": "default",
44099+
"font": "Oswald17",
44100+
"color": "status_warning",
44101+
"activeColor": "status_warning",
44102+
"activeBackgroundColor": "Background"
44103+
},
44104+
"action": "show_previous_page",
44105+
"left": 0,
44106+
"top": 0,
44107+
"width": 480,
44108+
"height": 272,
44109+
"text": "Failed to load image!"
44110+
}
44111+
]
4399744112
}
4399844113
],
4399944114
"left": 0,
@@ -49887,6 +50002,14 @@
4988750002
"inheritFrom": "edit_value_S_centered_status_line",
4988850003
"font": "RobotoCondensed-Regular",
4988950004
"focusBackgroundColor": "Action color"
50005+
},
50006+
{
50007+
"name": "progress",
50008+
"inheritFrom": "default",
50009+
"color": "progress",
50010+
"backgroundColor": "progress_background",
50011+
"activeColor": "progress_background",
50012+
"activeBackgroundColor": "progress"
4989050013
}
4989150014
],
4989250015
"fonts": [
@@ -531542,6 +531665,12 @@
531542531665
},
531543531666
{
531544531667
"name": "loading"
531668+
},
531669+
{
531670+
"name": "progress"
531671+
},
531672+
{
531673+
"name": "progress_background"
531545531674
}
531546531675
],
531547531676
"themes": [
@@ -531601,7 +531730,9 @@
531601531730
"#1d68ab",
531602531731
"#ab1d81",
531603531732
"#e0e0e0",
531604-
"#093dc9"
531733+
"#093dc9",
531734+
"#202020",
531735+
"#c0c0c0"
531605531736
]
531606531737
},
531607531738
{
@@ -531660,7 +531791,9 @@
531660531791
"#1d68ab",
531661531792
"#ab1d81",
531662531793
"#000000",
531663-
"#e0e0e0"
531794+
"#e0e0e0",
531795+
"#202020",
531796+
"#c0c0c0"
531664531797
]
531665531798
},
531666531799
{
@@ -531719,7 +531852,9 @@
531719531852
"#1d68ab",
531720531853
"#ab1d81",
531721531854
"#e0e0e0",
531722-
"#202020"
531855+
"#202020",
531856+
"#d0d0d0",
531857+
"#606060"
531723531858
]
531724531859
}
531725531860
]

src/eez/gui/app_context.cpp

+1-8
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,6 @@ void AppContext::stateManagment() {
5353
popPage();
5454
}
5555
}
56-
57-
// call m_checkAsyncOperationStatus
58-
if (getActivePageId() == PAGE_ID_ASYNC_OPERATION_IN_PROGRESS) {
59-
if (m_checkAsyncOperationStatus) {
60-
m_checkAsyncOperationStatus();
61-
}
62-
}
6356
}
6457

6558
////////////////////////////////////////////////////////////////////////////////
@@ -171,7 +164,7 @@ void AppContext::pushPage(int pageId, Page *page) {
171164
int previousPageId = getActivePageId();
172165

173166
// advance stack pointre
174-
if (getActivePageId() != PAGE_ID_NONE) {
167+
if (getActivePageId() != PAGE_ID_NONE && getActivePageId() != PAGE_ID_ASYNC_OPERATION_IN_PROGRESS) {
175168
m_pageNavigationStackPointer++;
176169
assert (m_pageNavigationStackPointer < CONF_GUI_PAGE_NAVIGATION_STACK_SIZE);
177170
}

src/eez/gui/app_context.h

-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ class AppContext {
5050
void(*m_toastAction)(int param);
5151
int m_toastActionParam;
5252
void(*m_toastActionWithoutParam)();
53-
void (*m_checkAsyncOperationStatus)();
5453

5554
virtual void stateManagment();
5655

src/eez/gui/assets.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ static FixWidgetPointersFunction g_fixWidgetPointersFunctions[] = {
146146
nullptr, // WIDGET_TYPE_LIST_GRAPH
147147
nullptr, // WIDGET_TYPE_APP_VIEW
148148
ScrollBarWidget_fixPointers, // WIDGET_TYPE_SCROLL_BAR
149+
nullptr, // WIDGET_TYPE_SCROLL_BAR
149150
};
150151

151152
void Widget_fixPointers(Widget *widget) {

0 commit comments

Comments
 (0)