Skip to content

Color's and Fonts Preference Page Not Correctly Resetting Default values when switching form dark to light theme #2500

@BeckerWdf

Description

@BeckerWdf
Contributor

Let's make sure issue is not already fixed in latest builds first.

  • I verified I can reproduce this issue against latest Integration Build of Eclipse SDK

Steps to reproduce

From a fresh installation and clean workspace:

  • In “Dark” theme set a user defined color value.
  • Press “Apply”.
  • Change theme to “Light”.
  • Press “Apply” but don’t restart.

I expected:

Color value is not the correct default value from the light theme.

But got:

User defined value still there. Re-opening the preference dialog or restarting the IDE does not change this.

Put pressing "Reset" does the trick.

Tested under this environment:

  • OS & version: macOS

Community

  • I understand reporting an issue to this OSS project does not mandate anyone to fix it. Other contributors may consider the issue, or not, at their own convenience. The most efficient way to get it fixed is that I fix it myself and contribute it back as a good quality patch to the project.

I found this be testing #2421.
See: #2421 (comment)

Activity

HaydenTran-C03057950

HaydenTran-C03057950 commented on Mar 4, 2025

@HaydenTran-C03057950

I'm working on this

wliu4040

wliu4040 commented on Mar 30, 2025

@wliu4040

What's the expected behavior? Should switching themes always reset the colors back to the default? Should there be save states for each themes? Should a new "custom" theme be created if a user defines a color?

lars-v-bui

lars-v-bui commented on Apr 6, 2025

@lars-v-bui

How mant users use this project?

HaydenTran-C03057950

HaydenTran-C03057950 commented on Apr 8, 2025

@HaydenTran-C03057950

ViewsPreferencePage’s “performOk”
https://github.com/eclipse-platform/eclipse.platform.ui/blob/master/bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/internal/dialogs/ViewsPreferencePage.java#L342

ColorsAndFontsPreferencePage’s “performColorDefaults”

https://github.com/eclipse-platform/eclipse.platform.ui/blob/master/bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/internal/themes/ColorsAndFontsPreferencePage.java#L1462

Our recommendation is that the code needs to be refactored in a way such that you can call the performDefaults method from ViewsPreferencePage.

We want to call ColorsAndFontsPreferencePage’s “performColorDefaults” method in ViewsPreferencePage’s “performOk” when the theme is changed. With this change, whenever the user switches from Dark to Light theme or vice versa, this should reset the current color value to the default color value of the theme the user is currently in.

After coming up with the idea, our team scheduled a meeting with the CodeDay TA to discuss our approach. Unfortunately, after reviewing the question, he suggested that we shouldn’t pursue this fix, as it wasn’t actually an issue. He explained that the developer intended for users to manually restore defaults, as overwriting user-defined values without their consent can lead to unintended consequences when building an application.

This is my school github.
Here is my personal github: @hongantran3804. If you have any further questions about this reply

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomershelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @BeckerWdf@lars-v-bui@wliu4040@HaydenTran-C03057950

        Issue actions

          Color's and Fonts Preference Page Not Correctly Resetting Default values when switching form dark to light theme · Issue #2500 · eclipse-platform/eclipse.platform.ui