Commit graph

1468 commits

Author SHA1 Message Date
Emil Ernerfeldt
d2b669e1cd Changelog: Add line about storing state in Memory 2021-04-21 22:03:05 +02:00
Emil Ernerfeldt
6e9abfc9c0 Changelog: Add plot improvements 2021-04-21 22:02:51 +02:00
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
Emil Ernerfeldt
cb14e8571f Add Vec2::LEFT,RIGHT,UP,DOWN and Vec2::angle 2021-04-20 23:04:04 +02:00
Emil Ernerfeldt
58ebb217dc Tesselator: ignore zero-sized clip rects
Improves https://github.com/emilk/egui/issues/328
2021-04-20 10:05:47 +02:00
Emil Ernerfeldt
1681769329 Add #[inline(always)] here and there 2021-04-19 23:11:42 +02:00
Emil Ernerfeldt
0f1df90d90 Tesselator: ignore non-positive clip rectangles
Closes https://github.com/emilk/egui/issues/328
2021-04-19 23:00:30 +02:00
Joel Nises
72d0d71d66
made drag and drop support selectable on Windows for the eframe glium integration (#324)
* made drag and drop support selectable on windows

to avoid issues with crates that use multi-threaded COM apis

* fixed formatting and clippy issues
2021-04-19 22:49:28 +02:00
Emil Ernerfeldt
23d292a974 faster debug builds on mac 2021-04-18 23:15:07 +02:00
Emil Ernerfeldt
fbd0e35017 Clippy fixes for benchmark 2021-04-18 23:14:35 +02:00
Emil Ernerfeldt
0351662763 Fix bug with the layout of wide DragValue:s 2021-04-18 23:10:12 +02:00
Emil Ernerfeldt
c07f439b28 Add benchmark of ui.label
This is to help evaluate the impact of
https://github.com/emilk/egui/pull/302
2021-04-18 10:24:31 +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
5667e7eb51 Add docstring to ui.with_layout 2021-04-15 22:23:15 +02:00
Emil Ernerfeldt
f07bdf0433 Add more instructions to PR template 2021-04-15 22:21:48 +02:00
Emil Ernerfeldt
231c075867 Add #[inline(always)] to a few things 2021-04-15 10:37:31 +02:00
Emil Ernerfeldt
76d5229821
CI: run cargo doc (#309)
* Deny doc errors

* Add intentional bad intradoc link to test CI

* Add cargo doc to CI

* Fix carg doc web (add wasm32 target)

* Fix intentionally broken doc-link
2021-04-15 10:35:15 +02:00
Emil Ernerfeldt
b187d1c576 Make Memory::has_focus public (again) 2021-04-15 10:31:24 +02:00
ilya sheprut
d6de19b507
Mention macroquad backend in the readme (#308) 2021-04-15 10:20:04 +02:00
Emil Ernerfeldt
2aa05f00e1 check.sh: cargo doc all features 2021-04-15 09:48:30 +02:00
Emil Ernerfeldt
e1adb9c091 Fix broken markdown in docstring 2021-04-15 09:48:06 +02:00
Emil Ernerfeldt
96a2732735 Add Response::request_focus and surrender_focus 2021-04-15 09:45:12 +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
ilya sheprut
186362a4b8
Arbitrary data in Memory using Any, fix #255 (#257)
* init work

* implement deferred deserialization

* many improvements
* rename `DataElement` -> `AnyMapElement`
* make `data` in `Memory` as public field of type with public interface
* make interface more rich
* transform most unwraps to proper error handling
* make `AnyMap` store by `TypeId`, so now individual type can be counted and reset

* improve storing TypeId between different rust versions

* rewrite system widgets to use AnyMap

* refactor everything
* replace `serde_json` -> `ron`
* move `any_map` to module
* separate `AnyMap` into `AnyMapId` and `serializable::AnyMapId` in order to not require `serde` traits in methods
* add `AnyMap` and `serializable::AnyMap` that stores elements just by type, without `Id`
* write documentation
* change tooltips and color picker to use `Memory::data_temp`

* fix bugs and docs

* Apply suggestions from code review

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>

* rename `AnyMap` → `TypeMap`

* rename `AnyMapId` → `AnyMap`, add generic <Key> to it

* rename files `id_map` → `any_map`

* move out usages from `serializable` mod

* rename `ToDeserialize` → `Serialized`

* fix bug with counting

* add tests, and...
* rename `reset` → `remove`
* add function `remove_by_type`
* format code

* improve code
* make identical interface for serialized and simple maps
* make serialized maps serialized fully, without features by moving this into `Memory` struct with `#[cfg(feature = "persistence")]` under fields
* move `serialized::TypeId` into `AnyMapElement` struct

* fix pipeline and add one more test

* update docs

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2021-04-12 21:53:32 +02:00
Emil Ernerfeldt
4ecf304335 Fix touch screen defocus bug
Fixes https://github.com/emilk/egui/issues/288
2021-04-12 21:41:07 +02:00
Emil Ernerfeldt
5d50fa1350 Add Label::sense so you can make clickable labels
relates to https://github.com/emilk/egui/issues/292
2021-04-12 21:26:13 +02:00
follower
3c0c729af8
Add links to the changelogs for other crates. (#293)
(Tested via the GH web interface.)
2021-04-12 20:57:49 +02:00
Lin Han
20bf09560e
IME: Handle composition events to show suggestion on web (#278)
* Handle composition message to show suggestion.

* CI check

* Apply suggestions from code review

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>

* Some minor changes

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2021-04-12 20:57:14 +02:00
follower
0353f40dd5
Typo fix: "occational" -> "occasional" (#286) 2021-04-08 22:22:58 +02:00
Cristian Dinu
50a56d41ee
DragValue improvements (#274)
* Display ResizeHorizontal cursor on hover

* Adapt the URL open command to the platform

With this new version we use $OSTYPE bash env var to query what OS
are we running on.

- On Linux, ex: Fedora, we use `xdg-open`
- On Windows, ex: msys, we use `start`
- For other other variants we try to use `open`

We should update this script when we notice that `open` is not
available on a particular platform.

(cherry picked from commit b3aa4982f683d961c21fd18e9ffc1fdf5fba0783)

* Add slow speed mode for `DragValue`

The slow speed mode is disabled by default. It can be activated
or deactivated using `DragValue::slow_speed()`.

When active the `Shift` key can be used to have a better control
over the value, `DragValue::speed` / 10.0 increments.

* Display `ResizeHorizontal` cursor while dragging too

* Apply review suggestion

Shorter and in line with the rest of the code base

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>

* Add `Modifiers::shift_only` for better code clarity

* Make slow speed always enabled

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2021-04-08 22:20:52 +02:00
Emil Ernerfeldt
b30cb3313a
Try to allow turning off default_fonts for all libs (#266) 2021-04-07 20:14:44 +02:00
Emil Ernerfeldt
d544c3dd8b Release 0.11.0 - Optimization, screen reader & new layout logic 2021-04-05 14:49:06 +02:00
Emil Ernerfeldt
c96819e95e build_demo_web.sh: code cleanup 2021-04-05 14:45:32 +02:00
Emil Ernerfeldt
370d269cba Publish new web demo 2021-04-05 14:43:38 +02:00
Emil Ernerfeldt
49ef94d322 build_demo_web.sh: fix opening link on windows and linux
Co-authored with @DrOptix with code from
https://github.com/emilk/egui/pull/246
2021-04-05 14:23:42 +02:00
Emil Ernerfeldt
3803d0f3d1 Minor cleanup of the demo code 2021-04-05 14:23:42 +02:00
Emil Ernerfeldt
ab4819ca99 PR template: encourage linking to the relevant issue 2021-04-05 14:23:42 +02:00
Emil Ernerfeldt
77014c7c75 cargo update 2021-04-05 14:23:42 +02:00
Emil Ernerfeldt
7792ee0422 Update tts from 0.14 -> 0.15 (screen reader feature) 2021-04-05 14:23:42 +02:00
Emil Ernerfeldt
aba2108159 Replace JSON with RON for persistence (epi/eframe/glium/web) 2021-04-05 14:23:42 +02:00
Emil Ernerfeldt
4fc3c6d375 Remove unnecessary copy of mesh indices in glium painter 2021-04-05 14:23:42 +02:00
pixeljoelson
b028e708e0
fixed typo in README.md (#275) 2021-04-05 09:56:58 +02:00
Emil Ernerfeldt
ebb08f87f1 Fix: custom Ui:s now allocate minimal space in parent ui.
This makes nested horizontal/vertical layouts work better
2021-04-02 22:39:08 +02:00
Emil Ernerfeldt
4ac5b37702 Turn off text wrapping for DragValue:s 2021-04-02 13:42:46 +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
33a4058381 Add comment about Firefox CPU usage in FAQ 2021-04-02 09:24:34 +02:00
Emil Ernerfeldt
1c955e56fe Some code cleanup 2021-04-01 23:07:58 +02:00
Emil Ernerfeldt
facb01a7c2 Use wasm-opt when compiling for web 2021-04-01 23:07:43 +02:00