Terminal: Add a setting to enable the using the Accent Color for the titlebar

Created on 14 Jul 2019  路  6Comments  路  Source: microsoft/terminal

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.

Area-Settings Area-User Interface Help Wanted Issue-Task Product-Terminal

Most helpful comment

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.

All 6 comments

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.

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.

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

image

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);
    }
}

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.

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  路  3Comments

warpdesign picture warpdesign  路  3Comments

zadjii-msft picture zadjii-msft  路  3Comments

mdtauk picture mdtauk  路  3Comments

alabuzhev picture alabuzhev  路  3Comments