Skip to content
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 per-profile tab colors #7162

Merged
merged 10 commits into from
Aug 7, 2020

Conversation

zadjii-msft
Copy link
Member

@zadjii-msft zadjii-msft commented Aug 3, 2020

Summary of the Pull Request

profile-tabColor-000

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.

References

PR Checklist

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

Played with setting this color, both on launch and via hot-reload

@ghost ghost added Area-Settings Issues related to settings and customizability, for console or terminal Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Product-Terminal The new Windows Terminal. labels Aug 3, 2020
Copy link
Member Author

@zadjii-msft zadjii-msft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey these are some obvious mistakes I made

src/cascadia/TerminalApp/Profile.cpp Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/Tab.cpp Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/TerminalPage.cpp Outdated Show resolved Hide resolved
// Color | | Set by
// -------------------- | -- | --
// Runtime Color | _optional_ | Color Picker / `setTabColor` action
// Control Tab Color | _optional_ | Profile's `tabColor`, or a color set by VT
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"or a color set by VT"

Shouldn't this be in the line above with "Runtime Color"?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh so I'm thinking that this operates more like the tab title, which can be set by VT, but the VT title can also be overridden temporarily at runtime the tab renamer.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also note that I'm not sure that there is a VT sequence for setting the tab color, that's purely a hypothetical

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also note that I'm not sure that there is a VT sequence for setting the tab color, that's purely a hypothetical

One could argue setting the title to a text string with a VT-sequence to set the background color could reasonably be interpreted as a request / intent to set the tab (or titlebar if tabs are disabled )color.

src/types/inc/utils.hpp Outdated Show resolved Hide resolved
src/inc/til/coalesce.h Outdated Show resolved Hide resolved
Copy link
Member

@DHowett DHowett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused about why TerminalSettings/Terminal/Core need to know the app-provided color. It seems like we're using TS as a go-between so two parts of TerminalApp can talk to eachother...

@ghost ghost added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Aug 6, 2020
@ghost ghost removed the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Aug 6, 2020
@zadjii-msft
Copy link
Member Author

@DHowett and I discussed this and he's more okay with it now that we've considered the fact that the color needs to be associated with each individual control, not just per-tab. It's more like and extension of titlebar state:

  • titlebar text
  • titlebar color
  • titlebar icon

etc.

…rofile-tab-color-impl

# Conflicts:
#	src/cascadia/UnitTests_TerminalCore/MockTermSettings.h
@@ -34,6 +34,8 @@ namespace Microsoft.Terminal.TerminalControl
String WordDelimiters;

Boolean ForceVTInput;

Windows.Foundation.IReference<UInt32> TabColor;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be an IControlSetting instead of an ICoreSetting?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, I was imagining this as just another thing that's similar to the title. If VT can modify the "title color" of the terminal, then that's something that's owned by the Core, not the control. It's the same way title "text" works now.

@DHowett DHowett merged commit 4e0f313 into master Aug 7, 2020
@DHowett DHowett deleted the dev/migrie/f/1337-profile-tab-color-impl branch August 7, 2020 23:07
@ghost
Copy link

ghost commented Aug 26, 2020

🎉Windows Terminal Preview v1.3.2382.0 has been released which incorporates this pull request.:tada:

Handy links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Settings Issues related to settings and customizability, for console or terminal Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Product-Terminal The new Windows Terminal.
Projects
None yet
5 participants