Skip to content

IDE startup theme based on OS theme #1160

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

Merged
merged 3 commits into from
Jul 18, 2022
Merged

Conversation

francescospissu
Copy link
Contributor

@francescospissu francescospissu commented Jul 8, 2022

Motivation

The theme of the IDE on first launch should be the same as the OS.

Change description

Implemented a patch that replaces the ThemeService.get().loadUserTheme(); function at startup by directly setting the theme based on the OS theme.
For all subsequent starts of the IDE the theme applied will be the last one set by the user.

Other information

With the current version of Theia adopted (1.25) it is not possible to extend the ThemeService, it will be possible starting from Theia 1.27.
Once the version of Theia is updated, this patch will be removed and this functionality will be implemented via dependency injection.

Closes #530.

Reviewer checklist

  • PR addresses a single concern.
  • The PR has no duplicates (please search among the Pull Requests before creating one)
  • PR title and description are properly filled.
  • Docs have been added / updated (for bug fixes / features)

@per1234 per1234 added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project topic: theme Related to GUI theming labels Jul 8, 2022
@kittaakos
Copy link
Contributor

kittaakos commented Jul 13, 2022

This should work: fspissu/startup-theme...kittaakos:arduino-ide:startup-theme-2.
If you have any questions, let me know.

Update: I think the long-term goal is to support dark and light themes in Theia natively and not customize the ThemeService with injection.

@francescospissu
Copy link
Contributor Author

Thanks for your support @kittaakos. In a later step I can create a contribution on Theia to achieve this directly there.

@francescospissu francescospissu marked this pull request as ready for review July 14, 2022 14:43
Copy link
Contributor

@kittaakos kittaakos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! I did not check the behavior but the code changes look good to me.


Could you please ask the Theia community why we need this hack?

Copy link
Contributor

@AlbyIanna AlbyIanna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice hack 😎

I tested it on MacOS and it works perfectly.

LGTM 🚀

@francescospissu francescospissu merged commit ed41b25 into main Jul 18, 2022
@francescospissu francescospissu deleted the fspissu/startup-theme branch July 18, 2022 07:03
@kittaakos kittaakos mentioned this pull request Jul 25, 2022
4 tasks
@per1234 per1234 mentioned this pull request Aug 20, 2022
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself topic: theme Related to GUI theming type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dark theme is used on clean start despite "Light (Arduino)" being the default
4 participants