summaryrefslogtreecommitdiff
path: root/src/app.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-04-27 11:59:28 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-04-27 11:59:28 +0300
commit9a7aa34e63132edb5906914ff99b861e64ee9099 (patch)
tree327e275b7f4fd6eb05150f7c03a87a72794d22a0 /src/app.c
parent170209cf926e2f714d507fefaa6b30fd245811ad (diff)
Refactor: Added a proper Root object
`Root` encapsulates the root widget and the associated UI state.
Diffstat (limited to 'src/app.c')
-rw-r--r--src/app.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/app.c b/src/app.c
index c4511dc7..cefb707d 100644
--- a/src/app.c
+++ b/src/app.c
@@ -1046,7 +1046,7 @@ void processEvents_App(enum iAppEventMode eventMode) {
1046 handleCommand_MacOS(command_UserEvent(&ev)); 1046 handleCommand_MacOS(command_UserEvent(&ev));
1047#endif 1047#endif
1048 if (isMetricsChange_UserEvent(&ev)) { 1048 if (isMetricsChange_UserEvent(&ev)) {
1049 arrange_Widget(d->window->root); 1049 arrange_Widget(d->window->root.widget);
1050 } 1050 }
1051 if (!wasUsed) { 1051 if (!wasUsed) {
1052 /* No widget handled the command, so we'll do it. */ 1052 /* No widget handled the command, so we'll do it. */
@@ -1131,7 +1131,7 @@ static int run_App_(iApp *d) {
1131 1131
1132void refresh_App(void) { 1132void refresh_App(void) {
1133 iApp *d = &app_; 1133 iApp *d = &app_;
1134 destroyPending_RootData(data_Root()); 1134 destroyPending_Root(&d->window->root);
1135#if defined (LAGRANGE_ENABLE_IDLE_SLEEP) 1135#if defined (LAGRANGE_ENABLE_IDLE_SLEEP)
1136 if (d->warmupFrames == 0 && d->isIdling) { 1136 if (d->warmupFrames == 0 && d->isIdling) {
1137 return; 1137 return;
@@ -1262,7 +1262,7 @@ void postCommandf_App(const char *command, ...) {
1262 1262
1263iAny *findWidget_App(const char *id) { 1263iAny *findWidget_App(const char *id) {
1264 if (!*id) return NULL; 1264 if (!*id) return NULL;
1265 return findChild_Widget(app_.window->root, id); 1265 return findChild_Widget(app_.window->root.widget, id);
1266} 1266}
1267 1267
1268void addTicker_App(iTickerFunc ticker, iAny *context) { 1268void addTicker_App(iTickerFunc ticker, iAny *context) {
@@ -2120,7 +2120,7 @@ iBool handleCommand_App(const char *cmd) {
2120 else if (equal_Command(cmd, "ident.import")) { 2120 else if (equal_Command(cmd, "ident.import")) {
2121 iCertImportWidget *imp = new_CertImportWidget(); 2121 iCertImportWidget *imp = new_CertImportWidget();
2122 setPageContent_CertImportWidget(imp, sourceContent_DocumentWidget(document_App())); 2122 setPageContent_CertImportWidget(imp, sourceContent_DocumentWidget(document_App()));
2123 addChild_Widget(d->window->root, iClob(imp)); 2123 addChild_Widget(d->window->root.widget, iClob(imp));
2124 finalizeSheet_Widget(as_Widget(imp)); 2124 finalizeSheet_Widget(as_Widget(imp));
2125 postRefresh_App(); 2125 postRefresh_App();
2126 return iTrue; 2126 return iTrue;