-
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 hiding the tab close button #13348
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
…f/702-link-tab-to-terminal
…f/702-link-tab-to-terminal
…f/3335-tab-close-btn
…-close-btn # Conflicts: # src/cascadia/LocalTests_SettingsModel/ThemeTests.cpp # src/cascadia/TerminalApp/AppLogic.cpp # src/cascadia/TerminalApp/AppLogic.h # src/cascadia/TerminalApp/TerminalPage.cpp # src/cascadia/TerminalApp/TerminalPage.h # src/cascadia/TerminalSettingsEditor/GlobalAppearance.cpp # src/cascadia/TerminalSettingsEditor/GlobalAppearance.h # src/cascadia/TerminalSettingsEditor/GlobalAppearance.idl # src/cascadia/TerminalSettingsEditor/GlobalAppearance.xaml # src/cascadia/TerminalSettingsModel/CascadiaSettingsSerialization.cpp # src/cascadia/TerminalSettingsModel/MTSMSettings.h # src/cascadia/TerminalSettingsModel/TerminalSettingsSerializationHelpers.h # src/cascadia/TerminalSettingsModel/Theme.cpp # src/cascadia/TerminalSettingsModel/Theme.h # src/cascadia/TerminalSettingsModel/Theme.idl # src/cascadia/WindowsTerminal/AppHost.cpp
// This is basically the same as _updateTabCloseButton, but with some | ||
// code moved around to better facilitate updating every tab view item | ||
// at once |
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.
Personally, I'd rather prioritize having the code de-duplicated in case we need to make a bugfix or any code changes down the road. But that's just my 2 cents. Not gonna block over it.
Hello @zadjii-msft! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
🎉 Handy links: |
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
tab.background
to themes #13178PR Checklist
Detailed Description of the Pull Request / Additional comments
See the following two properties in WInUI that we're leveraging here.
TabViewCloseButtonOverlayMode.OnPointerOver
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