-
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
Add support for the Mica material #10509
Comments
Blocked by microsoft/microsoft-ui-xaml#5319 |
Oh no. Thanks. |
Or you can reference WinUI's source code and create a composition brush for Mica. |
Have you tried using Compositor.TryCreateBlurredWallpaperBackdropBrush() , it gives the blurred wallpaper brush that is used for creating mica. It is also supported in windows.ui.composition |
Not sure about its implementation. |
Since I'm tracking this here: |
#####⚠️ targeting 1.15 ## Summary of the Pull Request Adds support for Themes, a new type of customization for the Terminal. Themes allow the user to customize elements of the Terminal window itself. In this first iteration, this PR adds support for two main properties: * enabling Mica as the window backdrop * changing the tab row color (read: changing the titelbar color) These represent the most important asks of theming in the Terminal. The properties added in this PR are: * Theme color variants: - `"#rrggbb"` or `"#aarrggbb"` - `"accent"` - `"terminalBackground"` * Properties (_listed here in dot notation, but implemented as sub-objects_) - `tabRow.background`: accepts a ThemeColor (above) - `window.applicationTheme`: accepts one of `{"system", "light", "dark"}` - `window.useMica`: accepts a boolean, defaults to false. ## References * As first described in #3327 * spec'd in #12530 ## PR Checklist * [x] Sorta enables #10509, but doesn't close it. That'll need more comprehensive changes to the titlebar code. * **update**: I totally disabled mica, but left the serialization code. It just seems silly without #10509. * [x] Closes #1963 * [x] Closes #3774 * [x] Closes #12939 * [x] Does the bulk of the #3327 work, but I'm going to leave that open since that's become my megathread for everything related to theming. * [x] I work here * [x] Tests added/passed * [ ] Requires documentation to be updated - **SURE DOES** ## Detailed Description of the Pull Request / Additional comments ### --> GO READ #12530 <-- Seriously. These themes aren't customizable in the SUI currently. You can change the active theme, and the UI will show all of the defined themes, but they're not editable there. They don't layer. You'll need to define your own themes. Thay can't come from fragments. This is a really cool future idea, but not implemented in this v0. The sub objects have some gnarly macros to generate a lot of the serialization code for you. ### TODOs * [x] I still have yet to establish what the accent color algorithm is. This might be proprietary and require a ThemeHelpers workaround. * [x] Make sure `terminalBackground` & the SUI result in something sensible * [x] Make sure runtime BG changes work with `terminalBackground`. One time, they didn't. `printf "\x1b]11;rgb:ff/00/ff\x07"` * [x] Acrylic Terminal BG's look weird, like, the opacity is always 50% or something. And the tab row looks all wrong then. ## Validation Steps Performed This is the blob I've been testing with: <details> ```jsonc // "useAcrylicInTabRow": true, "theme": "my dark", // "theme": "Edge", "theme": "orangey", "theme": "WHITE", // "theme": "terminal", "themes": [ { "name": "my dark", "window": { "applicationTheme": "dark", "useMica": true, }, "tabRow": { "background": "#00000000", }, }, { "name": "Edge", "tabRow": { "background": "accent" }, "window": { "applicationTheme": "system" } }, { "name": "orangey", "window": { "applicationTheme": "light", "useMica": true, }, "tabRow": { "background": "#ff8800", }, }, { "name": "WHITE", "window": { "applicationTheme": "dark", "useMica": true, }, "tabRow": { "background": "#FFFFFF", }, }, { "name": "terminal", "window": { "applicationTheme": "dark", "useMica": false, }, "tabRow": { "background": "terminalBackground", }, }, ] ``` </details>
⚠️ This spec is going into the `specs/drafts/` folder, because it's CLEARLY not done yet. I discussed this a bit with Dustin. We felt it would be valuable to have these thoughts committed as a durable artifact. Better to have our Mica thoughts written down somewhere, with the context they belong in. That of course includes the bigger Theming spec, which never got finished. I don't think we need to go through the fill spec review for this. Theming is clearly still a WIP. But committing this draft should give a better picture of what the vision is. See also: * #3327 * #10509 ### TODOs * [ ] The many that are straight up in the doc * [ ] The fact that there's multiple Mica's now * [ ] GO look at MSFT:39027976
This reverts commit 19b6d35. This re-enables support for Mica, and transparent titlebars in general. It also syncs the titlebar opacity with the control opacity for `terminalBackground`. It also somehow fixes the bug where the bottom few pixels of the max btn doesn't work to trigger the snap flyout. Closes #10509 Does nothing for #13631 ### To-done's * [x] Check the mica API on 22000, windows 11 RTM - this works on 10.0.22621.674, but that's not 22000 * [x] Check how this behaves on windows 10. - For both, this API just no-ops. That's fine! we can just say "Mica is only supported on >=22621"
🎉This issue was addressed in #13935, which has now been successfully released as Handy links: |
Hey! Thanks for adding Mica! It's worth noting that you have to move opacity slider to 0 to have Mica effect on a client terminal area. But you'll see a horizontal line between the client area and the title bar in that case, and the active tab and client area aren't seamless. To solve this, we can make the title bar darker, and, since we can't have completely transparent elements (tab) over semitransparent (darker title bar), we can add some white to the active tab to workaround this. {
"profiles": {
"defaults": {
// ...attributes...
"opacity": 0
}
},
"theme": "Mica",
"themes": [
{
"name": "Mica",
"window": {
"applicationTheme": "dark",
"useMica": true
},
"tabRow": {
"background": "#00000043", // darker
"unfocusedBackground": "#00000043" // darker
},
"tab": {
"background": "#FFFFFF09", // lighter
"unfocusedBackground": "#00000000" // transparent
}
}
]
} Finally, this is how it looks now: |
hey @plashenkov |
Hey @Void48 I've already posted everything needed. This should really be enough, no need to expose other parts of my config. If you've already added these settings, what do you get? |
Actually I figured it out @plashenkov 👍🏻 |
Depends on #10508
The text was updated successfully, but these errors were encountered: