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

[Themes] text_line_control color_scheme_tint caching issues #6463

Open
jwortmann opened this issue Aug 23, 2024 · 2 comments
Open

[Themes] text_line_control color_scheme_tint caching issues #6463

jwortmann opened this issue Aug 23, 2024 · 2 comments

Comments

@jwortmann
Copy link

Description of the bug

The color_scheme_tint property for text_line_control in the command palette is not always applied correctly for a certain combination of theme rules.

This bug was reported earlier for the find panel in #3901 and reported to be fixed, but it seems like the fix does not apply in all situations.

Steps to reproduce

  1. Start ST in safe mode.

  2. Select "UI: Customize Theme" from the command palette and paste

    {
        "rules":
        [
            {
                "class": "text_line_control",
                "color_scheme_tint": "black"
            },
            {
                "class": "text_line_control",
                "parents": [{"class": "window", "attributes": ["file_light"]}],
                "color_scheme_tint": "white"
            }
        ]
    }

    If a light color scheme is selected, the second rule should override the color_scheme_tint property of the first rule. So this should make the background of input fields white if a light color scheme is selected, and otherwise black.

  3. Apply a light color scheme (e.g. Breakers).

  4. Open the command palette and observe that the input field is initially black until you hover with the mouse over the command palette overlay. This can be reproduced whenever the command palette is closed and opened again.

    Note that the input fields in the bottom panels ("Find", etc.) initially also have the wrong color with a light color scheme until you hover with the mouse over the panel, but then the color will stay correct even when the panel is closed and opened again. This behavior can be reset after switching to a dark color scheme, opening and closing the panel, and then switching back to a light color scheme again.

    Note also that the color always works correctly for the "Goto Anything", "Goto Symbol" and "Goto Line" overlays.

Expected behavior

With a light color scheme, the input field in the command palette should always be white.

Actual behavior

The input field is black until you hover with the mouse over the command palette.

Sublime Text build number

4180

Operating system & version

Windows 11

(Linux) Desktop environment and/or window manager

No response

Additional information

I think I found a workaround by removing the first theme rule and replacing it with separate rules which are restricted to the luminosity attributes:

{
    "rules":
    [
        {
            "class": "text_line_control",
            "parents": [{"class": "window", "attributes": ["file_medium"]}],
            "color_scheme_tint": "black"
        },
        {
            "class": "text_line_control",
            "parents": [{"class": "window", "attributes": ["file_medium_dark"]}],
            "color_scheme_tint": "black"
        },
        {
            "class": "text_line_control",
            "parents": [{"class": "window", "attributes": ["file_dark"]}],
            "color_scheme_tint": "black"
        },
        {
            "class": "text_line_control",
            "parents": [{"class": "window", "attributes": ["file_light"]}],
            "color_scheme_tint": "white"
        }
    ]
}

But this should not be necessary; the first code snippet should be enough to make it work with all luminosity attributes.

OpenGL context information

No response

@deathaxe
Copy link
Collaborator

Maybe related with #3929.

@deathaxe
Copy link
Collaborator

The bug also affects badges, which keep old color after input panel updated color due to hover event.

grafik

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

No branches or pull requests

2 participants