summaryrefslogtreecommitdiff
path: root/src/ui/root.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-09-19 13:28:58 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-09-19 13:28:58 +0300
commit81007a2debffebc97c230cd810fb1bf10760180f (patch)
tree80639ed9d2723b397710cafd3de1a479ef400d02 /src/ui/root.c
parentb131ffbc42d66d7668844f12d7b24ddcf1a5c176 (diff)
Refactoring Window to split off MainWindow
MainWindow represents (one of) the main windows of the app, while the basic Window will be a used for popups. Only MainWindow supports split view modes.
Diffstat (limited to 'src/ui/root.c')
-rw-r--r--src/ui/root.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/ui/root.c b/src/ui/root.c
index 6ea5f521..52a08eca 100644
--- a/src/ui/root.c
+++ b/src/ui/root.c
@@ -383,18 +383,18 @@ static iBool handleRootCommands_(iWidget *root, const char *cmd) {
383 else if (equal_Command(cmd, "window.setrect")) { 383 else if (equal_Command(cmd, "window.setrect")) {
384 const int snap = argLabel_Command(cmd, "snap"); 384 const int snap = argLabel_Command(cmd, "snap");
385 if (snap) { 385 if (snap) {
386 iWindow *window = get_Window(); 386 iMainWindow *window = get_MainWindow();
387 iInt2 coord = coord_Command(cmd); 387 iInt2 coord = coord_Command(cmd);
388 iInt2 size = init_I2(argLabel_Command(cmd, "width"), 388 iInt2 size = init_I2(argLabel_Command(cmd, "width"),
389 argLabel_Command(cmd, "height")); 389 argLabel_Command(cmd, "height"));
390 SDL_SetWindowPosition(window->win, coord.x, coord.y); 390 SDL_SetWindowPosition(window->base.win, coord.x, coord.y);
391 SDL_SetWindowSize(window->win, size.x, size.y); 391 SDL_SetWindowSize(window->base.win, size.x, size.y);
392 window->place.snap = snap; 392 window->place.snap = snap;
393 return iTrue; 393 return iTrue;
394 } 394 }
395 } 395 }
396 else if (equal_Command(cmd, "window.restore")) { 396 else if (equal_Command(cmd, "window.restore")) {
397 setSnap_Window(get_Window(), none_WindowSnap); 397 setSnap_MainWindow(get_MainWindow(), none_WindowSnap);
398 return iTrue; 398 return iTrue;
399 } 399 }
400 else if (equal_Command(cmd, "window.minimize")) { 400 else if (equal_Command(cmd, "window.minimize")) {
@@ -1525,5 +1525,5 @@ iRect safeRect_Root(const iRoot *d) {
1525} 1525}
1526 1526
1527iInt2 visibleSize_Root(const iRoot *d) { 1527iInt2 visibleSize_Root(const iRoot *d) {
1528 return addY_I2(size_Root(d), -get_Window()->keyboardHeight); 1528 return addY_I2(size_Root(d), -get_MainWindow()->keyboardHeight);
1529} 1529}