-
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 tab.background
to themes
#13178
Conversation
https://stackoverflow.com/questions/64694722/changing-themeresources-dynamically-in-uwp That post looked SUPER promising. Problem is though, I CANNOT for the life of me get that to work. Like, I can't get anything to `{Binding Brush, Mode=TwoWay, Source={StaticResource TerminalBackground}}` to the `TerminalBackground` thing I made there. I thought that was so clever. I wanted an easy way to just change the value of a resource and have it update the Titlebar, but since the Titlebar isn't a child of the TerminalPage, and this binding thing didn't work, I think I'm at a dead end.
…dev/migrie/fhl/theming-2022-prototype
…ses are NOT optional
…to be sub-properties of the Theme
This comment was marked as resolved.
This comment was marked as resolved.
I'd like to see this tied into James' DECAC work somehow since he introduced color table aliasing |
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.
Looks good to me. Thanks!
I'm explicitly not merging this so that you handle the merge order and all that. |
…f/702-link-tab-to-terminal
…f/702-link-tab-to-terminal
auto currentColor = tab->GetTabColor(); | ||
if (currentColor.has_value()) | ||
{ | ||
tab->_ApplyTabColor(currentColor.value()); | ||
} | ||
else if (tab->_themeColor != nullptr) | ||
{ | ||
// One-liner to safely get the active control's brush. |
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.
"one-liner" is a stretch of the definition of both "one" and "line" here
Gorgeous!! |
## Summary of the Pull Request Adds support for the `tab.showCloseButton` property to themes. This accepts three values: * `"always"` (default): The close button acts like it does today. * `"hover"`: The close button is always visible on the active tab. On inactive tabs, the close button only appears on mouse over. * `"never"`: The close button is never visible. You can't close the tab with middle-click, but you can still use keyboard shortcuts to close the tab. ## References * See #3327 *⚠️ targets #13178⚠️ ## PR Checklist * [x] Closes #3335 * [x] I work here * [ ] Tests added/passed * [n/a] Requires documentation to be updated - YUP ## Detailed Description of the Pull Request / Additional comments See the following two properties in WInUI that we're leveraging here. * [`TabViewCloseButtonOverlayMode.OnPointerOver`](https://docs.microsoft.com/en-us/windows/winui/api/microsoft.ui.xaml.controls.tabviewclosebuttonoverlaymode?view=winui-2.7&viewFallbackFrom=winui-2.2) * [`TabViewItem.IsClosable`](https://docs.microsoft.com/en-us/windows/winui/api/microsoft.ui.xaml.controls.tabviewitem.isclosable?view=winui-2.2#microsoft-ui-xaml-controls-tabviewitem-isclosable) One is a tabview-level property, the other is a per-tab-item property, hence why this code is a little wacky. ## Validation Steps Performed gifs below
🎉 Handy links: |
Summary of the Pull Request
Adds support for the
tab.background
property to themes. This is also a ThemeColor, so it accepts, colors,accent
, andterminalBackground
, just like everything else.References
PR Checklist
Detailed Description of the Pull Request / Additional comments
I apparently left behing an optional color in TerminalTab for theme colors some time ago, just never used it. Crazy, huh?
Validation Steps Performed
gifs below