Skip to content

Commit

Permalink
async operation in progress visuals changed
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed Mar 16, 2020
1 parent 828f7a7 commit 2db7b4e
Show file tree
Hide file tree
Showing 31 changed files with 136,336 additions and 135,869 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ set(src_eez_gui_widgets
src/eez/gui/widgets/list.cpp
src/eez/gui/widgets/list_graph.cpp
src/eez/gui/widgets/multiline_text.cpp
src/eez/gui/widgets/progress.cpp
src/eez/gui/widgets/rectangle.cpp
src/eez/gui/widgets/scroll_bar.cpp
src/eez/gui/widgets/select.cpp
Expand All @@ -335,6 +336,7 @@ set(header_eez_gui_widgets
src/eez/gui/widgets/list.h
src/eez/gui/widgets/list_graph.h
src/eez/gui/widgets/multiline_text.h
src/eez/gui/widgets/progress.h
src/eez/gui/widgets/rectangle.h
src/eez/gui/widgets/scroll_bar.h
src/eez/gui/widgets/select.h
Expand Down
193 changes: 164 additions & 29 deletions modular-psu-firmware.eez-project
Original file line number Diff line number Diff line change
Expand Up @@ -1354,11 +1354,6 @@
"type": "string",
"defaultValue": "0.pool.ntp.org"
},
{
"name": "async_operation_throbber",
"type": "string",
"defaultValue": "|"
},
{
"name": "sys_display_background_luminosity_step",
"type": "integer",
Expand Down Expand Up @@ -2204,6 +2199,27 @@
"name": "file_manager_file_has_description",
"type": "boolean",
"defaultValue": "1"
},
{
"name": "file_manager_image_open_state",
"type": "enum",
"enumItems": "[\n \"loading\",\n \"loaded\",\n \"failed\"\n]",
"defaultValue": "1"
},
{
"name": "file_manager_image_open_progress",
"type": "float",
"defaultValue": "33"
},
{
"name": "alert_message_is_set",
"type": "boolean",
"defaultValue": "1"
},
{
"name": "async_progress",
"type": "integer",
"defaultValue": "33"
}
],
"actions": [
Expand Down Expand Up @@ -9840,28 +9856,75 @@
"style": "async_operation",
"widgets": [
{
"type": "Text",
"type": "Select",
"style": {
"inheritFrom": "async_operation"
"inheritFrom": "default"
},
"data": "alert_message",
"data": "alert_message_is_set",
"left": 0,
"top": 14,
"width": 280,
"height": 32,
"text": ""
},
{
"type": "Text",
"style": {
"inheritFrom": "async_operation"
},
"data": "async_operation_throbber",
"left": 0,
"top": 46,
"width": 280,
"height": 28,
"text": ""
"height": 60,
"widgets": [
{
"type": "Container",
"style": {
"inheritFrom": "async_operation"
},
"left": 0,
"top": 0,
"width": 280,
"height": 60,
"widgets": [
{
"type": "Progress",
"style": {
"inheritFrom": "progress"
},
"data": "async_progress",
"left": 28,
"top": 28,
"width": 224,
"height": 4
}
]
},
{
"type": "Container",
"style": {
"inheritFrom": "async_operation"
},
"left": 0,
"top": 0,
"width": 280,
"height": 60,
"widgets": [
{
"type": "Text",
"style": {
"inheritFrom": "async_operation"
},
"data": "alert_message",
"left": 0,
"top": 0,
"width": 280,
"height": 32,
"text": ""
},
{
"type": "Progress",
"style": {
"inheritFrom": "progress"
},
"data": "async_progress",
"left": 28,
"top": 46,
"width": 224,
"height": 4
}
]
}
]
}
],
"left": 100,
Expand Down Expand Up @@ -43984,16 +44047,68 @@
"style": "default",
"widgets": [
{
"type": "Bitmap",
"type": "Select",
"style": {
"inheritFrom": "default"
},
"data": "file_manager_opened_image",
"action": "show_previous_page",
"data": "file_manager_image_open_state",
"left": 0,
"top": 0,
"width": 480,
"height": 272
"height": 272,
"widgets": [
{
"type": "Container",
"style": {
"inheritFrom": "default"
},
"left": 0,
"top": 0,
"width": 480,
"height": 272,
"widgets": [
{
"type": "Progress",
"style": {
"inheritFrom": "progress"
},
"data": "file_manager_image_open_progress",
"left": 140,
"top": 132,
"width": 200,
"height": 4
}
]
},
{
"type": "Bitmap",
"style": {
"inheritFrom": "default"
},
"data": "file_manager_opened_image",
"action": "show_previous_page",
"left": 0,
"top": 0,
"width": 480,
"height": 272
},
{
"type": "Text",
"style": {
"inheritFrom": "default",
"font": "Oswald17",
"color": "status_warning",
"activeColor": "status_warning",
"activeBackgroundColor": "Background"
},
"action": "show_previous_page",
"left": 0,
"top": 0,
"width": 480,
"height": 272,
"text": "Failed to load image!"
}
]
}
],
"left": 0,
Expand Down Expand Up @@ -49887,6 +50002,14 @@
"inheritFrom": "edit_value_S_centered_status_line",
"font": "RobotoCondensed-Regular",
"focusBackgroundColor": "Action color"
},
{
"name": "progress",
"inheritFrom": "default",
"color": "progress",
"backgroundColor": "progress_background",
"activeColor": "progress_background",
"activeBackgroundColor": "progress"
}
],
"fonts": [
Expand Down Expand Up @@ -531542,6 +531665,12 @@
},
{
"name": "loading"
},
{
"name": "progress"
},
{
"name": "progress_background"
}
],
"themes": [
Expand Down Expand Up @@ -531601,7 +531730,9 @@
"#1d68ab",
"#ab1d81",
"#e0e0e0",
"#093dc9"
"#093dc9",
"#202020",
"#c0c0c0"
]
},
{
Expand Down Expand Up @@ -531660,7 +531791,9 @@
"#1d68ab",
"#ab1d81",
"#000000",
"#e0e0e0"
"#e0e0e0",
"#202020",
"#c0c0c0"
]
},
{
Expand Down Expand Up @@ -531719,7 +531852,9 @@
"#1d68ab",
"#ab1d81",
"#e0e0e0",
"#202020"
"#202020",
"#d0d0d0",
"#606060"
]
}
]
Expand Down
9 changes: 1 addition & 8 deletions src/eez/gui/app_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,6 @@ void AppContext::stateManagment() {
popPage();
}
}

