Emil Ernerfeldt
7cd8ac2bbf
|
5 years ago | |
---|---|---|
.. | ||
fonts | 6 years ago | |
src | 5 years ago | |
Cargo.toml | 5 years ago | |
README.md | 5 years ago |
README.md
GUI implementation
This is the core library crate Emigui. It is fully platform independent without any backend. You give the Emigui library input each frame (mouse pos etc), and it outputs a triangle mesh for you to paint.
TODO:
Widgets
- Label
- Button
- Checkbox
- Radiobutton
- Horizontal slider
- Vertical slider
- Collapsing header region
- Tooltip
- Movable/resizable windows
- Kinetic windows
- BUG FIX: Don't catch clicks on closed windows
- Scroll areas
- Vertical scrolling
- Horizontal scrolling
- Scroll-wheel input
- Drag background to scroll
- Kinetic scrolling
- Add support for clicking links
- Menu bar (File, Edit, etc)
- Text input
- Input events (key presses)
- Text focus
- Cursor movement
- Text selection
- Clipboard copy/paste
- Move focus with tab
- Handle leading/trailing space
- Color picker
- Style editor
- Table with resizable columns
- Layout
- Generalize Layout (separate from Region)
- Cascading layout: same lite if it fits, else next line. Like text.
- Grid layout
Web version:
- Scroll input
- Change to resize cursor on hover
Animations
Add extremely quick animations for some things, maybe 2-3 frames. For instance:
- Animate collapsing headers with clip_rect
Clip rects
- Separate Region::clip_rect from Region::rect
- Use clip rectangles when painting
- Use clip rectangles when interacting
- Adjust clip rects so edges of child widgets aren't clipped
- Use HW clip rects
Modularity
trait Widget
(Label
,Slider
,Checkbox
, ...)trait Container
(Frame
,Resize
,ScrollArea
, ...)widget::TextButton
implemented as acontainer::Button
which contains awidget::Label
.- Easily chain
Container
s without nested closures.- e.g.
region.containers((Frame::new(), Resize::new(), ScrollArea::new()), |ui| ...)
- e.g.
Input
- Distinguish between clicks and drags
- Double-click
- Text
Other
- Persist UI state in external storage
- Pixel-perfect rendering (round positions to nearest pixel).
- Build in a profiler which tracks which region in which window takes up CPU.
- Draw as flame graph
- Draw as hotmap
Names and structure
- Rename things to be more consistent with Dear ImGui
- Combine Emigui and Context
- Rename Region to something shorter?
region: &Region
region.add(...)
:/gui: &Gui
gui.add(...)
:)ui: &Ui
ui.add(...)
:)
- Maybe find a shorter name for the library like
egui
?
Global widget search
Ability to do a search for any widget. The search works even for collapsed regions and closed windows and menus. This is implemented like this: while searching, all region are layed out and their add_content functions are run. If none of the contents matches the search, the layout is reverted and nothing is shown. So windows will get temporarily opened and run, but if the search is not a match in the window it is closed again. This means then when searching your whole GUI is being run, which may be a bit slower, but it would be a really awesome feature.