Add tab.closeButton: activeOnly #18099

Open
opened 2026-01-31 06:03:37 +00:00 by claunia · 0 comments
Owner

Originally created by @zadjii-msft on GitHub (Aug 4, 2022).

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 TabView to actualize what that enum would represent?

Hm.
a9c3b7724c/src/cascadia/TerminalApp/TerminalPage.cpp (L2740-L2772)

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, then IsClosable(true). else false
    • Outside the loop, set CloseButtonOverlayMode to Auto, probably a sensible default.

That sounds like it would work on paper. Wanna file a PR? 😄

Originally posted by @zadjii-msft in https://github.com/microsoft/terminal/issues/3335#issuecomment-1203867172

Originally created by @zadjii-msft on GitHub (Aug 4, 2022). `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 `TabView` to actualize what that enum would represent? Hm. https://github.com/microsoft/terminal/blob/a9c3b7724c05a0da059c4a0433ea446f8e19cbff/src/cascadia/TerminalApp/TerminalPage.cpp#L2740-L2772 > **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, then `IsClosable(true)`. else `false` - Outside the loop, set `CloseButtonOverlayMode` to `Auto`, probably a sensible default. That sounds like it would work on paper. Wanna file a PR? 😄 _Originally posted by @zadjii-msft in https://github.com/microsoft/terminal/issues/3335#issuecomment-1203867172_
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#18099