-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Closed
Labels
Area-ThemingAnything related to the theming of elements of the windowAnything related to the theming of elements of the windowHelp WantedWe encourage anyone to jump in on these.We encourage anyone to jump in on these.In-PRThis issue has a related PRThis issue has a related PRIssue-TaskIt's a feature request, but it doesn't really need a major design.It's a feature request, but it doesn't really need a major design.Product-TerminalThe new Windows Terminal.The new Windows Terminal.good first issueThis is a fix that might be easier for someone to do as a first contributionThis is a fix that might be easier for someone to do as a first contribution
Milestone
Description
TabView is a part of WinUI, and that code is available over at https://github.com/microsoft/microsoft-ui-xaml/
I want to know if it's even possible on the current version of
TabViewto actualize what that enum would represent?
Hm.
terminal/src/cascadia/TerminalApp/TerminalPage.cpp
Lines 2740 to 2772 in a9c3b77
| if (const auto theme = _settings.GlobalSettings().CurrentTheme()) | |
| { | |
| const auto visibility = theme.Tab() ? theme.Tab().ShowCloseButton() : Settings::Model::TabCloseButtonVisibility::Always; | |
| for (const auto& tab : _tabs) | |
| { | |
| switch (visibility) | |
| { | |
| case Settings::Model::TabCloseButtonVisibility::Never: | |
| tab.TabViewItem().IsClosable(false); | |
| break; | |
| case Settings::Model::TabCloseButtonVisibility::Hover: | |
| tab.TabViewItem().IsClosable(true); | |
| break; | |
| default: | |
| tab.TabViewItem().IsClosable(true); | |
| break; | |
| } | |
| } | |
| switch (visibility) | |
| { | |
| case Settings::Model::TabCloseButtonVisibility::Never: | |
| _tabView.CloseButtonOverlayMode(MUX::Controls::TabViewCloseButtonOverlayMode::Auto); | |
| break; | |
| case Settings::Model::TabCloseButtonVisibility::Hover: | |
| _tabView.CloseButtonOverlayMode(MUX::Controls::TabViewCloseButtonOverlayMode::OnPointerOver); | |
| break; | |
| default: | |
| _tabView.CloseButtonOverlayMode(MUX::Controls::TabViewCloseButtonOverlayMode::Always); | |
| break; | |
| } | |
| } |
Note
Walkthrough
- We could take that, turn that into a method.
- Call that method every time the active tab changes...
- ... or the set of tabs changes.
- Get rid of all the calls to
_updateTabCloseButton, cause that only updates a single tab. - Add logic in that method
- Inside the loop, if the mode is
ActiveOnly, and the tab is active, thenIsClosable(true). elsefalse - Outside the loop, set
CloseButtonOverlayModetoAuto, probably a sensible default.
- Inside the loop, if the mode is
That sounds like it would work on paper. Wanna file a PR? 😄
Originally posted by @zadjii-msft in #3335 (comment)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Area-ThemingAnything related to the theming of elements of the windowAnything related to the theming of elements of the windowHelp WantedWe encourage anyone to jump in on these.We encourage anyone to jump in on these.In-PRThis issue has a related PRThis issue has a related PRIssue-TaskIt's a feature request, but it doesn't really need a major design.It's a feature request, but it doesn't really need a major design.Product-TerminalThe new Windows Terminal.The new Windows Terminal.good first issueThis is a fix that might be easier for someone to do as a first contributionThis is a fix that might be easier for someone to do as a first contribution
Type
Projects
Status
Done