Mercurial > dwindows
comparison ios/dw.m @ 2673:a39e2ea6fa14
iOS: Only add the "Back" button to the Navigation Bar if the window has the
DW_FCF_CLOSEBUTTON style, so it works like Android and generally like the
other platforms... the "Back" button is equivalent to the close button.
Also remove some more unicode from mobile.txt.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Mon, 18 Oct 2021 13:29:55 +0000 |
parents | 76d876c441c9 |
children | dd0b29320a3d |
comparison
equal
deleted
inserted
replaced
2672:d2c3b17a4ddf | 2673:a39e2ea6fa14 |
---|---|
8072 { | 8072 { |
8073 NSInteger sbheight = [[[window windowScene] statusBarManager] statusBarFrame].size.height; | 8073 NSInteger sbheight = [[[window windowScene] statusBarManager] statusBarFrame].size.height; |
8074 UINavigationBar* navbar = [[UINavigationBar alloc] initWithFrame:CGRectMake(0, sbheight, screenrect.size.width, 40)]; | 8074 UINavigationBar* navbar = [[UINavigationBar alloc] initWithFrame:CGRectMake(0, sbheight, screenrect.size.width, 40)]; |
8075 UINavigationItem* navItem = [[UINavigationItem alloc] initWithTitle:nstitle]; | 8075 UINavigationItem* navItem = [[UINavigationItem alloc] initWithTitle:nstitle]; |
8076 | 8076 |
8077 /* We maintain a list of top-level windows... | 8077 /* We maintain a list of top-level windows...If there is more than one window, |
8078 * If there is more than one window, add a Back button that will close it. | 8078 * and our window has the close button style, add a Back button that will close it. |
8079 */ | 8079 */ |
8080 if([_dw_toplevel_windows count] > 1) | 8080 if([_dw_toplevel_windows count] > 1 && flStyle & DW_FCF_CLOSEBUTTON) |
8081 { | 8081 { |
8082 UIBarButtonItem *back = [[UIBarButtonItem alloc] initWithTitle:@"Back" | 8082 UIBarButtonItem *back = [[UIBarButtonItem alloc] initWithTitle:@"Back" |
8083 style:UIBarButtonItemStylePlain | 8083 style:UIBarButtonItemStylePlain |
8084 target:window | 8084 target:window |
8085 action:@selector(closeWindow:)]; | 8085 action:@selector(closeWindow:)]; |