summaryrefslogtreecommitdiff
path: root/cocoa/HistoryView.m
diff options
context:
space:
mode:
authorSven Weidauer <sven.weidauer@gmail.com>2011-02-17 17:23:58 +0000
committerSven Weidauer <sven.weidauer@gmail.com>2011-02-17 17:23:58 +0000
commitd092b9ca354f07a78f0e540ce7da00026f0e534a (patch)
tree4491f04cfae1fb29ac5443162be8e34b5062a801 /cocoa/HistoryView.m
parent2beda0fc07e860b6bd8c7b68ac61de8d821cb580 (diff)
downloadnetsurf-d092b9ca354f07a78f0e540ce7da00026f0e534a.tar.gz
netsurf-d092b9ca354f07a78f0e540ce7da00026f0e534a.tar.bz2
Making sure history popup stays on screen.
svn path=/trunk/netsurf/; revision=11708
Diffstat (limited to 'cocoa/HistoryView.m')
-rw-r--r--cocoa/HistoryView.m19
1 files changed, 11 insertions, 8 deletions
diff --git a/cocoa/HistoryView.m b/cocoa/HistoryView.m
index d18f1eb50..49982b393 100644
--- a/cocoa/HistoryView.m
+++ b/cocoa/HistoryView.m
@@ -25,13 +25,6 @@
#import "desktop/history_core.h"
#import "desktop/plotters.h"
-static NSRect cocoa_history_rect( struct browser_window *bw )
-{
- int width, height;
- history_size( bw->history, &width, &height );
- return cocoa_rect( 0, 0, width, height );
-}
-
@implementation HistoryView
@synthesize browser;
@@ -42,9 +35,19 @@ static NSRect cocoa_history_rect( struct browser_window *bw )
[self updateHistory];
}
+- (NSSize) size;
+{
+ const CGFloat padding = 10;
+
+ int width, height;
+ history_size( browser->history, &width, &height );
+
+ return NSMakeSize( cocoa_px_to_pt( width ) + padding, cocoa_px_to_pt( height ) + padding );
+}
+
- (void) updateHistory;
{
- [self setFrameSize: cocoa_history_rect( browser ).size];
+ [self setFrameSize: [self size]];
[self setNeedsDisplay: YES];
}