Sven Niederberger
012542d066
Drag and zoom support for plots ( #317 )
...
* drag and zoom support for plots
* update doctest
* use impl ToString
* revert back to Into<String> until #302 is solved
* Apply suggestions from code review
Co-authored-by: ilya sheprut <optitel223@gmail.com>
* use persistence feature for PlotMemory
* rename shift -> translate
* remove automatic bounds
* removed unused methods
* Into<String> -> ToString
* Apply suggestions from code review
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
* avoid potential invalid bounds bug
* use new is_valid method
* improve auto bounds behavior as suggested
* use NOTHING to initialize min_auto_bounds
Co-authored-by: ilya sheprut <optitel223@gmail.com>
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2021-04-21 21:50:27 +02:00
ilya sheprut
c69ecfe421
Memory usage example in the widget gallery ( #307 )
...
* init example
* add comments
* fix grammar in comments
* fix CI
* change example from view_edit to password
* rename file
* fix CI
2021-04-18 10:13:08 +02:00
Emil Ernerfeldt
580d27e0d3
Add anchors to windows and areas ( #310 )
...
This is so that you can put a window in e.g. the top right corner
or the center of the screen.
2021-04-18 10:01:41 +02:00
Emil Ernerfeldt
daf2e13238
demo: Use new id_data to store the show/hide password toggle
2021-04-12 22:37:39 +02:00
Emil Ernerfeldt
3803d0f3d1
Minor cleanup of the demo code
2021-04-05 14:23:42 +02:00
Emil Ernerfeldt
4b9db0cc55
Rename ui.advance_cursor to ui.add_space
2021-04-02 10:13:06 +02:00
Emil Ernerfeldt
d848b2a664
Add TextEdit::password to hide input characters
2021-04-02 09:58:55 +02:00
Emil Ernerfeldt
1c955e56fe
Some code cleanup
2021-04-01 23:07:58 +02:00
Emil Ernerfeldt
f6770f0183
Various spelling fixes, docs improvements and code cleanup
2021-03-31 23:12:42 +02:00
Emil Ernerfeldt
3450168e94
egui_glium: add support for transparent windows
...
Also support non-decorated windows (without border)
2021-03-31 20:53:13 +02:00
Emil Ernerfeldt
5011623744
Deprecate old DragValue constructors in favor of DragValue::new
2021-03-27 16:09:09 +01:00
Emil Ernerfeldt
de439b6e21
Deprecate old Slider constructors in favor of Slider::new
2021-03-27 16:07:18 +01:00
Emil Ernerfeldt
41c9de2734
Add new ComboBox builder to replace the combo_box_with_label function
2021-03-27 10:35:40 +01:00
Emil Ernerfeldt
fd3444473f
Add some clippy lints
2021-03-23 19:53:31 +01:00
Emil Ernerfeldt
f5c372910c
Replace emath::clamp with f32::clamp (new in rustc 1.50)
2021-03-21 17:47:03 +01:00
Emil Ernerfeldt
ed0d406698
Improve misc documentation
...
Closes https://github.com/emilk/egui/issues/229
2021-03-21 17:13:58 +01:00
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
958aea922f
Add a lot more CursorIcon's
2021-03-13 12:38:03 +01:00
Emil Ernerfeldt
017d602fe5
Rename "kb_focus" to just "focus" everywhere
2021-03-09 20:55:24 +01:00
Emil Ernerfeldt
ea248d66b5
Improve widget info output for potential screen readers
...
Part of https://github.com/emilk/egui/issues/167
2021-03-08 18:36:32 +01:00
Emil Ernerfeldt
c212d4512e
Clarify behavior of window resizing
...
closes https://github.com/emilk/egui/issues/206
2021-03-07 20:15:42 +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
cd4c07e09a
Output events when widgets gain keyboard focus
...
Part of https://github.com/emilk/egui/issues/167
2021-03-07 19:45:20 +01:00
Emil Ernerfeldt
9c8439d053
Add some helper functions to Response
2021-03-06 10:48:39 +01:00
Emil Ernerfeldt
f793ac7f3e
[demo] Remove dead code
2021-02-28 20:11:37 +01:00
Emil Ernerfeldt
1fb3b43dfc
[demo] Improve painting demo slightly
2021-02-28 19:50:47 +01:00
Emil Ernerfeldt
d3fd51d6a4
Add Response::changed(): see if e.g. text was entered or slider dragged
2021-02-28 17:24: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
6fe70e685b
Simplify and unify colors of selectable widgets
2021-02-20 11:28:00 +01:00
Emil Ernerfeldt
21c99e1130
Add Ui::hyperlink_to
2021-02-20 09:26:58 +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
a19140ec67
A simple 2D plot library
2021-02-17 22:54:10 +01:00
Emil Ernerfeldt
7dad76b913
Use explicit epaint
over paint
alias (re-export)
...
egui reexports the `epaint` crate both under its original name
and under the alias `paint` (for historical reasons)
2021-02-14 10:53:39 +01:00
Emil Ernerfeldt
6d255cd179
Use explicit emath
to math
alias
...
egui exports `emath` under its original name AND under the alias `math`
(for historical reasons).
2021-02-14 10:44:46 +01:00
Emil Ernerfeldt
c376d0bb7e
[emath] RectTransform: transforms Pos2 from one Rect to another
...
Very useful for transforming coordinate systems, e.g. for painting
2021-02-14 10:33:44 +01:00
Emil Ernerfeldt
6377a4231f
[demo] Refactor and minor cleanup
2021-02-07 17:04:03 +01:00
Emil Ernerfeldt
e82fb81f07
Replace (ret, response) tuples with new struct InnerResponse
2021-02-07 14:09:44 +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
26f966563a
Add Grid::max_col_width
2021-02-06 16:54:38 +01:00
Emil Ernerfeldt
2d9d06dbff
[emath] Use const values for Vec2::ZERO, Rect::EVERYTHING etc
2021-02-05 10:11:39 +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
a19fd7b780
Add light mode
2021-02-03 19:30:58 +01:00
Emil Ernerfeldt
829455b347
Add ui.group(|ui| { … })
to visually group some widgets within a frame
2021-02-03 00:25:07 +01:00
Emil Ernerfeldt
ca886ea998
Add ui.visuals() as short for ui.style().visuals
2021-02-03 00:20:39 +01:00
Emil Ernerfeldt
01fca2f31c
Add Ui::spacing() and Ui::spacing_mut() as shortcuts
2021-02-01 16:56:29 +01:00