Skip to content

Fixes to issue #2522 Enable Theming Checkbox #2606

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

mai-tran-03
Copy link

I added more functionality when the enableTheming button is selected. It would display the theme-dependent components if selected, otherwise hide them. We need to restart twice when theming is disabled.

Fixes #2522

Copy link

@IamLRBA IamLRBA left a comment

Choose a reason for hiding this comment

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

@mai-tran-03 Hi,
Thanks for the contribution, I am trying to understand your take on this issue.
If possible, could you please share some screenshots showing if these changes tackle and rectify the issue when you reproduce it.
Thank You!

Retrace steps to toggle themingEnabled button and show/hide its content
@mai-tran-03
Copy link
Author

@IamLRBA Hello,

The issue I'm trying to fix is when the user toggles the "Enable theming" button in Settings > General > Appearance, it should show/hide the selection of themes. It's counterintuitive to have to reset twice to apply the button changes.

image

My solution is to create separate functions to handle theme-dependent vs independent composites. In eclipse.ui.workbench/.../internal/dialogs/ViewsPreferencePage.java

createContents()

  1. createEnableTheming() - when the user first opens the preference settings page, it should display the above window with the current value of the enabled-theme key themingEnabled (on/off)

  2. createThemeDependentComposite() - group together the elements, such as theme and color combo dropdown and tab icons, that depend on themingEnabled being selected; it will display/hide those elements when user toggles using updateThemingEnablement() (tacking on selectionListener to themingEnabled button)

  • createThemeIdCombo() - move around this code (creating the theme dropdown menu) to encapsulate related functions
image
  1. createThemeIndependentComposite() - group together the elements, such as buttons for round tabs, mixed font and color labels, and most recently used tabs, that don't depend on themingEnabled being selected
image

Below is a video demonstrating how my changes resolved part of the issue:

  • if engine == null - the page only shows the basic buttons that do not rely on themingEnabled, that means disabling themingEnabled is the same as disabling engine
  • The engine is needed to create the theme combo dropdown and other components that depend on the engine to be initialized
  • Resetting twice: (1) initialize engine so it can getThemes(); and (2) apply any other new changes

https://youtu.be/LdVrXZAM8zA?si=wCbBxKsdkJjCTSyg

Copy link

@IamLRBA IamLRBA left a comment

Choose a reason for hiding this comment

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

Hey @mai-tran-03,
Well done, I'm interested in following what you are doing.
I see themeDependentComp was added but isn’t used yet. Should it affect UI behavior? If so, its integration might not be complete because i see you haven't initialized it yet.

@mai-tran-03
Copy link
Author

@IamLRBA Thank you for your feedback.
In my most recent commit f241b1b, I removed the private global themeDependentComp variable, instead, I declared and initialized it in the createThemeDependentComposite method. So it is not referenced elsewhere in the class beyond that method.

  • The variable is used inside createThemeDependentComposite, serving as a container for UI elements related to theme-dependent settings.
  • It affects the UI, in which its visibility and layout depend on updateThemingEnablement, controlling whether the themeDependentComp section is visible based on the state of themingEnabled.

@BeckerWdf
Copy link
Contributor

@vogella: Can you provide some input why up to now these two restarts are necessary?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable theming preference check box is not working as expected and forces to restart twice
3 participants