koalamer / vsc-workspace-in-status-bar

Extension for VSCode that displays the workspace name in the status bar
MIT License
7 stars 2 forks source link

[Enhancement | Suggestion] better color for statusbar entry #2

Closed frudolph77 closed 2 years ago

frudolph77 commented 2 years ago

Hey,

thanks for your very useful extensions.

But I've a small enhancement in mind: May be it's better to use statusBar.foreground as default color, which is used by every other entry in the statusbar, instead of statusBarItem.errorForeground.

statusBarItem.errorForeground interferes in some cases with the used theme, and the workspace is show in a different color, than all other items.

statusbar Statusbar with Atom One Dark Theme In this case it's a prominent white color, I've seen other themes or color configurations where this entry is barely visible. Such as black on dark gray.

Unfortunately it's not possible to set workspaceInStatusBar.text to "statusBar.foreground" as i requires a hard coded RGB value.

I'm using multiple color themes to differentiate multiple workspaces, and therefore it would be much easier not to configure Workspace In Statusbar for each workspace. And before find out the foreground color that is currently used.

Currently I've hacked the package.json:

"colors": [
    {
        "id": "workspaceInStatusBar.text",
        "description": "Color for the label in the status bar.",
        "defaults": {
            "dark": "statusBar.foreground",
            "light": "statusBar.foreground",
            "highContrast": "statusBar.foreground"
        }
    }
]

kind regards Frank

koalamer commented 2 years ago

Hello,

The different color for the workspace name in the status bar is intentional but since there was no other predefined status bar related highlight color available for this purpose, errorForeground was used. I'm not inclined to change this, sorry.

There is however an easy way to set the right custom color for multiple themes, using theme dependent config blocks in your settings.json instead of a single color definition. For example for Monokai it would look like this:

"workbench.colorCustomizations": {
    "[Monokai]": {
      "workspaceInStatusBar.text": "#7cd5f1"

I hope this helps!

koalamer commented 2 years ago

I hope, my response did actually help. Closing this issue.

frudolph77 commented 2 years ago

Sorry for the very late feedback. Thanks for your tip with colorCustomizations, but it doesn't fit what I have in mind. My attempt is to not have a hardwired color.

In any case, thanks for your support.

koalamer commented 1 year ago

After our exchange I realized that the theme color which is assigned to the label by default is not having any effect on most themes. So I guess it's not detrimental to remove the forced default after all....

koalamer commented 1 year ago

The changes were published.