Adanos020 / egui_dock

Docking support for egui – an immediate-mode GUI library for Rust
MIT License
458 stars 75 forks source link

Dragging and hovering tabs does not work correctly #226

Closed LennysLounge closed 4 months ago

LennysLounge commented 8 months ago

Describe the bug When dragging a tab it is suposed to follow the mouse but after it snaps into place the offset to the mouse is wrong. When hovering over tab it does not show the hovered style.

To Reproduce Steps to reproduce the behavior:

  1. Load the "simple" example.
  2. Hovering over a not selected tab does not show the hover style.
  3. Drag a "tab 2" tab over to the "tab 3" tab.

Screenshots

https://github.com/Adanos020/egui_dock/assets/25527438/feea0a06-18fd-464d-b81f-4720700fc857

Creating a dock area with this style should make it obvious that the hover effect is not working correctly.

        DockArea::new(&mut self.tree)
            .style({
                let mut style = Style::from_egui(ctx.style().as_ref());
                style.tab.hovered.bg_fill = egui::Color32::RED;
                style
            })
            .show(ctx, &mut TabViewer {});
Adanos020 commented 8 months ago

Hey, thanks for reporting this! I'll look into this as soon as I find some time.

enomado commented 8 months ago

Yesterday I've tried to run on recent egui. I can confirn this bug in egui 3672b150ed2c63f87f2a2c8c86ba639f0bbc7d81

but also I can say that drag is absolutely broken on a93c6cd5d25ef966dca805073eb6f2e33f3075a2

when i hover on tab - only close button hovers. if there is no close button - dragging is also not working.

Seems something in egui dragging api is not working?

Adanos020 commented 7 months ago

Hi @LennysLounge, could you verify if this issue is still present on release-0.12? I think I might've finally solved it.