diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-04-30 12:17:07 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-04-30 12:17:07 +0300 |
commit | 1495d08163a4bfcd5db5f6c3b06f031032c5461f (patch) | |
tree | 7538e5ca6f054afd292ca9c4b7b7ff81a3d1222f /src/ui/window.c | |
parent | fed2b149aeb5c5cd692421602e0fe77ceffb8b28 (diff) |
Revising and fixing widget layout
Some of the logic for arranging widgets was invalid, leading to problems with the navbar:
- cannot resize children if own size depends on their size
- expanding children won't expand unless resizing all children
Diffstat (limited to 'src/ui/window.c')
-rw-r--r-- | src/ui/window.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ui/window.c b/src/ui/window.c index 9ac9b918..704e6f2a 100644 --- a/src/ui/window.c +++ b/src/ui/window.c | |||
@@ -471,6 +471,7 @@ void init_Window(iWindow *d, iRect rect) { | |||
471 | d->frameTime = SDL_GetTicks(); | 471 | d->frameTime = SDL_GetTicks(); |
472 | d->loadAnimTimer = 0; | 472 | d->loadAnimTimer = 0; |
473 | init_Text(d->render); | 473 | init_Text(d->render); |
474 | SDL_GetRendererOutputSize(d->render, &d->size.x, &d->size.y); | ||
474 | setupUserInterface_Window(d); | 475 | setupUserInterface_Window(d); |
475 | postCommand_App("~bindings.changed"); /* update from bindings */ | 476 | postCommand_App("~bindings.changed"); /* update from bindings */ |
476 | updateSize_Window_(d, iFalse); | 477 | updateSize_Window_(d, iFalse); |
@@ -1175,6 +1176,7 @@ void setSplitMode_Window(iWindow *d, int splitMode) { | |||
1175 | iAssert(d->roots[1] == NULL); | 1176 | iAssert(d->roots[1] == NULL); |
1176 | d->roots[1] = new_Root(); | 1177 | d->roots[1] = new_Root(); |
1177 | setCurrent_Root(d->roots[1]); | 1178 | setCurrent_Root(d->roots[1]); |
1179 | d->keyRoot = d->roots[1]; | ||
1178 | createUserInterface_Root(d->roots[1]); | 1180 | createUserInterface_Root(d->roots[1]); |
1179 | /* If the old root has multiple tabs, move the current one to the new split. */ { | 1181 | /* If the old root has multiple tabs, move the current one to the new split. */ { |
1180 | iWidget *docTabs0 = findChild_Widget(d->roots[0]->widget, "doctabs"); | 1182 | iWidget *docTabs0 = findChild_Widget(d->roots[0]->widget, "doctabs"); |
@@ -1186,7 +1188,8 @@ void setSplitMode_Window(iWindow *d, int splitMode) { | |||
1186 | iRelease(removeTabPage_Widget(docTabs1, 0)); /* delete the default tab */ | 1188 | iRelease(removeTabPage_Widget(docTabs1, 0)); /* delete the default tab */ |
1187 | setRoot_Widget(as_Widget(moved), d->roots[1]); | 1189 | setRoot_Widget(as_Widget(moved), d->roots[1]); |
1188 | prependTabPage_Widget(docTabs1, iClob(moved), "", 0, 0); | 1190 | prependTabPage_Widget(docTabs1, iClob(moved), "", 0, 0); |
1189 | showTabPage_Widget(docTabs1, as_Widget(moved)); | 1191 | //showTabPage_Widget(docTabs1, as_Widget(moved)); |
1192 | postCommandf_App("tabs.switch page:%p", moved); | ||
1190 | } | 1193 | } |
1191 | else { | 1194 | else { |
1192 | postCommand_Root(d->roots[1], "navigate.home"); | 1195 | postCommand_Root(d->roots[1], "navigate.home"); |