summaryrefslogtreecommitdiff
path: root/src/ios.m
diff options
context:
space:
mode:
Diffstat (limited to 'src/ios.m')
-rw-r--r--src/ios.m20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/ios.m b/src/ios.m
index 6e2fa64b..a1654df2 100644
--- a/src/ios.m
+++ b/src/ios.m
@@ -196,7 +196,7 @@ didPickDocumentsAtURLs:(NSArray<NSURL *> *)urls {
196 CGRect keyboardFrame = [view convertRect:rawFrame fromView:nil]; 196 CGRect keyboardFrame = [view convertRect:rawFrame fromView:nil];
197// NSLog(@"keyboardFrame: %@", NSStringFromCGRect(keyboardFrame)); 197// NSLog(@"keyboardFrame: %@", NSStringFromCGRect(keyboardFrame));
198 iWindow *window = get_Window(); 198 iWindow *window = get_Window();
199 const iInt2 rootSize = rootSize_Window(window); 199 const iInt2 rootSize = size_Root(window->roots[0]);
200 const int keyTop = keyboardFrame.origin.y * window->pixelRatio; 200 const int keyTop = keyboardFrame.origin.y * window->pixelRatio;
201 setKeyboardHeight_Window(window, rootSize.y - keyTop); 201 setKeyboardHeight_Window(window, rootSize.y - keyTop);
202} 202}
@@ -302,6 +302,24 @@ iBool processEvent_iOS(const SDL_Event *ev) {
302 postCommandf_App("os.theme.changed dark:%d contrast:1", isSystemDarkMode_ ? 1 : 0); 302 postCommandf_App("os.theme.changed dark:%d contrast:1", isSystemDarkMode_ ? 1 : 0);
303 } 303 }
304 } 304 }
305 else if (equal_Command(cmd, "theme.changed")) {
306 if (@available(iOS 13.0, *)) {
307 /* SDL doesn't expose this as a setting, so we'll rely on a hack.
308 Adding an SDL hint for this would be a cleaner solution than calling
309 a private method. */
310 UIViewController *vc = viewController_(get_Window());
311 SEL sel = NSSelectorFromString(@"setStatusStyle:"); /* custom method */
312 if ([vc respondsToSelector:sel]) {
313 NSInvocation *call = [NSInvocation invocationWithMethodSignature:
314 [NSMethodSignature signatureWithObjCTypes:"v@:i"]];
315 [call setSelector:sel];
316 int style = isDark_ColorTheme(colorTheme_App()) ?
317 UIStatusBarStyleLightContent : UIStatusBarStyleDarkContent;
318 [call setArgument:&style atIndex:2];
319 [call invokeWithTarget:vc];
320 }
321 }
322 }
305 } 323 }
306 return iFalse; /* allow normal processing */ 324 return iFalse; /* allow normal processing */
307} 325}