summaryrefslogtreecommitdiff
path: root/src/app.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/app.c')
-rw-r--r--src/app.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/app.c b/src/app.c
index b799b627..cf8a7119 100644
--- a/src/app.c
+++ b/src/app.c
@@ -139,7 +139,8 @@ const iString *dateStr_(const iDate *date) {
139 139
140static iString *serializePrefs_App_(const iApp *d) { 140static iString *serializePrefs_App_(const iApp *d) {
141 iString *str = new_String(); 141 iString *str = new_String();
142 const iSidebarWidget *sidebar = findWidget_App("sidebar"); 142 const iSidebarWidget *sidebar = findWidget_App("sidebar");
143 const iSidebarWidget *sidebar2 = findWidget_App("sidebar2");
143 appendFormat_String(str, "window.retain arg:%d\n", d->prefs.retainWindowSize); 144 appendFormat_String(str, "window.retain arg:%d\n", d->prefs.retainWindowSize);
144 if (d->prefs.retainWindowSize) { 145 if (d->prefs.retainWindowSize) {
145 const iBool isMaximized = (SDL_GetWindowFlags(d->window->win) & SDL_WINDOW_MAXIMIZED) != 0; 146 const iBool isMaximized = (SDL_GetWindowFlags(d->window->win) & SDL_WINDOW_MAXIMIZED) != 0;
@@ -150,6 +151,7 @@ static iString *serializePrefs_App_(const iApp *d) {
150 h = d->window->lastRect.size.y; 151 h = d->window->lastRect.size.y;
151 appendFormat_String(str, "window.setrect width:%d height:%d coord:%d %d\n", w, h, x, y); 152 appendFormat_String(str, "window.setrect width:%d height:%d coord:%d %d\n", w, h, x, y);
152 appendFormat_String(str, "sidebar.width arg:%d\n", width_SidebarWidget(sidebar)); 153 appendFormat_String(str, "sidebar.width arg:%d\n", width_SidebarWidget(sidebar));
154 appendFormat_String(str, "sidebar2.width arg:%d\n", width_SidebarWidget(sidebar2));
153 /* On macOS, maximization should be applied at creation time or the window will take 155 /* On macOS, maximization should be applied at creation time or the window will take
154 a moment to animate to its maximized size. */ 156 a moment to animate to its maximized size. */
155#if !defined (iPlatformApple) 157#if !defined (iPlatformApple)
@@ -160,10 +162,16 @@ static iString *serializePrefs_App_(const iApp *d) {
160 iUnused(isMaximized); 162 iUnused(isMaximized);
161#endif 163#endif
162 } 164 }
163 if (isVisible_Widget(sidebar)) { 165 /* Sidebars. */ {
164 appendCStr_String(str, "sidebar.toggle\n"); 166 if (isVisible_Widget(sidebar)) {
167 appendCStr_String(str, "sidebar.toggle\n");
168 }
169 appendFormat_String(str, "sidebar.mode arg:%d\n", mode_SidebarWidget(sidebar));
170 if (isVisible_Widget(sidebar2)) {
171 appendCStr_String(str, "sidebar2.toggle\n");
172 }
173 appendFormat_String(str, "sidebar2.mode arg:%d\n", mode_SidebarWidget(sidebar2));
165 } 174 }
166 appendFormat_String(str, "sidebar.mode arg:%d\n", mode_SidebarWidget(sidebar));
167 appendFormat_String(str, "uiscale arg:%f\n", uiScale_Window(d->window)); 175 appendFormat_String(str, "uiscale arg:%f\n", uiScale_Window(d->window));
168 appendFormat_String(str, "prefs.dialogtab arg:%d\n", d->prefs.dialogTab); 176 appendFormat_String(str, "prefs.dialogtab arg:%d\n", d->prefs.dialogTab);
169 appendFormat_String(str, "font.set arg:%d\n", d->prefs.font); 177 appendFormat_String(str, "font.set arg:%d\n", d->prefs.font);