Add a setting to enable the using the Accent Color for the titlebar #2761

Closed
opened 2026-01-30 23:04:22 +00:00 by claunia · 13 comments
Owner

Originally created by @ghost on GitHub (Jul 14, 2019).

Originally assigned to: @zadjii-msft on GitHub.

Summary of the new feature/enhancement

My feature request is the following: Currently, there is this huge tab at the left of window Title:
https://i.imgur.com/NkCGn3f.jpg but the problem here is, that I am using an accent color that overwrites the title bar for every application.

So I wanted to ask if it would be possible to give us a feature, that we can change that the color of the title bar on the left to the other color, or at least a feature that it automatically gets the same color as the accent color.

Thanks for reviewing.

Originally created by @ghost on GitHub (Jul 14, 2019). Originally assigned to: @zadjii-msft on GitHub. # Summary of the new feature/enhancement My feature request is the following: Currently, there is this huge tab at the left of window Title: https://i.imgur.com/NkCGn3f.jpg but the problem here is, that I am using an accent color that overwrites the title bar for every application. So I wanted to ask if it would be possible to give us a feature, that we can change that the color of the title bar on the left to the other color, or at least a feature that it automatically gets the same color as the accent color. Thanks for reviewing.
Author
Owner

@zadjii-msft commented on GitHub (Jul 16, 2019):

I'm changing the title to be slightly more specific.

After #929 we stopped using the accent color, and started drawing the entire titlebar ourselves.

#1934 made the appearance of the titlebar better, but still doesn't use the accent color.

We'll need some way of setting the resources at runtime to override the Background property of the TitlebarControl (introduced in #1948).

This is also related to #1625.

@zadjii-msft commented on GitHub (Jul 16, 2019): I'm changing the title to be slightly more specific. After #929 we stopped using the accent color, and started drawing the entire titlebar ourselves. #1934 made the appearance of the titlebar _better_, but still doesn't use the accent color. We'll need some way of setting the resources at runtime to override the Background property of the TitlebarControl (introduced in #1948). This is also related to #1625.
Author
Owner

@WSLUser commented on GitHub (Jul 18, 2019):

Any way ColorTool can help with this too? At some point, it may be better to merge Terminal and ColorTool together and use ColorTool for the colors and Terminal settings for applying them based on what's configured in the Settings UI (alternatively the json). I don't think too much rework would be needed here as the functionality would remain but the commands used for executing would be altered. While ColorTool can remain useful on it's own, anybody who can will probably use the Windows Terminal, especially once it reaches v1.

@WSLUser commented on GitHub (Jul 18, 2019): Any way ColorTool can help with this too? At some point, it may be better to merge Terminal and ColorTool together and use ColorTool for the colors and Terminal settings for applying them based on what's configured in the Settings UI (alternatively the json). I don't think too much rework would be needed here as the functionality would remain but the commands used for executing would be altered. While ColorTool can remain useful on it's own, anybody who can will probably use the Windows Terminal, especially once it reaches v1.
Author
Owner

@mdtauk commented on GitHub (Jul 18, 2019):

Are you able to query the registry to see if that setting is turned on?

image

