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

set default value of colorTheme and iconTheme preference #7174

Closed
wants to merge 2 commits into from

Conversation

tom-shan
Copy link
Contributor

vscode python plugin will read workbench.colorTheme,
if not find it will use the default value of Default Light+
(https://github.com/microsoft/vscode-python/blob/2008c14f4ca7305ad6aaee436174fe24a5a6c283/src/client/datascience/webViewHost.ts#L175)
which will cause the mismatch of jupyter notebook and current theia theme colors.

BTW set the default value of workbench.iconTheme

Signed-off-by: tom-shan swt0008411@163.com

What it does

How to test

Review checklist

Reminder for reviewers

@akosyakov akosyakov added theming issues related to theming vscode issues related to VSCode compatibility labels Feb 19, 2020
@akosyakov
Copy link
Member

akosyakov commented Feb 19, 2020

It does not work for end products, since they can change default values dynamically and values cannot be hard coded. The real default values can be retrieved from ThemeService.defaultTheme and IconThemeService.default. I'm not sure how properly fix it right now. Probably the default preference provider should listen to this service and react to changes of default values.

cc @spoenemann @jbicker How do you change the default theme for Arduino Pro IDE?

@jbicker
Copy link
Contributor

jbicker commented Feb 19, 2020

@akosyakov
We set it in package.json in the app folder:

...
"theia": {
    "frontend": {
      "config": {
        "applicationName": "Your app name",
        "defaultTheme": "your-theme-id",
        "preferences": {
          "editor.autoSave": "on"
        }
      }
    },
...

@akosyakov
Copy link
Member

ok, then we have to:

  • introduce defaultIconTheme as well which can be configured in package.json
  • make sure that extensions cannot change default themes programmatically only via package.json
  • use default color and icon themes from FrontendApplicationConfigProvider.get() for preferences and corresponding services

@tom-shan Let me know if you need more hints.

@tom-shan tom-shan force-pushed the preference-colorTheme branch from 0ad5454 to cecea49 Compare February 21, 2020 00:58
@tom-shan tom-shan requested a review from akosyakov February 21, 2020 06:53
@tom-shan tom-shan force-pushed the preference-colorTheme branch 5 times, most recently from 7d28e47 to 96ed1c7 Compare February 24, 2020 14:28
@akosyakov
Copy link
Member

It does not work, I've tried to change to in package.json and rebuild:

"defaultTheme": "light",
        "defaultIconTheme": "vs-minimal",

but on the start icon theme was none, and color theme was dark :(

1 vscode python plugin will read workbench.colorTheme,
if not find it will use the default value of Default Light+
(https://github.com/microsoft/vscode-python/blob/2008c14f4ca7305ad6aaee436174fe24a5a6c283/src/client/datascience/webViewHost.ts#L175)
which will cause the mismatch of jupyter notebook and current theia theme colors.
2 set the default value of workbench.iconTheme

Signed-off-by: tom-shan <swt0008411@163.com>
@tom-shan tom-shan force-pushed the preference-colorTheme branch from 96ed1c7 to 5876cbe Compare February 25, 2020 09:00
@tom-shan
Copy link
Contributor Author

@akosyakov
Copy link
Member

@tom-shan it would explain icon theme, but color theme is not registered by plugins. I'm worrying that delaying reading from preferences will lead to flickering. Need to think how to test different cases.

@tom-shan
Copy link
Contributor Author

it would explain icon theme, but color theme is not registered by plugin

I tested again with the previous version (without delaying reading from preferences) and can not repoduce the color theme problem now.

@tom-shan
Copy link
Contributor Author

tom-shan commented Feb 25, 2020

I'm worrying that delaying reading from preferences will lead to flickering. Need to think how to test different cases.

the flicker really exists, have tested two cases:
1 default color theme: light
"workbench.colorTheme" in settings.json: Monokai
1.1 pre-cleaning chrome site data
dark -> light -> Monokai
1.2 no pre-cleaning chrome site data
Monokai

2 default color theme: Monokai
"workbench.colorTheme" in settings.json: light
1.1 pre-cleaning chrome site data
dark -> Monokai -> light
1.2 no pre-cleaning chrome site data
light

@akosyakov
Copy link
Member

@tom-shan ok, could you revert it to previous version, I will try to test it more. I don't think current version is good it delays theming load too much, especially for restored themes from browser caches it should happen even before preload screen.

…nces)

Signed-off-by: tom-shan <swt0008411@163.com>
@tom-shan
Copy link
Contributor Author

@akosyakov please try again

@akosyakov
Copy link
Member

I've tried it but it's still blinking between dark and default theme on refresh, i.e. try to change to red and then refresh. I will have a look tomorrow what can be done.

@akosyakov
Copy link
Member

Closed in favor of #8381 @tom-shan it is based on your PR and you are added as a co-author in the commit

@akosyakov akosyakov closed this Aug 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theming issues related to theming vscode issues related to VSCode compatibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants