mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-08-05 16:58:59 +00:00
30 lines
582 B
Mathematica
30 lines
582 B
Mathematica
![]() |
//
|
||
|
// NBBarButtonItem.m
|
||
|
// NewsBlur
|
||
|
//
|
||
|
// Created by Samuel Clay on 9/24/13.
|
||
|
// Copyright (c) 2013 NewsBlur. All rights reserved.
|
||
|
//
|
||
|
|
||
|
#import "NBBarButtonItem.h"
|
||
|
|
||
|
@implementation NBBarButtonItem
|
||
|
|
||
|
@synthesize onRightSide;
|
||
|
|
||
|
- (UIEdgeInsets)alignmentRectInsets {
|
||
|
UIEdgeInsets insets;
|
||
|
if (![self isLeftButton] || self.onRightSide) {
|
||
|
insets = UIEdgeInsetsMake(0, 0, 0, 9.0f);
|
||
|
} else {
|
||
|
insets = UIEdgeInsetsMake(0, 9.0f, 0, 0);
|
||
|
}
|
||
|
return insets;
|
||
|
}
|
||
|
|
||
|
- (BOOL)isLeftButton {
|
||
|
return self.frame.origin.x < (self.window.frame.size.width / 2);
|
||
|
}
|
||
|
|
||
|
@end
|