sublimehq / sublime_text

Issue tracker for Sublime Text
https://www.sublimetext.com
807 stars 39 forks source link

[Themes] Make popup_control support luminosity attributes #3873

Open AmjadHD opened 3 years ago

AmjadHD commented 3 years ago

Problem description

popup_control doesn't support luminosity attributes.

Preferred solution

make it support luminosity attributes based on the view's bg color.

deathaxe commented 3 years ago

It appears title_bar is the only parent which can be used to check luminosity.

        {
            "class": "popup_control",
            "parents": [
                {"class": "title_bar", "attributes": ["file_medium_dark"]},
            ],
            "layer0.tint": "white",
        },
AmjadHD commented 3 years ago

it doesn't work for me.

deathaxe commented 3 years ago

Yes, tried with ST4094.

This is what DAneo uses in general. The tint defines the overlay color, which is blended with the editor's background color. The opacity is the amount of blending. The example below makes the popup 15% darker than the view's background.

        {
            "class": "popup_control",
            "layer0.tint": "black",
            "layer0.opacity": 0.15
        },
AmjadHD commented 3 years ago

No, still very contrasting even with opacity set to 0.0005: image image

AmjadHD commented 3 years ago

What I want is this:

deathaxe commented 3 years ago

It's working fine in ST4, but I see the DAneo ST3 branch using another approach, because popups don't handle opacity well.

        {
            "class": "popup_control",
            "content_margin": 1,
            "layer0.tint": "color(black blend(var(bg) 15%))",
            "layer0.opacity": 1.0
        },
wbond commented 3 years ago

ST3 and ST4 use different approaches to popups. As of build 4075 popups are rendered wholly within the main editor window as a "virtual" popup. This means it is just drawn over the existing content in that area. In builds before that they were separate operating system windows.

In general with operating system windows, unless a window is set to allow transparency, it won't work. I think that is what you are running into on ST3 @AmjadHD.

AmjadHD commented 3 years ago

The issue is not about opacity but luminosity attributes.

wbond commented 3 years ago

No, still very contrasting even with opacity set to 0.0005:

I was replying to this.