summaryrefslogtreecommitdiff
path: root/cocoa/HistoryView.m
diff options
context:
space:
mode:
authorSven Weidauer <sven.weidauer@gmail.com>2011-02-27 09:46:54 +0000
committerSven Weidauer <sven.weidauer@gmail.com>2011-02-27 09:46:54 +0000
commite1901889698454018150bfc58f469708837dfd7a (patch)
tree68cbf63380769e92d56f9adfbe522087766c5f27 /cocoa/HistoryView.m
parent1842be491dffdbc0b0d2dc8e3891d13369824887 (diff)
downloadnetsurf-e1901889698454018150bfc58f469708837dfd7a.tar.gz
netsurf-e1901889698454018150bfc58f469708837dfd7a.tar.bz2
Local history view now is responsible for hiding itself after selecting a web page. Also gets redrawn when selecting other pages using the back/forward buttons.
svn path=/trunk/netsurf/; revision=11837
Diffstat (limited to 'cocoa/HistoryView.m')
-rw-r--r--cocoa/HistoryView.m17
1 files changed, 11 insertions, 6 deletions
diff --git a/cocoa/HistoryView.m b/cocoa/HistoryView.m
index 49982b393..bf38b7716 100644
--- a/cocoa/HistoryView.m
+++ b/cocoa/HistoryView.m
@@ -20,6 +20,8 @@
#import "cocoa/font.h"
#import "cocoa/coordinates.h"
#import "cocoa/plotter.h"
+#import "cocoa/LocalHistoryController.h"
+#import "cocoa/BrowserView.h"
#import "desktop/browser.h"
#import "desktop/history_core.h"
@@ -27,11 +29,12 @@
@implementation HistoryView
-@synthesize browser;
+@synthesize browser = browserView;
-- (void) setBrowser: (struct browser_window *) bw;
+- (void) setBrowser: (BrowserView *) bw;
{
- browser = bw;
+ browserView = bw;
+ browser = [bw browser];
[self updateHistory];
}
@@ -63,9 +66,11 @@
{
const NSPoint location = [self convertPoint: [theEvent locationInWindow] fromView: nil];
const bool newWindow = [theEvent modifierFlags] & NSCommandKeyMask;
- history_click( browser, browser->history,
- cocoa_pt_to_px( location.x ), cocoa_pt_to_px( location.y ),
- newWindow );
+ if (history_click( browser, browser->history,
+ cocoa_pt_to_px( location.x ), cocoa_pt_to_px( location.y ),
+ newWindow )) {
+ [browserView setHistoryVisible: NO];
+ }
}
- (BOOL) isFlipped;