Commit graph

45 commits

Author SHA1 Message Date
Emil Ernerfeldt
01fca2f31c Add Ui::spacing() and Ui::spacing_mut() as shortcuts 2021-02-01 16:56:29 +01:00
Emil Ernerfeldt
247026149c
Multiple mouse button support (#135)
Add support for primary, secondary and middle mouse buttons. Also improve ability to click things in low FPS situations.

This introduces a lot of breaking changes:

    Backends/integrations now pass mouse events via the even stream.
    Response has an interface of mostly methods instead of public members.
    input.mouse is now input.pointer and has new interface.


* Rename 'mouse' to 'pointer' everywhere (pointer = mouse or touch)

* Make Response::clicked and Response::double_clicked into methods

* Remove Response::active and add dragged() and interact_pointer_pos()

* Support multiple mouse buttons

* Make PointerState interface all methods

* Make most members of Response private
2021-01-25 18:50:19 +01:00
Emil Ernerfeldt
fb2317c993 Rename PaintCmd to Shape 2021-01-10 11:43:01 +01:00
Emil Ernerfeldt
a0b0f36d29 Move egui/math into new crate emath 2021-01-10 11:37:47 +01:00
Emil Ernerfeldt
029a85c1fc Move Color32 constants from mod color to struct Color32 2021-01-02 17:18:41 +01:00
Emil Ernerfeldt
48dfcde65f Add ui.allocate_response(…): allocate space and check for interactions 2020-12-26 19:14:13 +01:00
Emil Ernerfeldt
cd7abb457f Expand Window + Resize areas to be large enough for last frames content 2020-12-25 15:41:18 +01:00
Emil Ernerfeldt
1c9fbc1588 Adjust default-size of Resize areas to fit within screen 2020-12-16 20:31:00 +01:00
Emil Ernerfeldt
2bb99213c8 Use extremely explicit names like available_rect_before_wrap 2020-12-10 23:25:23 +01:00
Emil Ernerfeldt
6e8d5c87a0 Add Resize::id_source and ScrollArea::id_source 2020-12-10 10:28:30 +01:00
Emil Ernerfeldt
7abb9a2814 Improve Id generation, with more aggressive name clash warnings 2020-11-03 22:00:56 +01:00
Emil Ernerfeldt
b8642b4db4 Do less rounding of positions to pixel boundaries
Fixes https://github.com/emilk/egui/issues/27
2020-10-18 14:47:12 +02:00
Emil Ernerfeldt
3f345b5963 Ui: clean up min_rect/max_rect related functions 2020-10-08 22:24:27 +02:00
Emil Ernerfeldt
6fcfb52aa0 [demo] add frame time graph to demo app 2020-10-01 22:25:44 +02:00
Emil Ernerfeldt
908d1d0c08 [refactor] Ui: rename child_bounds to min_rect, desired_rect to max_rect 2020-09-27 11:43:44 +02:00
Emil Ernerfeldt
aad0391fef remove Ui::set_layout 2020-09-26 07:52:24 +02:00
Emil Ernerfeldt
85a67ab15e [refactor] introduce NumExt with at_least and at_most
`x.min(maxumim)` can be confusing but `x.at_most(maximum)` is very clear
2020-09-18 17:49:39 +02:00
Emil Ernerfeldt
e30a9c1196 [window/resize] add Resize::max_width and fix bug with fixed_size 2020-09-13 22:07:55 +02:00
Emil Ernerfeldt
9578773613 [style] tweak style, and refactor struct Style 2020-09-08 09:17:08 +02:00
Emil Ernerfeldt
6ca11aff8c [refactor] use "fg_" prefix in WidgetStyle 2020-09-05 13:30:04 +02:00
Emil Ernerfeldt
ecd68f4faa [refactor] combine stroke_color and stroke_width in WidgetStyle 2020-09-02 01:36:52 +02:00
Emil Ernerfeldt
9d4021d703 [refactor] rename LineStyle to Stroke 2020-09-01 23:54:21 +02:00
Emil Ernerfeldt
e7b098ac56 [style] make the default style a lot more compact and sleek 2020-09-01 20:40:54 +02:00
Emil Ernerfeldt
96153a86e5 [refactor] Remove Option wrappers around colors and line styles
Just use transparency instead of None
2020-08-31 22:56:24 +02:00
Emil Ernerfeldt
413ed6999e [refactor] break up Style into Spacing, Interaction and Visuals
Also make sliders fixed-width
2020-08-31 22:27:31 +02:00
Emil Ernerfeldt
c23dfd155c [refactor] unify InteractInfo and GuiResponse to Response 2020-08-30 08:52:42 +02:00
Emil Ernerfeldt
1d350ad15b [painter] add helper functions for drawing lines, circles and rectangles 2020-08-29 17:30:06 +02:00
Emil Ernerfeldt
a2160a5e12 fix some corner cases for repaint requests 2020-08-28 16:41:37 +02:00
Emil Ernerfeldt
0bbf7edaee [window] increase default width of windows and resize areas 2020-08-28 16:24:20 +02:00
Emil Ernerfeldt
8c03f6a90f [window] prevent trying to shrink window smaller than title bar width 2020-08-28 16:24:20 +02:00
Emil Ernerfeldt
98c9e9bb41 spelling fixes 2020-08-27 18:06:32 +02:00
Emil Ernerfeldt
d41b7a6234 [resize] remove Resize::handle_offset 2020-08-26 22:14:28 +02:00
Emil Ernerfeldt
a764b0d23f [window] visually indicate which windows can be resized 2020-08-26 20:55:23 +02:00
Emil Ernerfeldt
b06c9e94fb [egui] rename "with_serde" feature flag to just "serde" 2020-08-09 17:34:26 +02:00
Emil Ernerfeldt
3facd5c587 [doc] improve docstrings in Egui 2020-08-09 17:24:32 +02:00
Emil Ernerfeldt
11df21e39e [refactor] extract paint code from Ui/Context to new struct Painter 2020-07-30 14:35:18 +02:00
Emil Ernerfeldt
bf19eb2ec5 [refactor] minor code cleanup 2020-07-23 10:27:21 +02:00
Emil Ernerfeldt
900a758903 [resize] unify to one minimum size 2020-07-19 00:17:02 +02:00
Emil Ernerfeldt
07d2af885b [resize] improve default/min sizes of some resize areas 2020-07-19 00:16:04 +02:00
Emil Ernerfeldt
d0f5181197 [window] make resizing a bit smoother 2020-06-03 21:14:47 +02:00
Emil Ernerfeldt
5bf8051be5 [style] rounded buttons and tweak some spacing and sizes 2020-06-03 11:02:30 +02:00
Emil Ernerfeldt
347fdb97d6 [window] fix a bunch of resize-releated bugs 2020-05-30 17:51:01 +02:00
Emil Ernerfeldt
efe90c9326 [window] allow specifying pos/size with [f32; 2] 2020-05-30 11:48:33 +02:00
Emil Ernerfeldt
b80baf4039 [egui] make serde an optional dependency 2020-05-30 11:04:40 +02:00
Emil Ernerfeldt
fd5ab736bb Rename from "Emigui" to "Egui"
Shorter to type (especially in code).
2020-05-30 10:22:35 +02:00
Renamed from emigui/src/containers/resize.rs (Browse further)