[FL-867] GUI: ViewPort arrangement API, better input and draw dispatching (#333)

* Input: refactoring, platform agnostic key configuration, update usage across project. Minor queue usage fixes and tick timings.
* Gui: lighter and more efficient input and draw call dispatching, ViewPort rearranging API. View: conditional model updates, API usage update.
* BT: smaller update delay
* GUI: ViewPort visibility check
This commit is contained in:
あく
2021-02-10 12:06:29 +03:00
committed by GitHub
parent 928bca4eaa
commit 2d09b8e318
18 changed files with 299 additions and 199 deletions

View File

@@ -94,6 +94,7 @@ static bool dialog_ex_view_input_callback(InputEvent* event, void* context) {
left_text = model->left_text;
center_text = model->center_text;
right_text = model->right_text;
return true;
});
// Process key presses only
@@ -142,6 +143,8 @@ DialogEx* dialog_ex_alloc() {
model->left_text = NULL;
model->center_text = NULL;
model->right_text = NULL;
return true;
});
return dialog_ex;
}
@@ -182,6 +185,7 @@ void dialog_ex_set_header(
model->header.y = y;
model->header.horizontal = horizontal;
model->header.vertical = vertical;
return true;
});
}
@@ -200,6 +204,7 @@ void dialog_ex_set_text(
model->text.y = y;
model->text.horizontal = horizontal;
model->text.vertical = vertical;
return true;
});
}
@@ -210,23 +215,33 @@ void dialog_ex_set_icon(DialogEx* dialog_ex, int8_t x, int8_t y, IconName name)
model->icon.x = x;
model->icon.y = y;
model->icon.name = name;
return true;
});
}
void dialog_ex_set_left_button_text(DialogEx* dialog_ex, const char* text) {
furi_assert(dialog_ex);
with_view_model(
dialog_ex->view, (DialogExModel * model) { model->left_text = text; });
dialog_ex->view, (DialogExModel * model) {
model->left_text = text;
return true;
});
}
void dialog_ex_set_center_button_text(DialogEx* dialog_ex, const char* text) {
furi_assert(dialog_ex);
with_view_model(
dialog_ex->view, (DialogExModel * model) { model->center_text = text; });
dialog_ex->view, (DialogExModel * model) {
model->center_text = text;
return true;
});
}
void dialog_ex_set_right_button_text(DialogEx* dialog_ex, const char* text) {
furi_assert(dialog_ex);
with_view_model(
dialog_ex->view, (DialogExModel * model) { model->right_text = text; });
dialog_ex->view, (DialogExModel * model) {
model->right_text = text;
return true;
});
}