Skip to content

Commit

Permalink
SSA crash bug fixed
Browse files Browse the repository at this point in the history
- default color is used for some incorrect color tag.

cursor-time tool-tip bug fixed
- full-screen or window-resize hide tool-tip if it's shown.
- tool-tip is always on the play-panel even if slider is clicked.


git-svn-id: http://movist.googlecode.com/svn/trunk@250 9988c26d-9134-0410-b5bb-5778289bb252
  • Loading branch information
cocoable committed Mar 22, 2009
1 parent 03939f1 commit 0a158f5
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 6 deletions.
5 changes: 5 additions & 0 deletions AppController_Video.m
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ - (void)resizeWithMagnification:(float)magnification
frame = [_mainWindow frameRectForScreen];
}
BOOL subtitleVisible = [_movieView subtitleVisible];
[_seekSlider hideMouseTimeToolTip];
[_movieView setSubtitleVisible:FALSE];
[_mainWindow setFrame:frame display:TRUE animate:TRUE];
[_movieView setSubtitleVisible:subtitleVisible];
Expand All @@ -83,6 +84,7 @@ - (void)resizeToScreen
NSRect frame = [_mainWindow frameRectForScreen];

BOOL subtitleVisible = [_movieView subtitleVisible];
[_seekSlider hideMouseTimeToolTip];
[_movieView setSubtitleVisible:FALSE];
[_mainWindow setFrame:frame display:TRUE animate:TRUE];
[_movieView setSubtitleVisible:subtitleVisible];
Expand Down Expand Up @@ -123,6 +125,7 @@ - (void)beginFullScreen
[_fullScreener setMovieURL:[self movieURL]];
[_fullScreener setAutoShowDock:[_defaults boolForKey:MAutoShowDockKey]];
}
[_seekSlider hideMouseTimeToolTip];
[_fullScreener beginFullScreen];
}
[_fullScreenLock unlock];
Expand Down Expand Up @@ -164,6 +167,7 @@ - (void)beginDesktopBackground
[_fullScreener initWithMainWindow:_mainWindow playPanel:_playPanel];
[_fullScreener setMovieURL:[self movieURL]];
}
[_seekSlider hideMouseTimeToolTip];
[_fullScreener beginDesktopBackground];
}
[_fullScreenLock unlock];
Expand Down Expand Up @@ -217,6 +221,7 @@ - (void)beginFullNavigation
_fullScreener = [FullScreener alloc];
[_fullScreener initWithMainWindow:_mainWindow playPanel:_playPanel];
[_fullScreener setMovieURL:nil];
[_seekSlider hideMouseTimeToolTip];
[_fullScreener beginNavigation];
}
[_fullScreenLock unlock];
Expand Down
7 changes: 6 additions & 1 deletion MSubtitleParser_SSA.m
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,12 @@ - (NSMutableAttributedString*)styleAppliedString:(NSString*)s
case TAG_I_OPEN : italic = TRUE; break;
case TAG_I_CLOSE : italic = FALSE; break;
case TAG_C :
color = [NSColor colorFromSSAString:tag.attr];
if (tag.attr) {
color = [NSColor colorFromSSAString:tag.attr];
}
else {
color = _defaultColor;
}
break;
case TAG_R :
bold = _defaultBold;
Expand Down
1 change: 1 addition & 0 deletions MainWindow.m
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ - (void)zoom:(id)sender
//TRACE(@"%s", __PRETTY_FUNCTION__);
if ([_movieView movie]) {
BOOL subtitleVisible = [_movieView subtitleVisible];
[_seekSlider hideMouseTimeToolTip];
[_movieView setSubtitleVisible:FALSE];
if ([self isZoomed]) {
[self setFrame:_zoomRestoreRect display:TRUE animate:TRUE];
Expand Down
2 changes: 1 addition & 1 deletion PlayPanel.m
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ - (void)orderFront:(id)sender
- (void)orderOut:(id)sender
{
//TRACE(@"%s", __PRETTY_FUNCTION__);
[_seekSlider mouseMoved:NSMakePoint(-1, -1)]; // hide tooltip
[_seekSlider hideMouseTimeToolTip];
[super orderOut:sender];
}

Expand Down
1 change: 1 addition & 0 deletions SeekSlider.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
}

- (void)initToolTipWithTextColor:(NSColor*)textColor backColor:(NSColor*)backColor;
- (void)hideMouseTimeToolTip;
- (void)mouseMoved:(NSPoint)locationInWindow;

- (float)duration;
Expand Down
32 changes: 28 additions & 4 deletions SeekSlider.m
Original file line number Diff line number Diff line change
Expand Up @@ -311,18 +311,22 @@ - (void)showMouseTimeToolTip:(NSPoint)locationInWindow
{
[_toolTipTextField setStringValue:NSStringFromMovieTime(_mouseTime)];

NSWindow* toolTipWindow = [_toolTipTextField window];
NSRect r = [self convertRect:[self bounds] toView:nil];
r.origin.x = locationInWindow.x;
r.origin.y += r.size.height;
r.origin = [[self window] convertBaseToScreen:r.origin];
r.origin.x -= [[_toolTipTextField window] frame].size.width / 2;
[[_toolTipTextField window] setFrameOrigin:r.origin];
[[_toolTipTextField window] orderFront:self];
r.origin.x -= [toolTipWindow frame].size.width / 2;
[toolTipWindow setFrameOrigin:r.origin];
[toolTipWindow orderFront:self];
[[self window] addChildWindow:toolTipWindow ordered:NSWindowAbove];
}

- (void)hideMouseTimeToolTip
{
[[_toolTipTextField window] orderOut:self];
NSWindow* toolTipWindow = [_toolTipTextField window];
[[self window] removeChildWindow:toolTipWindow];
[toolTipWindow orderOut:self];

[_toolTipTextField setStringValue:@""];
}
Expand Down Expand Up @@ -415,6 +419,26 @@ - (void)awakeFromNib
[cell setKnobSize:8.0];

[self initToolTipWithTextColor:[NSColor whiteColor] backColor:HUDTitleBackColor];

NSNotificationCenter* nc = [NSNotificationCenter defaultCenter];
[nc addObserver:self selector:@selector(windowWillMiniaturize:)
name:NSWindowWillMiniaturizeNotification object:[self window]];
}

- (void)dealloc
{
NSNotificationCenter* nc = [NSNotificationCenter defaultCenter];
[nc removeObserver:self];

[super dealloc];
}

- (void)windowWillMiniaturize:(NSNotification*)notification
{
TRACE(@"%s", __PRETTY_FUNCTION__);
if (0 <= _mouseTime) {
[self hideMouseTimeToolTip];
}
}

@end
Expand Down

0 comments on commit 0a158f5

Please sign in to comment.