Skip to content

Clear background broken? #183

Closed
Closed
@Morphexe

Description

@Morphexe

Describe the bug
It seems clear_background is no longer working (or I am doing something wrong), but reverting to my previous version it all works

To Reproduce

   fn clear_background(&self, window: &Self::Tab) -> bool {
        false  // or true makes no difference
    }

Expected behavior
I expect my tabs to be transparent/not cleared

Additional context
Seems to be a regression from 0.6.3 somehow, since I rollback it does seem to work properly.

Activity

Adanos020

Adanos020 commented on Sep 19, 2023

@Adanos020
Owner

Ah, this issue again. Thanks for reporting!

Morphexe

Morphexe commented on Sep 19, 2023

@Morphexe
ContributorAuthor

Not sure if this helps, and I am quite new at RUST - but making the style.tab.body transparent does make it work. Is there a way to do per tab background color that I missed? Seems it should be fairly easy to add to the trait as well in conjuction with the clear-background?

Morphexe

Morphexe commented on Sep 20, 2023

@Morphexe
ContributorAuthor

So the culprit is this in this file leaf.rs

            ui.painter().rect(
                rect_stroke_box(tab_body_rect, tabs_style.tab_body.stroke.width),
                tabs_style.tab_body.rounding,
                   tabs_style.tab_body.bg_fill,
                tabs_style.tab_body.stroke,
            );

Although I am not 100% sure if this is the correct approach

            ui.painter().rect(
                rect_stroke_box(tab_body_rect, tabs_style.tab_body.stroke.width),
                tabs_style.tab_body.rounding,
                   Color32::TRANSPARENT,
                tabs_style.tab_body.stroke,
            );

Seems to sort this out.

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 working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Clear background broken? · Issue #183 · Adanos020/egui_dock