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

Add StripBuilder::sense & TableBuilder::sense #1554

Closed
wants to merge 4 commits into from

Conversation

aleokdev
Copy link
Contributor

@aleokdev aleokdev commented May 1, 2022

Closes #1553.

@emilk
Copy link
Owner

emilk commented May 4, 2022

Adding a sense is good, but I think we should add a hover effect to it as well. Everything clickable in egui changes appearance when you hover it. This is what let's you know you can click it. You can follow this pattern:

if sense.click || sense.drag {
    let visuals = ui.style().interact(&response);
    ui.painter().rect(
        rect.expand(visuals.expansion),
        visuals.rounding,
        visuals.bg_fill,
        visuals.bg_stroke,
    );
}

@aleokdev
Copy link
Contributor Author

aleokdev commented May 4, 2022

Not too sure about how to do that. 😅 I've tried to put that in StripLayout::add after the rect allocation, using the allocated rect as the rect to use in the painter, but I just get entire rectangles:
Screenshot_20220504_122107

I'm not too sure how strips work internally either. Will need to dive into this a bit further.

@emilk
Copy link
Owner

emilk commented May 4, 2022

Ideally it should be drawn behind the row, but that's harder because #1516 isn't done yet. There is a hack for it, by using painter.add(Shape::Noop) (see egui::Frame for example).

@emilk
Copy link
Owner

emilk commented Jan 7, 2024

@emilk emilk closed this Jan 7, 2024
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.

Add sense param for tables
2 participants