-
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 a XAML Theming spec #5772
Add a XAML Theming spec #5772
Conversation
…icrosoft/terminal into dev/migrie/s/3327-xaml-theming
Can there be support for the Accent Color brushes, so if I were to set my cursor or selction to my Accent Color, as it changes, that change will be reflected in Windows Terminal? |
So that might need to be it's own separate feature request. The cursor and the selection are drawn in DirectX down in For those, we'd need to accept something like It's not a horrible idea, but probably something we should move to it's own thread for discussion, since I don't think it really fits in with a lot of the other things in this spec. |
@zadjii-msft I just assumed the ability to specify Xaml resources, would include the app getting the Accent Color resource to use for the UI. I do see that with the console rendering being a separate system, passing any Xaml brushes through, would be a different issue. |
} | ||
``` | ||
|
||
> **TODO FOR DISCUSSION**: I've given both a `tab.<property>` and a |
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 personally like the <element>.<property>
representation more. I think it's more clear.
I'm probably in the minority here but I also love nested objects too. So, is there any consideration for...
<element>:
{
<property1>: <value1>,
<property2>: <value2>
}
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.
ew, I hate the nested objects so much that I didn't even put them in here 😝 My preference is definitely leaning towards element.property
* `key:SomeXamlKey` to try and look `SomeXamlKey` up from our resources as a | ||
`Color`, and use that color for the value. | ||
- TODO DISCUSSION: Does anyone want this? | ||
- is `accent` just `key:SystemAccentColor`? If it is, is it a reasonable | ||
alias that we'd want to provide anyways? | ||
- TODO DISCUSSION: PR[#5280] suggested `{ "key": "SomeResourceKey" }` for | ||
string resources, should we use that format for colors like this as well? |
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.
Why key:SomeXamlKey
as opposed to SomeXamlKey
directly? We can just add valid enums. Then extensions can add more enums too. Maybe I'm just not understanding this part.
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 missing the thread it was mentioned in now, but someone once suggested using "xaml:SomeXamlKey"
, and I really like that.
I think the "object" notation for looking up a key like this made it easier for us to say "this is an object, it's definitely not a string value". You're right though, these are just enums, so we can manually make sure that xaml:
isn't used as a prefix for any of them.
Using `terminalBackground` with multiple concurrent panes with different | ||
backgrounds could certainly lead to some odd behavior. The intention of the | ||
setting is to provide a way for the tab/titlebar to "seamlessly" connect to the | ||
terminal content. However, two panes side-by-side could have different | ||
background colors, which might have an unexpected appearance. Since the user | ||
must have opted in to this behavior, they'll need to decide personally if | ||
that's something that bothers them aesthetically. It's entirely possible that a | ||
user doesn't use panes, and this wouldn't even be a problem for them. | ||
|
||
<!-- We could maybe mitigate this by providing the user a way of specifying the | ||
`tab.background` color as having both a "single pane" and "multiple pane" mode, | ||
though I'm not sure I'm in love with this: | ||
|
||
```json | ||
"tab.background": {"single": "terminalBackground", "multiple": null}, | ||
"tab.background": {"single": "terminalBackground", "multiple": "#ff0000"}, | ||
"tab.background": [ "terminalBackground", null ] | ||
``` | ||
|
||
Also shown is an array based implementation, as an option. Overall I'm not | ||
happy with this, so I think it shouldn't be in the final draft of the spec, but | ||
I'm leaving it for now as an option. | ||
--> |
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 alone could get its own spec hahaha. I think following the active terminal instance is good for now. I'm thinking of some weird behaviors we could do that I think just isn't worth dealing with in v1:
Scenario | Behavior |
---|---|
vertical stack of panes | (1) inherit top color |
horizontal stack of panes | (1) blend colors touching titlebar, (2) blend at pane separator |
to use the tab color with some contrast applied" or just literally "Use | ||
whatever the active tab's color is." | ||
|
||
### Default Themes |
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.
(Maybe worth mentioning in future considerations over v1) Should we consider a "defaults/list" structure like we did with profiles.defaults
? For now, I'm guessing themes won't be too big, but over time that could become an issue (maybe)
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.
See, I don't think we need a "defaults" for themes. People will only ever have one theme active at a time, for the entire window, so we don't really need to abstract that away.
The only reason I've got a whole list of themes is so:
- In the future, people can use extensions to install multiple themes, and just pick one they like
- People can iterate on ideas they like, and keep around old "themes" they create, even if they're using something else currently.
I think it's fine for each theme to be it's own atomic object, not composed of a (user theme defaults)+(changes to the user theme defaults)
Are we concerned that by enabling theming, the appearance of the Terminal won't | ||
be as static, and won't necessarily have as specific a look? It might be harder | ||
for potential users see a screenshot of the Terminal and _know_ "Thats the | ||
Windows Terminal". Is this something we're really all that concerned about | ||
though? If this is something users want (it is), then shouldn't that be what | ||
matters? |
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 think that's where the defaults matter most (I'm guessing that's a conversation we'll have at some point too)
XAML fundamentally styles UI elements. If not provided, will use the default | ||
value "system", which will use whatever the system's default theme is. | ||
|
||
#### Theme Colors |
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.
Hey something else we should consider - someone might want an acrylic titlebar, that's not the terminal BG color. This spec doesn't cover that case quite yet.
maybe "property": { "color": "#rrggbb", "opacity": .5 }
?
Other lower-priority ideas: | ||
* [ ] Enable hiding the tab icon altogether | ||
* [ ] Enable forcing tab icons to monochrome | ||
* [ ] Tab row height |
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.
🦙 The Tab width behavior would fit in here as well (Compact, Equal, SizeToContent).
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.
Oh, that's a good point. We'll need to come up with a way of handling what happens when the user has it set in both the theme
and directly in the global settings - probably makes sense to just use the global value to override the theme value, right?
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.
@zadjii-msft or does it make sense to just move the setting itself into the theme (and have some default value if the theme doesn't provide one)? Or use the 'global' setting as the fallback value if the theme doesn't contain one?
This PR adds support for per-profile tab colors, in accordance with #7134. This adds a single `tabColor` property, that when set, specifies the background color for profile's tab. This color can be overridden by the color picker, and clearing the color with the color picker will revert to this default color set for the tab. * Full theming is covered in #3327 & #5772 Validation: Played with setting this color, both on launch and via hot-reload Specified in #7134 Closes #1337
@Shomnipotence love your first solution, that is pretty much perfect. |
There should be a tab.backgroundMode that sets when should the color be visible (all the time, hover+selection, selection). |
When there are two tabs, my eye goes to the prominent unselected tab. Determination of the foreground tab is too subtle in that case. If there were 3 tabs it might be more obvious about what tab is in the foreground. I suspect my eye can be trained, but that is worrisome. Is there a way out of this that isn't complexifying? Oh: If the rest of the tab bar (and other unselected tabs) were also the same as the shown unselected tab, I would have no doubt about which tab is in the foreground. Maybe distinguished with or without acryic. |
I'm closing this for now. There's been no movement for a while, and we're not planning on landing this inside 2.0 anymore. Plus, #10509 definitely complicates the design a bit. Might as well not leave this stale PR open for so long. I'll come back to it in the future. |
Hi is this implemented yet? 😅 |
@PuruVJ Nope. This was a proposal for how we might want to do this in the future, but I've temporarily closed this out because
This is my pet project for 3.0, but alas, it didn't end up making the cut for 2.0. |
Thanks!! Makes sense |
Add support for acrylic in the titlebar ## PR Checklist * [x] CLA signed ## Detailed Description of the Pull Request / Additional comments This seems to be a highly requested feature and seeing as #5772 was closed I thought it made sense to make a PR for this. ![image](https://user-images.githubusercontent.com/40522069/128095309-f9073a9d-274c-44a1-be5b-34ea58d5a5a9.png) ## Validation Steps Performed Checked that acrylic works in both dark and light modes and switching between them still works. Also checked that acrylic in the tab row still works when tabs in titlebar is disabled.
Summary of the Pull Request
This PR aims to outline my vision for what "XAML theming" might mean for the Windows Terminal in v2.0 and beyond. Now that #3789 has merged into master, I figured it was time to discuss what customizing other elements of the UI might look like as well. I've tried to include as many configurable elements of the UI as I could, referencing a ton of threads across the repo.
References
PR Checklist
Detailed Description of the Pull Request / Additional comments
read the spec
TODO
element.property
orelementProperty
?#ff00ff
)? What about other potential materials? (vintage opacity?)