emilk / eframe_template

The easy way to make a Rust app with a GUI

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Moving the mouse after expanding the sidebar causes it to go back to original size

iantimmis opened this issue · comments

Steps to reproduce issue:

  • Opened the example web app at emilk.github.io/eframe_template
  • Drag the bar on the right side of the side panel further to the right, release the mouse
  • Move your mouse

The side bar will shrink back to original size.

EDIT:

This happened on 2 computers in the browser, I also downloaded the source code, ran cargo run --release and the mac native compiled version does this as well. Really don't like this behavior.

commented

Thanks for reporting this. I noticed this too, so I looked into it.

The egui documentation for SidePanel offers more information: https://docs.rs/egui/0.21.0/egui/containers/panel/struct.SidePanel.html#method.resizable

As far as I can tell, if there isn't a widget that expands, the panel won't keep its new size. So, a resizable panel must contain:

Placing a Separator in both the panels of the eframe_template example resolved the issue for me.