-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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 a setting to enable the using the Accent Color for the titlebar #1963
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. |
This could be done by accessing the registry key 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 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. |
should this even be a setting? it should just be on when the windows setting is on |
@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. |
#####⚠️ targeting 1.15 ## Summary of the Pull Request Adds support for Themes, a new type of customization for the Terminal. Themes allow the user to customize elements of the Terminal window itself. In this first iteration, this PR adds support for two main properties: * enabling Mica as the window backdrop * changing the tab row color (read: changing the titelbar color) These represent the most important asks of theming in the Terminal. The properties added in this PR are: * Theme color variants: - `"#rrggbb"` or `"#aarrggbb"` - `"accent"` - `"terminalBackground"` * Properties (_listed here in dot notation, but implemented as sub-objects_) - `tabRow.background`: accepts a ThemeColor (above) - `window.applicationTheme`: accepts one of `{"system", "light", "dark"}` - `window.useMica`: accepts a boolean, defaults to false. ## References * As first described in #3327 * spec'd in #12530 ## PR Checklist * [x] Sorta enables #10509, but doesn't close it. That'll need more comprehensive changes to the titlebar code. * **update**: I totally disabled mica, but left the serialization code. It just seems silly without #10509. * [x] Closes #1963 * [x] Closes #3774 * [x] Closes #12939 * [x] Does the bulk of the #3327 work, but I'm going to leave that open since that's become my megathread for everything related to theming. * [x] I work here * [x] Tests added/passed * [ ] Requires documentation to be updated - **SURE DOES** ## Detailed Description of the Pull Request / Additional comments ### --> GO READ #12530 <-- Seriously. These themes aren't customizable in the SUI currently. You can change the active theme, and the UI will show all of the defined themes, but they're not editable there. They don't layer. You'll need to define your own themes. Thay can't come from fragments. This is a really cool future idea, but not implemented in this v0. The sub objects have some gnarly macros to generate a lot of the serialization code for you. ### TODOs * [x] I still have yet to establish what the accent color algorithm is. This might be proprietary and require a ThemeHelpers workaround. * [x] Make sure `terminalBackground` & the SUI result in something sensible * [x] Make sure runtime BG changes work with `terminalBackground`. One time, they didn't. `printf "\x1b]11;rgb:ff/00/ff\x07"` * [x] Acrylic Terminal BG's look weird, like, the opacity is always 50% or something. And the tab row looks all wrong then. ## Validation Steps Performed This is the blob I've been testing with: <details> ```jsonc // "useAcrylicInTabRow": true, "theme": "my dark", // "theme": "Edge", "theme": "orangey", "theme": "WHITE", // "theme": "terminal", "themes": [ { "name": "my dark", "window": { "applicationTheme": "dark", "useMica": true, }, "tabRow": { "background": "#00000000", }, }, { "name": "Edge", "tabRow": { "background": "accent" }, "window": { "applicationTheme": "system" } }, { "name": "orangey", "window": { "applicationTheme": "light", "useMica": true, }, "tabRow": { "background": "#ff8800", }, }, { "name": "WHITE", "window": { "applicationTheme": "dark", "useMica": true, }, "tabRow": { "background": "#FFFFFF", }, }, { "name": "terminal", "window": { "applicationTheme": "dark", "useMica": false, }, "tabRow": { "background": "terminalBackground", }, }, ] ``` </details>
🎉This issue was addressed in #12992, which has now been successfully released as Handy links: |
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. |
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? |
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.
The text was updated successfully, but these errors were encountered: