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

Improve theme preference selection #11678

Merged
merged 2 commits into from
Sep 22, 2022
Merged

Improve theme preference selection #11678

merged 2 commits into from
Sep 22, 2022

Conversation

msujew
Copy link
Member

@msujew msujew commented Sep 16, 2022

What it does

Closes #11672

Changes the preferences for color theme and icon theme to use an enum. In order to facilitate label displaying and changing the associated preference schemas during runtime some more changes had to be performed:

  1. Support for enumItemLabels in PreferenceSelectInput
  2. Add updateSchemaProperty method to PreferenceSchemaProvider that triggers the associated change event.
  3. Creating and storing keys for each preference while rendering. Allows us to identify which preferences have changed. The previous method only could tell whether a preference was removed/added.

How to test

  1. Open the preferences and search for the file/color theme preference
  2. It should be a select component and display all currently displayed themes
  3. Changing to another file/color theme applies the change as expected
  4. Installing a new file/color theme using plugins updates the preference widget and allows to select the newly installed theme

Note that uninstalling color themes doesn't work correctly due to #11676.

Review checklist

Reminder for reviewers

@msujew msujew added preferences issues related to preferences theming issues related to theming labels Sep 16, 2022
Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

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

LGTM 👍

  • both the color and icon theme use a select component for theming similarly to vscode
  • changing color and icon themes work as expected
  • the list is correctly sorted, and the default value is identified
  • resetting the color and icon themes work as expected (the list is correctly updated)
  • installing new themes are listed in the dropdown

@msujew msujew merged commit a49d7b7 into master Sep 22, 2022
@msujew msujew deleted the msujew/select-themes branch September 22, 2022 12:18
@github-actions github-actions bot added this to the 1.30.0 milestone Sep 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
preferences issues related to preferences theming issues related to theming
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Settings for color theme and icon theme in preferences should probably be a drop-down box
2 participants