Fix bug 168791: add another pixel of padding at the top and bottom of the bookmarks toolbar, and fix a bug where there was no space after the first item on each line of the toolbar after the first.
git-svn-id: svn://10.0.0.236/trunk@167082 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -61,6 +61,7 @@
|
||||
|
||||
|
||||
@implementation BookmarkButton
|
||||
|
||||
- (id)initWithFrame:(NSRect)frame
|
||||
{
|
||||
if ( (self = [super initWithFrame:frame]) )
|
||||
|
||||
@@ -224,8 +224,9 @@ static const int kBMBarScanningStep = 5;
|
||||
#define kMinBookmarkButtonWidth 16.0
|
||||
#define kMaxBookmarkButtonWidth 150.0
|
||||
#define kBookmarkButtonHorizPadding 5.0
|
||||
#define kBookmarkToolbarTopPadding 2.0
|
||||
#define kBookmarkButtonVerticalPadding 1.0
|
||||
#define kBookmarkToolbarBottomPadding 1.0
|
||||
#define kBookmarkToolbarBottomPadding 2.0
|
||||
|
||||
-(void)reflowButtonsStartingAtIndex: (int)aIndex
|
||||
{
|
||||
@@ -236,7 +237,7 @@ static const int kBMBarScanningStep = 5;
|
||||
// to bottom right.
|
||||
float oldHeight = [self frame].size.height;
|
||||
int count = [mButtons count];
|
||||
float curRowYOrigin = 0.0;
|
||||
float curRowYOrigin = kBookmarkToolbarTopPadding;
|
||||
float curX = kBookmarkButtonHorizPadding;
|
||||
|
||||
for (int i = 0; i < count; i ++)
|
||||
@@ -263,9 +264,11 @@ static const int kBMBarScanningStep = 5;
|
||||
|
||||
if (NSMaxX(buttonRect) > NSWidth([self bounds]))
|
||||
{
|
||||
// jump to the next line
|
||||
curX = kBookmarkButtonHorizPadding;
|
||||
curRowYOrigin += (kBookmarkButtonHeight + 2 * kBookmarkButtonVerticalPadding);
|
||||
buttonRect = NSMakeRect(kBookmarkButtonHorizPadding, curRowYOrigin + kBookmarkButtonVerticalPadding, width, kBookmarkButtonHeight);
|
||||
curX = NSWidth(buttonRect);
|
||||
buttonRect = NSMakeRect(curX, curRowYOrigin + kBookmarkButtonVerticalPadding, width, kBookmarkButtonHeight);
|
||||
curX += NSWidth(buttonRect) + kBookmarkButtonHorizPadding;
|
||||
}
|
||||
|
||||
[button setFrame: buttonRect];
|
||||
|
||||
Reference in New Issue
Block a user