* Generalize http fetch
- allow bytes as request body
- expose request and response headers in API
- update http example to show response headers and allow POST requests
* clippy fixes
* add missing comment, pub
* doc comment fix
* fix: missing argument when feature syntect not enabled
* formatting fixes
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
* remove commented out code
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
* formatting fixes
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
* cargo fmt
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
* Use old 1.51 toolchain instead of bleeding edge
1.52 and 1.53 has problems with incremental compilation,
so some people chose to stay on 1.51 for now.
So let's make sure egui supports 1.51 for a while!
* Update to cint 0.2.2 to get rust 1.51.0 compatability
- This issue was made apparent on macOS since 67c6002578
- Repro:
1. Cmd+Tab away from the window (this will keep the Cmd modifier state `true` until it is pressed again)
2. Cmd+Tab back to the window
3. Try to scroll with the trackpad or mouse wheel ... it won't work until you press and release the Cmd key!
4. Also the plot widget will be stuck in "zoom mode" while the Cmd modifier state is true.
- I was not able to reproduce the issue with `egui_web`
* translate touch events from glium to egui
Unfortunately, winit does not seem to create _Touch_ events for the touch pad
on my mac. Only _TouchpadPressure_ events are sent.
Found some issues (like
[this](https://github.com/rust-windowing/winit/issues/54)), but I am not sure
what they exactly mean: Sometimes, touch events are mixed with
touch-to-pointer translation in the discussions.
* translate touch events from web_sys to egui
The are a few open topics:
- egui_web currently translates touch events into pointer events.
I guess this should change, such that egui itself performs this kind of
conversion.
- `pub fn egui_web::pos_from_touch_event` is a public function, but I
would like to change the return type to an `Option`. Shouldn't this
function be private, anyway?
* introduce `TouchState` and `Gesture`
InputState.touch was introduced with type `TouchState`, just as
InputState.pointer is of type `Pointer`.
The TouchState internally relies on a collection of `Gesture`s. This commit
provides the first rudimentary implementation of a Gesture, but has no
functionality, yet.
* add method InputState::zoom()
So far, the method always returns `None`, but it should work as soon as the
`Zoom` gesture is implemented.
* manage one `TouchState` per individual device
Although quite unlikely, it is still possible to connect more than one touch
device. (I have three touch pads connected to my MacBook in total, but
unfortunately `winit` sends touch events for none of them.)
We do not want to mix-up the touches from different devices.
* implement control loop for gesture detection
The basic idea is that each gesture can focus on detection logic and does not
have to care (too much) about managing touch state in general.
* streamline `Gesture` trait, simplifying impl's
* implement first version of Zoom gesture
* fix failing doctest
a simple `TODO` should be enough
* get rid of `Gesture`s
* Provide a Zoom/Rotate window in the demo app
For now, it works for two fingers only. The third finger interrupts the
gesture.
Bugs:
- Pinching in the demo window also moves the window -> Pointer events must be
ignored when touch is active
- Pinching also works when doing it outside the demo window -> it would be nice
to return the touch info in the `Response` of the painter allocation
* fix comments and non-idiomatic code
* update touch state *each frame*
* change egui_demo to use *relative* touch data
* support more than two fingers
This commit includes an improved Demo Window for egui_demo, and a complete
re-write of the gesture detection. The PR should be ready for review, soon.
* cleanup code and comments for review
* minor code simplifications
* oops – forgot the changelog
* resolve comment fee8ed83db (r623226656)
* accept suggestion https://github.com/emilk/egui/pull/306#discussion_r623229228
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
* fix syntax error (dough!)
* remove `dbg!` (why didnt clippy see this?)
* apply suggested diffs from review
* fix conversion of physical location to Pos2
* remove redundanct type `TouchAverages`
* remove trailing space
* avoid initial translation jump in plot demo
* extend the demo so it shows off translation
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
This adds a new `zoom_delta` to input.
This is hooked up to ctrl-scroll on egui_web and egui_glium.
Browsers convert trackpad pinch gestures to ctrl-scroll,
so this means you can not pinch-to-zoom plots (on trackpad).
In the future we can support multitouch pinch-to-zoom via the same
`InputState::zoom_factor()` function
* 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
* egui_web: enable IME support on web.
* Move candidate window following text cursor.
* Preclude too frequent agent movement.
* IME candidate window move on native app.
* add texture registering function
* fmt
* Revert "add texture registering function"
This reverts commit f9b4db12
* make get_texture public to get render target owned by Painter .
* revert egui_web painter.rs change
* Added shaders on GLSL 1.2
- Used `glium::program` to create shaders
- Moved shaders code to its own sources and include it as str
- Added shaders implementation on GLSL which allows run egui on old hardware
(Raspberry Pi 1/zero in game again)
* Moved webgl shaders code to sources in `shader` subdir
* Added GLSL ES shaders to glium backend to support OpenGL ES
* Described changes related to GLSL versions support