Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional parameters for drawer paddings #26

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions MMDrawerController/MMDrawerController.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,20 @@ typedef void (^MMDrawerControllerDrawerVisualStateBlock)(MMDrawerController * dr
*/
@property (nonatomic, assign) CGFloat maximumRightDrawerWidth;

/**
The width padding of the left `leftDrawerViewController`

By default, this is set to 0. but can be increase to let rounded corners be covered by the drawer background color
*/
@property (nonatomic, assign) CGFloat leftDrawerWidthPadding;

/**
The width padding of the left `rightDrawerViewController`

By default, this is set to 0. but can be increase to let rounded corners be covered by the drawer background color
*/
@property (nonatomic, assign) CGFloat rightDrawerWidthPadding;

/**
The visible width of the `leftDrawerViewController`.

Expand Down
3 changes: 3 additions & 0 deletions MMDrawerController/MMDrawerController.m
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ -(id)initWithCenterViewController:(UIViewController *)centerViewController leftD
[self setMaximumLeftDrawerWidth:MMDrawerDefaultWidth];
[self setMaximumRightDrawerWidth:MMDrawerDefaultWidth];

[self setLeftDrawerWidthPadding:0];
[self setRightDrawerWidthPadding:0];

[self setAnimationVelocity:MMDrawerDefaultAnimationVelocity];

[self setShowsShadow:YES];
Expand Down
4 changes: 2 additions & 2 deletions MMDrawerController/UIViewController+MMDrawerController.m
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ -(CGRect)mm_visibleDrawerFrame{
if([self isEqual:self.mm_drawerController.leftDrawerViewController] ||
[self.navigationController isEqual:self.mm_drawerController.leftDrawerViewController]){
CGRect rect = self.mm_drawerController.view.bounds;
rect.size.width = self.mm_drawerController.maximumLeftDrawerWidth;
rect.size.width = self.mm_drawerController.maximumLeftDrawerWidth + self.mm_drawerController.leftDrawerWidthPadding;
return rect;

}
else if([self isEqual:self.mm_drawerController.rightDrawerViewController] ||
[self.navigationController isEqual:self.mm_drawerController.rightDrawerViewController]){
CGRect rect = self.mm_drawerController.view.bounds;
rect.size.width = self.mm_drawerController.maximumRightDrawerWidth;
rect.size.width = self.mm_drawerController.maximumRightDrawerWidth + self.mm_drawerController.rightDrawerWidthPadding;
rect.origin.x = CGRectGetWidth(self.mm_drawerController.view.bounds)-rect.size.width;
return rect;
}
Expand Down