From 511b18cdd6f77b791e2e1e01b35850770a2141c6 Mon Sep 17 00:00:00 2001 From: vspader Date: Mon, 9 Feb 2009 16:09:29 +0000 Subject: [PATCH] Mouse wheel now works when the volume slider is being displayed. --- Utils/VolumeButton.h | 3 --- Utils/VolumeButton.m | 3 ++- Utils/VolumeSlider.m | 11 +++++++++++ 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/Utils/VolumeButton.h b/Utils/VolumeButton.h index 7f0cdcae8..d4354fc95 100644 --- a/Utils/VolumeButton.h +++ b/Utils/VolumeButton.h @@ -8,10 +8,7 @@ #import "PopupButton.h" -@class PlaybackController; - @interface VolumeButton : PopupButton { - IBOutlet PlaybackController *playbackController; } @end diff --git a/Utils/VolumeButton.m b/Utils/VolumeButton.m index 3daf5e16c..b9dc907cc 100644 --- a/Utils/VolumeButton.m +++ b/Utils/VolumeButton.m @@ -8,6 +8,7 @@ #import "VolumeButton.h" #import "VolumeSlider.h" +#import "PlaybackController.h" @implementation VolumeButton @@ -17,7 +18,7 @@ [(VolumeSlider *)_popView setDoubleValue:[(VolumeSlider *)_popView doubleValue] + change]; - [playbackController changeVolume:_popView]; + [[(VolumeSlider *)_popView target] changeVolume:_popView]; [(VolumeSlider *)_popView showToolTipForDuration:1.0]; } diff --git a/Utils/VolumeSlider.m b/Utils/VolumeSlider.m index f4c27ebad..973269d12 100644 --- a/Utils/VolumeSlider.m +++ b/Utils/VolumeSlider.m @@ -7,6 +7,7 @@ // #import "VolumeSlider.h" +#import "PlaybackController.h" #import "CogAudio/Helper.h" @implementation VolumeSlider @@ -83,5 +84,15 @@ return [super sendAction:theAction to:theTarget]; } +- (void)scrollWheel:(NSEvent *)theEvent +{ + double change = [theEvent deltaY]; + + [self setDoubleValue:[self doubleValue] + change]; + + [[self target] changeVolume:self]; + + [self showToolTipForDuration:1.0]; +} @end