Skip to content

Repository files navigation

Build Status Discord YouTube Channel Subscribers MakerPnP GitHub Organization's stars Donate via Ko-Fi Subscribe on Patreon

egui_tool_windows

Floating tool windows for egui that can be used in containers, like resize, scroll-area, frame, etc.

  • Simple API for adding multiple windows inside a container.
  • Independent z-ordering, when clicked they are sent to the front.
  • Collapsible.
  • Resizable.
  • Draggable.
  • Floats on top of content.
  • Constrained to the container.
  • Clipped to the container.
  • Tool windows are moved if the container is resized too small.

Regular egui::Window and egui::Area instances can be placed above them, they do not clash.

Basic API usage

egui::ScrollArea::both()
    .auto_shrink([false, false])
    .scroll_bar_visibility(ScrollBarVisibility::AlwaysVisible)
    .show(ui, |ui|{

        ui.strong("Content inside a frame");
        
        ToolWindows::new()
            .windows(ui, |builder|{
                builder
                    .add_window("id_salt_1")
                    .show("Title 1".to_string(), |ui| {
                        ui.label("Tool window 1");
                    });

                builder
                    .add_window("id_salt_2")
                    .show("Title 2".to_string(), {
                        ui.label("Tool window 2");
                    });
            });
    });

You can call ToolWindows::new() as many times as you like, e.g. if you have multiple containers that each need their own tool windows.

Status

This crate is work-in-progress, but usable, see below.

Demos

The crate contains 3 demos.

  • simple - shows the current state and behavior of the tool windows when used in a container.
  • inside_windows - attempts to use the tool windows inside egui::Window instances.
  • inside_dock - attempts to use the tool windows inside an egui_dock, when the tabs are popped out egui::Window instances are used. This is most complicated scenario.

Refer to the demos folder.

Screenshots

Here's a recent screenshot of the simple demo:

egui_tool_windows

Here's a recent screenshot of the inside_dock demo:

egui_tool_windows

License

Available under APACHE or MIT licenses.

Authors

  • Dominic Clifton - Project founder and primary maintainer.

Timeline

2025/06/27 - Crate created!

Links

Contributing

If you'd like to contribute, please raise an issue or a PR on the github issue tracker, work-in-progress PRs are fine to let us know you're working on something, and/or visit the discord server. See the Links section above.

About

Floating tool windows for egui, can be used in containers, like resize, scroll-area, frame, etc.

Resources

Stars

6 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages