diff options
author | Jay Freeman (saurik) <saurik@saurik.com> | 2008-08-02 00:07:34 +0000 |
---|---|---|
committer | Jay Freeman (saurik) <saurik@saurik.com> | 2010-09-30 07:08:12 +0000 |
commit | 7b0ce2dae1de402fa371933b3254bf19b81a89eb (patch) | |
tree | de4092e90e986e872cb6cbaa5006a5d38445d1a8 /UICaboodle | |
parent | 5afbb4b7d503caece8ad938cb7b53a1fd4175ce9 (diff) |
Added settings and sources to manage and fixed a few small nits.
Diffstat (limited to 'UICaboodle')
-rw-r--r-- | UICaboodle/RVBook.mm | 13 | ||||
-rw-r--r-- | UICaboodle/RVPage.h | 10 | ||||
-rw-r--r-- | UICaboodle/RVPage.mm | 8 |
3 files changed, 29 insertions, 2 deletions
diff --git a/UICaboodle/RVBook.mm b/UICaboodle/RVBook.mm index ccd3e42..d83d760 100644 --- a/UICaboodle/RVBook.mm +++ b/UICaboodle/RVBook.mm @@ -172,8 +172,17 @@ - (void) reloadButtonsForPage:(RVPage *)page { if ([pages_ count] == 0 || page != [pages_ lastObject]) return; - NSString *leftButtonTitle([pages_ count] == 1 ? [page leftButtonTitle] : nil); - [navbar_ showButtonsWithLeftTitle:leftButtonTitle rightTitle:[page rightButtonTitle]]; + NSString *leftButtonTitle([page leftButtonTitle]); + RVUINavBarButtonStyle leftButtonStyle = [page leftButtonStyle]; + RVUINavBarButtonStyle rightButtonStyle = [page rightButtonStyle]; + //[navbar_ showButtonsWithLeftTitle:leftButtonTitle rightTitle:[page rightButtonTitle] leftBack:(leftButtonTitle == nil)]; + + [navbar_ + showLeftButton:leftButtonTitle + withStyle:leftButtonStyle + rightButton:[page rightButtonTitle] + withStyle:rightButtonStyle + ]; } - (NSString *) getTitleForPage:(RVPage *)page { diff --git a/UICaboodle/RVPage.h b/UICaboodle/RVPage.h index 5065dd2..8b0a2e4 100644 --- a/UICaboodle/RVPage.h +++ b/UICaboodle/RVPage.h @@ -2,6 +2,13 @@ #import <UIKit/UIView.h> +enum RVUINavBarButtonStyle { + RVUINavBarButtonStyleNormal, + RVUINavBarButtonStyleBack, + RVUINavBarButtonStyleHighlighted, + RVUINavBarButtonStyleDestructive +}; + @class NSString; @class RVBook; @@ -16,6 +23,9 @@ - (NSString *) leftButtonTitle; - (UIView *) accessoryView; +- (RVUINavBarButtonStyle) leftButtonStyle; +- (RVUINavBarButtonStyle) rightButtonStyle; + - (void) _rightButtonClicked; - (void) _leftButtonClicked; diff --git a/UICaboodle/RVPage.mm b/UICaboodle/RVPage.mm index a92058e..ee85a7e 100644 --- a/UICaboodle/RVPage.mm +++ b/UICaboodle/RVPage.mm @@ -24,6 +24,14 @@ return nil; } +- (RVUINavBarButtonStyle) leftButtonStyle { + return [self leftButtonTitle] == nil ? RVUINavBarButtonStyleBack : RVUINavBarButtonStyleNormal; +} + +- (RVUINavBarButtonStyle) rightButtonStyle { + return RVUINavBarButtonStyleNormal; +} + - (void) _rightButtonClicked { [self doesNotRecognizeSelector:_cmd]; } |