mirror of https://github.com/mpv-player/mpv
set window alpha
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@15732 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
8f7931ee18
commit
1b0c8682c4
|
@ -55,6 +55,7 @@ extern float movie_aspect;
|
|||
static float old_movie_aspect;
|
||||
extern float vo_panscan;
|
||||
|
||||
static float winAlpha = 1;
|
||||
static int int_pause = 0;
|
||||
|
||||
static vo_info_t info =
|
||||
|
@ -412,7 +413,11 @@ static uint32_t control(uint32_t request, void *data, ...)
|
|||
NSRect frame;
|
||||
|
||||
aspect((int *)&d_width, (int *)&d_height,A_NOZOOM);
|
||||
//if(sender == kQuitCmd)
|
||||
|
||||
if(sender == kQuitCmd)
|
||||
{
|
||||
mplayer_put_key(KEY_ESC);
|
||||
}
|
||||
|
||||
if(sender == kHalfScreenCmd)
|
||||
{
|
||||
|
@ -763,6 +768,19 @@ static uint32_t control(uint32_t request, void *data, ...)
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
From NSView, respond to key equivalents.
|
||||
*/
|
||||
- (BOOL)performKeyEquivalent:(NSEvent *)theEvent
|
||||
{
|
||||
switch([theEvent keyCode])
|
||||
{
|
||||
case 0x21: [window setAlphaValue: winAlpha-=0.05]; return YES;
|
||||
case 0x1e: [window setAlphaValue: winAlpha+=0.05]; return YES;
|
||||
}
|
||||
return NO;
|
||||
}
|
||||
|
||||
/*
|
||||
Process key event
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue