-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Background transparency #201
base: master
Are you sure you want to change the base?
Background transparency #201
Conversation
Wow, thanks for the big change. It will take me a little bit to get through this, but I am taking a look. |
I haven't dug in super deep but I think these comments cover most of the issues:
rather than
|
Thanks for the feedback. |
You're doing well for a first foray! Feel free to ignore the second comment, I'll take care of that. As for the margins not being correct, I think it's because the wrong alpha value is picked in -[PTYSession textViewDrawBackgroundImageInView:viewRect:blendDefaultBackground:]. I think the +10 should stay as the advanced prefs actually look pretty ugly with always-visible scrollbars, but instead of always adding 10, add |
…ency * origin/master: Don't try to add a titlebar accessory view controller to a window without a title bar. Issue 3449. Make sure to remove tracking rects on the tab bar control before adding new ones. I wasn't able to repro issue 3452 but this should fix it. Clean up tab activity indicator code and various odds and ends
I think I got them all except the popup for transparency sliders on the preferences dialog. |
sources/PTYSession.m
Outdated
@@ -801,6 +801,8 @@ - (BOOL)setScreenSize:(NSRect)aRect parent:(id<WindowControllerInterface>)parent | |||
horizontalSpacing:[[_profile objectForKey:KEY_HORIZONTAL_SPACING] floatValue] | |||
verticalSpacing:[[_profile objectForKey:KEY_VERTICAL_SPACING] floatValue]]; | |||
[self setTransparency:[[_profile objectForKey:KEY_TRANSPARENCY] floatValue]]; | |||
[self setInactiveTransparency:[[_profile objectForKey:KEY_INACTIVE_TRANSPARENCY] floatValue]]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New code should not look up values in _profile directly because it bypasses the relatively new mechanism for defaults. Older code generally had default values of 0 so it happens to work, and I'm slowly moving everything the new model. Instead, write:
[iTermProfilePreferences objectForKey:KEY_INACTIVE_TRANSPARENCY inProfile:_profile]
I added a bunch of niggling line notes, mostly style stuff. Thanks for taking the time to do this! |
Well, I think I got it, but you'll want to double check me. |
sources/PTYSession.m
Outdated
return [iTermProfilePreferences floatForKey:KEY_INACTIVE_BLUR_RADIUS inProfile:_profile]; | ||
} | ||
|
||
- (float)blurRadius { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both float and double are used here; I'm sure that's due to some ancient folly. Let's use double for all new code.
sources/PTYTextView.m
Outdated
[self setNeedsDisplay:YES]; | ||
} | ||
|
||
- (void)setIsBackground:(BOOL)isBackground |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For style and consistency, this should be setWindowInactive: and the backing variable should be _windowInactive.
I tested out appCode’s reformatting and wanted to get your thoughts. It handles most of your styles, but seems to add extra indents on some multi-line constructs.
I tested out appCode’s reformatting and wanted to get your thoughts. It |
sources/PTYTab.m
Outdated
} | ||
|
||
- (double)blurRadius | ||
{ | ||
- (double)averageBlurRadiusForInactive:(BOOL)inactive { | ||
double sum = 0; | ||
double count = 0; | ||
NSArray* sessions = [self sessions]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Space before *, also on next line
Please revert the automatic style changes to PTYTextView and let's revisit that later. I'm working on a significant refactor of that file in a feature branch and this will introduce thousands of merge conflicts. |
This reverts commit e64105e.
…ency] is used by [PTYSession useInactiveTransparency] so I had to leave that in.
I'm not sure what happened, but now the original blur radius settings aren't working. I'll see if I can track that down. |
This fork allows setting different transparency and blur values for background windows.