-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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 image support #853
Conversation
I am working on an error dialog in #622, but that's not quite ready yet, so I'm fine with this just doing whatever for now. |
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.
I'm a little worried about introducing ImageStretchMode
to be the same as windows.ui.xaml.media.stretch
. Otherwise no complaints here :)
I'm concerned as to whether this should be a property of the But given that I don't currently have the capacity to figure that out, I'm OK with accepting this in the meantime. |
Yeah, we can stick with this. Putting it behind the Given that list, I'm inclined to prefer the XAML solution. 😄 |
Additionally, as far as I'm aware there's no "official" implementation of the Fluent acrylic brush in Direct2D, so the XAML layer would still be required for that effect. |
…:Xaml::Media::Stretch instead.
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.
This will conflict heavily with #1005. This is otherwise a very well-done feature. Let's file a follow-up to support a transparent image over top of acrylic and really set those GPUs on fire
Working on cleaning up some architectural oddities created by merging this with #891. The current PR build works, but it's inelegant (and the code gets called three times on a settings file change...) |
@d-bingham you might not need to worry about the settings reloading issue too much. I know that it's definitely called twice per settings change, because for whatever reason, we get two file change notifications. |
I'm more concerned about getting a background image refresh (and the resulting flicker of the background image) resulting from terminal input introduced in #891. |
…olorChanged and added code to prevent flicker on resetting acrylic or image backgrounds.
Modified this a bit to make more sense with regard to #891:
|
Also, critically, the flicker prevention code maintains animation state of any animated image selected as a background during a settings change that does not change the image source. |
Are you suggesting we can have gifs as a background? Because that would be amazing |
Yeah, just set your backgroundImage to https://lh6.googleusercontent.com/-Kde1FiWiijM/TniZsFpCyqI/AAAAAAAAD7Q/2sZC2Zqx8RM/s500/Contact500_Micael_Reynaud.gif and give it a bit to load, and it works. |
Fixes #1082 -- #853's fix of the acrylic background's flash/fade on any settings change managed to cause a flash/fade on new tab creation. This change removed both flash/fades. #853 split background brush initialization from background color changes; due to the brush being constructed with a default color and then the color being initialized later, new tabs were getting the flash/fade that accompanies a re-focused fluent-style acrylic background. This PR initializes the acrylic color at brush initialization to avoid the problem.
Summary of the Pull Request
Initial code check-in for background image support. Handles background images themselves, and adds options to profiles.json to control the feature.
References
#833
PR Checklist
Detailed Description of the Pull Request / Additional comments
This adds three options to the individual profile options in profile.json:
Background images are only displayed if useAcrylic is turned off.
One known issue:
backgroundImageOpacity currently only works with respect to the application's default black background and does not respect the profile's background color.
One potential issue:
There's no attempt to handle a failed image load from the Uri; I think it is reasonable to expect the underlying classes (specifically BitmapImage) to handle this gracefully. Additionally, it's unclear how such a failure should be reported to the user (beyond their requested image being displayed as a black console background instead)