Giter VIP home page Giter VIP logo

Comments (4)

abey79 avatar abey79 commented on May 31, 2024

Possible work around: disable all drawing by the SidePanel and emulate it from the closure:

impl eframe::App for MyApp {
    fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) {
        egui::CentralPanel::default().show(ctx, |ui| {
            egui::TopBottomPanel::bottom("bottom")
                .resizable(true)
                .show_animated_inside(ui, true, |ui| {
                    egui::ScrollArea::vertical().show(ui, |ui| {
                        for _ in 0..20 {
                            ui.label("bottom panel");
                        }
                    })
                });

            egui::SidePanel::left("left panel")
                .resizable(true)
                .frame(egui::Frame::default())
                .show_separator_line(false)
                .show_animated_inside(ui, true, |ui| {
                    ui.painter()
                        .rect_filled(ui.max_rect(), 0.0, egui::Color32::RED);
                    ui.painter().vline(
                        ui.max_rect().right(),
                        ui.max_rect().y_range(),
                        ui.style().visuals.widgets.noninteractive.bg_stroke,
                    );
                    ui.set_clip_rect(ui.max_rect());

                    for _ in 0..20 {
                        ui.label("left panel");
                    }
                });
        });
    }
}
image

Note:

  • for a better effect, the outer CentralPanel must have zero inner margin
  • this work around is imperfect: the on-hover separator line still overlaps the bottom panel

from egui.

abey79 avatar abey79 commented on May 31, 2024

An obvious workaround is to wrap the entire content of the SidePanel in a ScrollArea. However, this is not convenient in every case, for example when the panel content is already made of multiple, independent scroll areas (e.g. rerun's left panel).

from egui.

s-nie avatar s-nie commented on May 31, 2024

May be related to #4349

from egui.

emilk avatar emilk commented on May 31, 2024

I think we need two things to solve this:

  • Add a clip-rect for panels, so that if they overflow, it is invisible
  • Respect the clip-rect in the interaction code, so you cannot hover/click invisible stuff

from egui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.