// call m_checkAsyncOperationStatus
if (getActivePageId() == PAGE_ID_ASYNC_OPERATION_IN_PROGRESS) {
if (m_checkAsyncOperationStatus) {
m_checkAsyncOperationStatus();
}
}
}

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

// advance stack pointre
if (getActivePageId() != PAGE_ID_NONE) {
if (getActivePageId() != PAGE_ID_NONE && getActivePageId() != PAGE_ID_ASYNC_OPERATION_IN_PROGRESS) {
m_pageNavigationStackPointer++;
assert (m_pageNavigationStackPointer < CONF_GUI_PAGE_NAVIGATION_STACK_SIZE);
}
Expand Down
1 change: 0 additions & 1 deletion src/eez/gui/app_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ class AppContext {
void(*m_toastAction)(int param);
int m_toastActionParam;
void(*m_toastActionWithoutParam)();
void (*m_checkAsyncOperationStatus)();

virtual void stateManagment();

Expand Down
1 change: 1 addition & 0 deletions src/eez/gui/assets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ static FixWidgetPointersFunction g_fixWidgetPointersFunctions[] = {
nullptr, // WIDGET_TYPE_LIST_GRAPH
nullptr, // WIDGET_TYPE_APP_VIEW
ScrollBarWidget_fixPointers, // WIDGET_TYPE_SCROLL_BAR
nullptr, // WIDGET_TYPE_SCROLL_BAR
};

void Widget_fixPointers(Widget *widget) {
Expand Down
Loading

0 comments on commit 2db7b4e

Please sign in to comment.