Skip to content
Browse files

Implemented the VisorTransparency defaults key. A UI might follow...

  • Loading branch information...
1 parent 14c1bf3 commit 566b889ace1b20ad8a20c9bd2b831ddb92a62d4e @torsten committed
Showing with 10 additions and 4 deletions.
  1. +10 −4 VisorController.m
View
14 VisorController.m
@@ -218,6 +218,9 @@ - (void)showWindow{
[self slideWindows:1];
[window invalidateShadow];
+ [window setAlphaValue:
+ [[NSUserDefaults standardUserDefaults]
+ floatForKey:@"VisorTransparency"]];
// [controller setNeedsDisplay];
}
@@ -262,6 +265,9 @@ - (void)slideWindows:(BOOL)show{
// added drp
float DURATION=[[NSUserDefaults standardUserDefaults]floatForKey:@"VisorAnimationSpeed"];
+ // The final alpha for the visor window
+ float finalAlpha = [[NSUserDefaults standardUserDefaults]
+ floatForKey:@"VisorTransparency"];
int windowHeightDelta = 500;
// added drp
@@ -280,14 +286,14 @@ - (void)slideWindows:(BOOL)show{
if ([[NSUserDefaults standardUserDefaults]boolForKey:@"VisorUseFade"])
{
if (backgroundWindow)
- CGSSetWindowAlpha(cgs, wids[1], 1.0f-(f*1.1)); //background fades faster
- CGSSetWindowAlpha(cgs, wids[0], 1.0f-f);
+ CGSSetWindowAlpha(cgs, wids[1], finalAlpha-(f*1.1)); //background fades faster
+ CGSSetWindowAlpha(cgs, wids[0], finalAlpha-f);
}
else
{
if (backgroundWindow)
- CGSSetWindowAlpha(cgs, wids[1], 1);
- CGSSetWindowAlpha(cgs, wids[0], 1);
+ CGSSetWindowAlpha(cgs, wids[1], finalAlpha);
+ CGSSetWindowAlpha(cgs, wids[0], finalAlpha);
}

0 comments on commit 566b889

Please sign in to comment.
Something went wrong with that request. Please try again.