@mdtauk commented on GitHub (Jul 18, 2019): Are you able to query the registry to see if that setting is turned on? ![image](https://user-images.githubusercontent.com/7389110/61492990-74c34700-a9aa-11e9-8b3a-62cc3a7bf552.png)
Author
Owner

@modscleo4 commented on GitHub (Jul 19, 2019):

Are you able to query the registry to see if that setting is turned on?

image

This could be done by accessing the registry key HKEY_CURRENT_USER\Software\Microsoft\Windows\DWM\ColorPrevalence

public Color ThemeColor
{
    get
    {
        var regBaseKey = RegistryKey.OpenBaseKey(RegistryHive.CurrentUser, RegistryView.Registry64);
        var regKey = regBaseKey.OpenSubKey(@"Software\Microsoft\Windows\DWM", RegistryKeyPermissionCheck.ReadSubTree);
        if  (regKey != null)
        {
            var value = regKey.GetValue("ColorPrevalence");
            if (value != null && Convert.ToBoolean(value))
            {
                value = regKey.GetValue("ColorizationColor");
                if (value != null) {
                    var color = (uint)(int)value;

                    return Color.FromArgb(
                        (byte)((0xFF000000 & color) >> 24),
                        (byte)((0x00FF0000 & color) >> 16),
                        (byte)((0x0000FF00 & color) >> 8),
                        (byte)((0x000000FF & color) >> 0));
                }
            }
        }

        // This is the default Windows 10 colorization color
        return Color.FromArgb(0xFF, 0x00, 0x78, 0xD7);
    }
}
@modscleo4 commented on GitHub (Jul 19, 2019): > Are you able to query the registry to see if that setting is turned on? > > ![image](https://user-images.githubusercontent.com/7389110/61492990-74c34700-a9aa-11e9-8b3a-62cc3a7bf552.png) This could be done by accessing the registry key `HKEY_CURRENT_USER\Software\Microsoft\Windows\DWM\ColorPrevalence` ```csharp public Color ThemeColor { get { var regBaseKey = RegistryKey.OpenBaseKey(RegistryHive.CurrentUser, RegistryView.Registry64); var regKey = regBaseKey.OpenSubKey(@"Software\Microsoft\Windows\DWM", RegistryKeyPermissionCheck.ReadSubTree); if (regKey != null) { var value = regKey.GetValue("ColorPrevalence"); if (value != null && Convert.ToBoolean(value)) { value = regKey.GetValue("ColorizationColor"); if (value != null) { var color = (uint)(int)value; return Color.FromArgb( (byte)((0xFF000000 & color) >> 24), (byte)((0x00FF0000 & color) >> 16), (byte)((0x0000FF00 & color) >> 8), (byte)((0x000000FF & color) >> 0)); } } } // This is the default Windows 10 colorization color return Color.FromArgb(0xFF, 0x00, 0x78, 0xD7); } } ```
Author
Owner

@justingallagher commented on GitHub (Oct 19, 2019):

I'm interested in taking a shot at a fix for this one. Would make sense to incorporate this into the existing requestedTheme setting (for example, adding darkAccent or lightAccent themes), or introduce an independent setting?

By default we'd want to follow the system setting, I'm hoping there's an API to read the setting in a more elegant way than digging through the registry.

@justingallagher commented on GitHub (Oct 19, 2019): I'm interested in taking a shot at a fix for this one. Would make sense to incorporate this into the existing `requestedTheme` setting (for example, adding `darkAccent` or `lightAccent` themes), or introduce an independent setting? By default we'd want to follow the system setting, I'm hoping there's an API to read the setting in a more elegant way than digging through the registry.
Author
Owner

@zadjii-msft commented on GitHub (Jan 9, 2020):

As an update to this thread - this is going to be addressed in a future update as a part of #3327. We're working on a spec currently, but that feature should address this issue in a more unified way with other similar feature requests.

@zadjii-msft commented on GitHub (Jan 9, 2020): As an update to this thread - this is going to be addressed in a future update as a part of #3327. We're working on a spec currently, but that feature should address this issue in a more unified way with other similar feature requests.
Author
Owner

@Poopooracoocoo commented on GitHub (Jul 22, 2021):

should this even be a setting? it should just be on when the windows setting is on

@Poopooracoocoo commented on GitHub (Jul 22, 2021): should this even be a setting? it should just be on when the windows setting is on
Author
Owner

@zadjii-msft commented on GitHub (Jul 22, 2021):

@Poopooracoocoo Yea, I'd still like this to be an independent setting. As a part of #3327, we're going to let people put whatever color they want there (not just their accent color), or match the color to the color in the terminal control, or throw Acrylic up there, or Mica, or whatever. Much more flexible than just the accent color.

@zadjii-msft commented on GitHub (Jul 22, 2021): @Poopooracoocoo Yea, I'd still like this to be an independent setting. As a part of #3327, we're going to let people put whatever color they want there (not just their accent color), or match the color to the color in the terminal control, or throw Acrylic up there, or Mica, or whatever. Much more flexible than just the accent color.
Author
Owner

@mdtauk commented on GitHub (Jul 23, 2021):

@Poopooracoocoo Yea, I'd still like this to be an independent setting. As a part of #3327, we're going to let people put whatever color they want there (not just their accent color), or match the color to the color in the terminal control, or throw Acrylic up there, or Mica, or whatever. Much more flexible than just the accent color.

With the colour picking, it would be neat to allow assigning the Accent Colour to various elements, like the cursor or selected background. Obviously when it comes to the theming, then that allows all kinds of possibilities.

@mdtauk commented on GitHub (Jul 23, 2021): > @Poopooracoocoo Yea, I'd still like this to be an independent setting. As a part of #3327, we're going to let people put whatever color they want there (not just their accent color), or match the color to the color in the terminal control, or throw Acrylic up there, or Mica, or whatever. Much more flexible than just the accent color. > With the colour picking, it would be neat to allow assigning the Accent Colour to various elements, like the cursor or selected background. Obviously when it comes to the theming, then that allows all kinds of possibilities.
Author
Owner

@ghost commented on GitHub (Sep 13, 2022):

:tada:This issue was addressed in #12992, which has now been successfully released as Windows Terminal Preview v1.16.252.🎉

Handy links:

@ghost commented on GitHub (Sep 13, 2022): :tada:This issue was addressed in #12992, which has now been successfully released as `Windows Terminal Preview v1.16.252`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.16.252) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Author
Owner

@ijprest commented on GitHub (Sep 13, 2022):

Is this really fixed? The color is influenced by the theme (light or dark), but I don't see the accent color being used, or any settings that reference it.

@ijprest commented on GitHub (Sep 13, 2022): Is this really fixed? The color is influenced by the theme (light or dark), but I don't see the accent color being used, or any settings that reference it.
Author
Owner

@DHowett commented on GitHub (Sep 13, 2022):

Yep! If you declare a new theme whose tabRow.backgroundColor is "accent", you'll get this:

image
    "theme": "Cool Things",
    "themes": 
    [
        {
            "name": "Cool Things",
            "tab": 
            {
                "background": "terminalBackground"
            },
            "tabRow": 
            {
                "background": "accent"
            }
        }
    ],

(We should look at offering more inbox themes.)

@DHowett commented on GitHub (Sep 13, 2022): Yep! If you declare a new theme whose `tabRow.backgroundColor` is `"accent"`, you'll get this: <img width="358" alt="image" src="https://user-images.githubusercontent.com/189190/190011919-3c5c7329-a1f6-4826-9539-622b77c3424a.png"> ```json "theme": "Cool Things", "themes": [ { "name": "Cool Things", "tab": { "background": "terminalBackground" }, "tabRow": { "background": "accent" } } ], ``` (We should look at offering more inbox themes.)
Author
Owner

@Poopooracoocoo commented on GitHub (Sep 14, 2022):

I was disappointed when I installed Terminal Preview and saw that this wasn't enabled when the Windows setting is enabled. Is there an issue for tracking respecting the system preference?

@Poopooracoocoo commented on GitHub (Sep 14, 2022): I was disappointed when I installed Terminal Preview and saw that this wasn't enabled when the Windows setting is enabled. Is there an issue for tracking respecting the system preference?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#2761