From 702d3c2ac4aed818cd524e436254648427f05844 Mon Sep 17 00:00:00 2001 From: Martin Garcia Date: Sat, 25 Jan 2014 13:52:09 +0100 Subject: [PATCH] fixes brackets/issues#6642 --- appshell/FullScreenButton.mm | 20 ++++++++++---------- appshell/TrafficLightButton.mm | 18 +++++++++--------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/appshell/FullScreenButton.mm b/appshell/FullScreenButton.mm index ea5ebb265..696600873 100644 --- a/appshell/FullScreenButton.mm +++ b/appshell/FullScreenButton.mm @@ -20,13 +20,13 @@ * DEALINGS IN THE SOFTWARE. * */ -#import "FullScreenbutton.h" +#import "FullScreenButton.h" //#define FS_HOT_TO_COLD //these are defined in MainMainu.xib file static const int FULLSCREEN_BUTTON_TAG = 1004; -@implementation FullScreenButton { +@implementation FullScreenButton { NSImage *inactive; NSImage *active; NSImage *hover; @@ -52,22 +52,22 @@ - (id)initWithFrame:(NSRect)frameRect { return self; } -- (void)setup { +- (void)setup { inactive = [NSImage imageNamed:@"window-fullscreen-inactive"]; active = [NSImage imageNamed:@"window-fullscreen-active"]; hover = [NSImage imageNamed:@"window-fullscreen-hover"]; pressed = [NSImage imageNamed:@"window-fullscreen-pressed"]; - + #ifdef FS_HOT_TO_COLD NSImage* saved = active; active = pressed; pressed = saved; #endif - + // assume active activeState = YES; [self updateButtonStates]; - + //get notified of state [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateActiveState) @@ -81,13 +81,13 @@ - (void)setup { [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateActiveState) name:NSWindowDidResignKeyNotification object:[self window]]; - - + + NSTrackingAreaOptions focusTrackingAreaOptions = NSTrackingActiveInActiveApp; focusTrackingAreaOptions |= NSTrackingMouseEnteredAndExited; focusTrackingAreaOptions |= NSTrackingAssumeInside; focusTrackingAreaOptions |= NSTrackingInVisibleRect; - + NSTrackingArea *focusTrackingArea = [[NSTrackingArea alloc] initWithRect:NSZeroRect options:focusTrackingAreaOptions owner:self userInfo:nil]; [self addTrackingArea:focusTrackingArea]; @@ -96,7 +96,7 @@ - (void)setup { - (void)mouseDown:(NSEvent *)theEvent { pressedState = YES; hoverState = NO; - + if (!activeState) { [self.window makeKeyAndOrderFront:self]; [self.window setOrderedIndex:0]; diff --git a/appshell/TrafficLightButton.mm b/appshell/TrafficLightButton.mm index 2f8d135e0..bc7220c9d 100644 --- a/appshell/TrafficLightButton.mm +++ b/appshell/TrafficLightButton.mm @@ -20,14 +20,14 @@ * DEALINGS IN THE SOFTWARE. * */ -#import "TrafficLightbutton.h" +#import "TrafficLightButton.h" //these are defined in MainMainu.xib file static const int CLOSE_BUTTON_TAG = 1000; static const int MINIMIZE_BUTTON_TAG = 1001; static const int ZOOM_BUTTON_TAG = 1002; -@implementation TrafficLightButton { +@implementation TrafficLightButton { NSImage *inactive; NSImage *active; NSImage *hover; @@ -59,7 +59,7 @@ - (id)initWithFrame:(NSRect)frameRect { return self; } -- (void)setup { +- (void)setup { NSString* buttonName = nil; //the numbers come from the XIB file. if ([self tag] == CLOSE_BUTTON_TAG) { @@ -80,11 +80,11 @@ - (void)setup { dirtyHover = [NSImage imageNamed:[NSString stringWithFormat:@"window-%@-dirty-hover",buttonName]]; dirtyPressed = [NSImage imageNamed:[NSString stringWithFormat:@"window-%@-dirty-pressed",buttonName]]; } - + // assume active activeState = YES; [self updateButtonStates]; - + //get notified of state [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateActiveState) @@ -106,7 +106,7 @@ - (void)setup { selector:@selector(hoverOut) name:@"TrafficLightsMouseExit" object:nil]; - + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(setDocumentEdited) name:@"TrafficLightsDirty" @@ -116,7 +116,7 @@ - (void)setup { - (void)mouseDown:(NSEvent *)theEvent { pressedState = YES; hoverState = NO; - + if (!activeState) { [self.window makeKeyAndOrderFront:self]; [self.window setOrderedIndex:0]; @@ -141,7 +141,7 @@ - (void)mouseUp:(NSEvent *)theEvent { [[self window] performZoom:nil]; return; } - + [self updateButtonStates]; [super mouseUp:theEvent]; } @@ -191,7 +191,7 @@ -(void)updateButtonStates{ } - (void)hoverIn:(NSNotification *) notification { - + if ([[notification object] isEqual:[self superview]]) { hoverState = YES; if (closeButton && dirtyState) {