From 15e7b87caca8759c1d5b629955d688c05f4b7004 Mon Sep 17 00:00:00 2001 From: Sven Weidauer Date: Tue, 25 Jan 2011 09:53:39 +0000 Subject: Nicer button for local history, fading history view, more readable blue for active item svn path=/trunk/netsurf/; revision=11481 --- cocoa/BrowserView.m | 47 +++++++++++++++++++---------------------------- 1 file changed, 19 insertions(+), 28 deletions(-) (limited to 'cocoa/BrowserView.m') diff --git a/cocoa/BrowserView.m b/cocoa/BrowserView.m index ba0874c3a..ea5147558 100644 --- a/cocoa/BrowserView.m +++ b/cocoa/BrowserView.m @@ -28,10 +28,6 @@ #import "cocoa/font.h" -@interface BrowserView () - -@end - @implementation BrowserView @@ -182,7 +178,7 @@ static browser_mouse_state cocoa_mouse_flags_for_event( NSEvent *evt ) - (void) mouseUp: (NSEvent *)theEvent; { if (historyVisible) { - [self toggleHistory]; + [self setHistoryVisible: NO]; return; } @@ -339,29 +335,6 @@ static browser_mouse_state cocoa_mouse_flags_for_event( NSEvent *evt ) browser_window_key_press( browser, KEY_PASTE ); } -- (void) toggleHistory; -{ - if (!historyVisible) { - if (nil == history) { - history = [[HistoryView alloc] initWithBrowser: browser]; - [history setDelegate: self]; - } - [self addSubview: history]; - - historyVisible = YES; - } else { - [history removeFromSuperview]; - historyVisible = NO; - } -} - - -- (void) historyViewDidSelectItem: (HistoryView *) history; -{ - [history removeFromSuperview]; - historyVisible = NO; -} - - (BOOL) acceptsFirstResponder; { return YES; @@ -377,4 +350,22 @@ static browser_mouse_state cocoa_mouse_flags_for_event( NSEvent *evt ) [super adjustFrame]; } +- (BOOL) isHistoryVisible; +{ + return historyVisible; +} + +- (void) setHistoryVisible: (BOOL) newVisible; +{ + if (newVisible == historyVisible) return; + historyVisible = newVisible; + + if (historyVisible) { + if (nil == history) history = [[HistoryView alloc] initWithBrowser: browser]; + [history fadeIntoView: self]; + } else { + [history fadeOut]; + } +} + @end -- cgit v1.2.3