diff options
Diffstat (limited to 'UICaboodle')
-rw-r--r-- | UICaboodle/BrowserView.m | 4 | ||||
-rw-r--r-- | UICaboodle/RVBook.mm | 21 |
2 files changed, 17 insertions, 8 deletions
diff --git a/UICaboodle/BrowserView.m b/UICaboodle/BrowserView.m index 61a21c9..6fe74f4 100644 --- a/UICaboodle/BrowserView.m +++ b/UICaboodle/BrowserView.m @@ -376,7 +376,6 @@ [delegate_ openURL:url]; else if ([name isEqualToString:@"_popup"]) { RVBook *book([[[RVPopUpBook alloc] initWithFrame:[delegate_ popUpBounds]] autorelease]); - [book setDelegate:self]; RVPage *page([delegate_ pageForURL:url hasTag:NULL]); if (page == nil) { @@ -385,6 +384,9 @@ page = browser; } + [book setDelegate:delegate_]; + [page setDelegate:delegate_]; + [book setPage:page]; [book_ pushBook:book]; } else goto unknown; diff --git a/UICaboodle/RVBook.mm b/UICaboodle/RVBook.mm index b1bbce6..b639958 100644 --- a/UICaboodle/RVBook.mm +++ b/UICaboodle/RVBook.mm @@ -220,15 +220,19 @@ [navitem setTitle:title]; } -- (NSString *) _leftButtonTitleForPage:(RVPage *)page { - return [page leftButtonTitle]; +- (void) _leftButtonTitle:(NSString *&)leftButtonTitle style:(UINavigationButtonStyle &)leftButtonStyle forPage:(RVPage *)page { + leftButtonTitle = [page leftButtonTitle]; + leftButtonStyle = [page leftButtonStyle]; } - (void) reloadButtonsForPage:(RVPage *)page { if ([pages_ count] == 0 || page != [pages_ lastObject]) return; - NSString *leftButtonTitle([self _leftButtonTitleForPage:page]); - UINavigationButtonStyle leftButtonStyle = [page leftButtonStyle]; + + NSString *leftButtonTitle; + UINavigationButtonStyle leftButtonStyle; + [self _leftButtonTitle:leftButtonTitle style:leftButtonStyle forPage:page]; + UINavigationButtonStyle rightButtonStyle = [page rightButtonStyle]; //[navbar_ showButtonsWithLeftTitle:leftButtonTitle rightTitle:[page rightButtonTitle] leftBack:(leftButtonTitle == nil)]; @@ -262,9 +266,12 @@ @implementation RVPopUpBook -- (NSString *) _leftButtonTitleForPage:(RVPage *)page { - NSString *title([super _leftButtonTitleForPage:page]); - return (cancel_ = title == nil && [pages_ count] == 1) ? @"Cancel" : title; +- (void) _leftButtonTitle:(NSString *&)leftButtonTitle style:(UINavigationButtonStyle &)leftButtonStyle forPage:(RVPage *)page { + [super _leftButtonTitle:leftButtonTitle style:leftButtonStyle forPage:page]; + if ((cancel_ = leftButtonTitle == nil && [pages_ count] == 1)) { + leftButtonTitle = @"Cancel"; + leftButtonStyle = UINavigationButtonStyleNormal; + } } - (void) navigationBar:(UINavigationBar *)navbar buttonClicked:(int)button { |