Commit graph

24 commits

Author SHA1 Message Date
Emil Ernerfeldt
eaa1ed96ee Depcrecate ui.horizontal_for_text and ui.horizontal_wrapped_for_text
They just add unnecessary complexity at this point
2021-03-21 14:48:16 +01:00
Emil Ernerfeldt
d6233de9dc Small improvements to the demo (add source code links etc) 2021-03-07 19:51:07 +01:00
Emil Ernerfeldt
ebc2486d22 Slider: use a DragValue for the value, and implement suffix/prefix 2021-02-20 18:29:09 +01:00
Emil Ernerfeldt
4e041185f1 Add module special_emojis with apple, linux, windows & github logos 2021-02-20 16:09:00 +01:00
Emil Ernerfeldt
6354709fe1 [demo] Link to the egui docs from the widget gallery 2021-02-20 12:07:15 +01:00
Emil Ernerfeldt
040553da78 impl<F> Widget for F where F: FnOnce(&mut Ui) -> Response
This enables functions that return `impl Widget`, so that you can
create a widget by just returning a lambda from a function.

For instance: `ui.add(toggle(bool))` (instead of `toggle(ui, bool)`)
2021-02-20 12:02:38 +01:00
Emil Ernerfeldt
9e38674d13 [demo] Alwyas start with widget gallery 2021-02-20 09:19:40 +01:00
Emil Ernerfeldt
0f13fff24b Assign default colors to plot lines if not explicitly set 2021-02-18 18:59:59 +01:00
Emil Ernerfeldt
df4c0257c0 Add Ui functions for doing manual layout ("put this widget here") 2021-02-07 13:48:55 +01:00
Emil Ernerfeldt
bca722ddf8 Add ui.set_enabled(false) to disable all widgets in a Ui
Closes https://github.com/emilk/egui/issues/50
2021-02-07 10:55:45 +01:00
Emil Ernerfeldt
0f37b009d6 Add TextEdit::hint_text for showing a weak hint text when empty 2021-02-03 21:06:50 +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
e2217ff63a [style] Fade out windows on close 2021-01-20 00:31:43 +01:00
Emil Ernerfeldt
31b7eda51e Rename Egui to egui
Also update iamges in README.md
2021-01-17 14:48:59 +01:00
Emil Ernerfeldt
07f1b074ca [grid] Allow putting a separator in a grid 2021-01-16 11:48:30 +01:00
Emil Ernerfeldt
b1157ee642 [grid] Option to set spacing 2021-01-15 21:17:56 +01:00
Emil Ernerfeldt
480c6db37f [grid] Set default row height to interact_size.y
It is what we use for horizontal layouts, and makes sense.
2021-01-15 21:17:56 +01:00
Emil Ernerfeldt
03c9cda89b [grid] Ensure the contents of each grid cell is aligned left+center 2021-01-15 21:17:56 +01:00
Emil Ernerfeldt
641a302e0a [grid] Add optional minimal row height 2021-01-15 18:30:09 +01:00
Emil Ernerfeldt
6f814b9516 [demo] Add collapsing header to widget gallery 2021-01-15 18:30:09 +01:00
Emil Ernerfeldt
73d16eb771 Use Grid to add labels to the color picker sliders
Also improve the color preview in the color picker
2021-01-13 23:09:23 +01:00
Emil Ernerfeldt
5e7ad40c8d [demo] Center the "(source code)" hyperlinks 2021-01-11 23:50:50 +01:00
Emil Ernerfeldt
1c5cdd8575 [demo] Add separator, hyperlink and SelectableLabel to widget gallery 2021-01-11 21:07:17 +01:00
Emil Ernerfeldt
0b10fa5c29
Grid layout and widget gallery (#106)
* Wrap Layout and Region into a new struct Placer

* [egui] Add a simple grid layout

* Refactor CollapsingHeader code (simplify header painting)

* Fix: allow putting a CollapsingHeader inside of a grid layout

* [demo] Add a widget gallery

Closes https://github.com/emilk/egui/issues/88

* Add optional striped grid background
2021-01-11 20:58:36 +01:00