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:
smfr%smfr.org
2004-12-29 04:33:39 +00:00
parent 1ab0801128
commit 60170902aa
2 changed files with 8 additions and 4 deletions

View File

@@ -61,6 +61,7 @@
@implementation BookmarkButton
- (id)initWithFrame:(NSRect)frame
{
if ( (self = [super initWithFrame:frame]) )

View File

@@ -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];