2020-04-19 09:15:35 +00:00
# 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:
2020-04-21 08:27:53 +00:00
### Widgets
2020-04-21 14:50:56 +00:00
* [x] Label
* [x] Button
* [x] Checkbox
* [x] Radiobutton
2020-04-22 17:40:22 +00:00
* [x] Horizontal slider
* [ ] Vertical slider
2020-04-22 16:15:27 +00:00
* [x] Collapsing header region
2020-04-21 14:50:56 +00:00
* [x] Tooltip
2020-04-21 08:27:53 +00:00
* [x] Movable/resizable windows
2020-05-03 11:28:47 +00:00
* [x] Kinetic windows
2020-05-11 18:21:24 +00:00
* [ ] Windows should open from `UI` s and be boxed by parent ui.
2020-05-08 19:31:27 +00:00
* Then we could open the example app inside a window in the example app, recursively.
2020-05-17 14:42:20 +00:00
* [x] Resize any side and corner on windows
2020-05-17 10:26:17 +00:00
* [ ] Fix autoshrink
2020-04-21 08:27:53 +00:00
* [ ] Scroll areas
2020-04-22 15:38:36 +00:00
* [x] Vertical scrolling
* [ ] Horizontal scrolling
2020-04-22 18:01:49 +00:00
* [x] Scroll-wheel input
2020-04-22 15:38:36 +00:00
* [x] Drag background to scroll
* [ ] Kinetic scrolling
2020-05-16 15:28:15 +00:00
* [x] Add support for clicking hyperlinks
2020-05-11 18:21:24 +00:00
* [x] Menu bar (File, Edit, etc)
* [ ] Sub-menus
* [ ] Keyboard shortcuts
2020-04-29 19:25:49 +00:00
* [ ] Text input
* [x] Input events (key presses)
* [x] Text focus
2020-05-17 10:26:17 +00:00
* [x] Cursor movement
2020-04-29 19:25:49 +00:00
* [ ] Text selection
2020-04-22 15:38:36 +00:00
* [ ] Clipboard copy/paste
2020-04-29 19:25:49 +00:00
* [ ] Move focus with tab
2020-05-19 20:36:26 +00:00
* [x] Handle leading/trailing space
2020-04-21 08:27:53 +00:00
* [ ] Color picker
* [ ] Style editor
2020-04-23 07:50:03 +00:00
* [ ] Table with resizable columns
2020-04-26 20:30:24 +00:00
* [ ] Layout
2020-05-11 18:21:24 +00:00
* [ ] Generalize Layout (separate from Ui)
2020-04-26 20:30:24 +00:00
* [ ] Cascading layout: same lite if it fits, else next line. Like text.
* [ ] Grid layout
2020-05-17 10:26:17 +00:00
* [ ] Point list
2020-05-08 19:31:27 +00:00
* [ ] Image support
2020-04-23 07:50:03 +00:00
### Web version:
* [x] Scroll input
2020-04-23 17:15:17 +00:00
* [x] Change to resize cursor on hover
2020-05-02 09:37:12 +00:00
* [ ] Make it a JS library for easily creating your own stuff
2020-05-19 20:36:26 +00:00
* [x] Read url fragment and redirect to a subpage (e.g. different examples apps)
2020-04-21 08:27:53 +00:00
2020-05-17 10:26:17 +00:00
### Visuals
2020-05-19 20:36:26 +00:00
* [x] Simplify button style to make for nicer collapsible headers. Maybe weak outline? Or just subtle different text color?
2020-05-17 10:26:17 +00:00
* [/] Pixel-perfect painting (round positions to nearest pixel).
2020-05-11 18:21:24 +00:00
* [ ] Make sure alpha blending is correct (different between web and glium)
2020-05-17 10:26:17 +00:00
* [ ] Color picker widgets
* [ ] Fix thin rounded corners rendering bug (too bright)
2020-05-11 18:21:24 +00:00
2020-04-21 08:27:53 +00:00
### Animations
Add extremely quick animations for some things, maybe 2-3 frames. For instance:
2020-04-22 16:15:27 +00:00
* [x] Animate collapsing headers with clip_rect
2020-04-21 08:27:53 +00:00
### Clip rects
2020-05-11 18:21:24 +00:00
* [x] Separate Ui::clip_rect from Ui::rect
2020-04-21 08:27:53 +00:00
* [x] Use clip rectangles when painting
2020-04-26 20:30:24 +00:00
* [x] Use clip rectangles when interacting
2020-04-22 17:40:22 +00:00
* [x] Adjust clip rects so edges of child widgets aren't clipped
2020-04-29 19:25:49 +00:00
* [ ] Use HW clip rects
2020-04-21 14:50:56 +00:00
2020-04-25 13:26:24 +00:00
### Modularity
* [x] `trait Widget` (`Label`, `Slider` , `Checkbox` , ...)
* [ ] `trait Container` (`Frame`, `Resize` , `ScrollArea` , ...)
* [ ] `widget::TextButton` implemented as a `container::Button` which contains a `widget::Label` .
* [ ] Easily chain `Container` s without nested closures.
2020-05-11 18:21:24 +00:00
* e.g. `ui.containers((Frame::new(), Resize::new(), ScrollArea::new()), |ui| ...)`
2020-04-25 13:26:24 +00:00
2020-04-25 21:07:03 +00:00
### Input
2020-05-23 11:38:01 +00:00
* [x] Distinguish between clicks and drags
2020-05-23 20:10:08 +00:00
* [x] Double-click
2020-05-02 09:37:12 +00:00
* [x] Text
2020-05-23 20:10:08 +00:00
* [ ] Support all mouse buttons
2020-05-02 09:37:12 +00:00
### Debugability / Inspection
* [x] Widget debug rectangles
2020-05-11 18:21:24 +00:00
* [x] Easily debug why something keeps expanding
2020-04-25 21:07:03 +00:00
2020-04-21 08:27:53 +00:00
### Other
2020-05-02 09:37:12 +00:00
* [x] Persist UI state in external storage
2020-05-11 18:21:24 +00:00
* [ ] Persist Example App state
* [ ] Build in a profiler which tracks which `Ui` in which window takes up CPU.
2020-04-21 08:27:53 +00:00
* [ ] Draw as flame graph
* [ ] Draw as hotmap
2020-05-12 21:00:20 +00:00
* [ ] Change `width.min(max_width)` to `width.at_most(max_width)`
2020-04-21 08:27:53 +00:00
### Names and structure
2020-04-22 15:38:36 +00:00
* [ ] Rename things to be more consistent with Dear ImGui
2020-05-08 20:25:28 +00:00
* [x] Combine Emigui and Context?
2020-05-11 18:21:24 +00:00
* [x] Solve which parts of Context are behind a mutex
2020-05-08 20:42:31 +00:00
* [x] Rename Region to Ui
2020-05-19 18:54:02 +00:00
* [ ] Move Path and Triangles to own crate
2020-04-25 13:26:24 +00:00
* [ ] Maybe find a shorter name for the library like `egui` ?
2020-04-21 08:27:53 +00:00
### Global widget search
2020-04-22 16:15:27 +00:00
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.