1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-27 23:13:13 -04:00
Commit Graph

2790 Commits

Author SHA1 Message Date
Konkitoman
51011d1bbd Fix: sync viewport was not updating on windows
Changes: no more manual calls to winit:🪟:Window::request_redraw, in glow or wgpu
2023-08-29 11:01:19 +03:00
Konkitoman
a21cb80f56 Merge branch 'master' of https://github.com/emilk/egui into multiples_viewports 2023-08-29 10:00:14 +03:00
Emil Ernerfeldt
7b169ec13d Break out plotting to own crate egui_plot (#3282)
This replaces `egui::plot` with the new crate `egui_plot`
2023-08-27 17:22:49 +02:00
Sven Niederberger
87f12d782e Allow setting the progress bar height (#3183)
* allow setting the progress bar height

* changelog entry

* remove the changelog entry
2023-08-27 14:28:55 +02:00
Sven Niederberger
c722b7fd46 Plot items: Image rotation and size in plot coordinates, polygon fill color (#3182)
* plot item improvements

* update changelog

* fix links

* revert changes to the changelog

* clean up merge
2023-08-27 14:28:10 +02:00
Konkitoman
e5a97d14ad Add some documentation 2023-08-25 12:20:55 +03:00
Konkitoman
4d01644b33 * Fix example hello_world_par
* Added warning for glow eframe when creating `Context::create_viewport_sync` in other thread, or cannot be rendered!
* Fix clippy warning
2023-08-25 11:22:18 +03:00
Emil Ernerfeldt
b6f46b000b Some clippy fixes from 1.72.0 2023-08-25 07:44:25 +02:00
Konkitoman
b0287e96e5 Fix some stuf in egui::Window 2023-08-24 09:46:46 +03:00
Konkitoman
6c91562c7b Now viewport pos and size are stored in InputState::{viewport_inner_pos, viewport_outer_pos, viewport_inner_size, viewport_outer_size}
This fixes a lot of problems
2023-08-24 09:14:48 +03:00
Konkitoman
9c73c2f4b1 Revert "Now in screen_rect min is the viewport position and max is the viewport size"
This reverts commit 4bbdab1788.
2023-08-24 07:55:56 +03:00
Konkitoman
c9faa78e5b Make the window position and size to not get set when the window is mimimized
And now Memory::new_pixels_per_point is not taken because all viewports need to have the same dpi
2023-08-24 07:45:42 +03:00
Antoine Beyeler
627e1b3d50 Add exception for RUSTSEC-2023-0052 to deny.toml (#3274) 2023-08-23 15:22:41 +02:00
Antoine Beyeler
2c5fc5a0a5 Added mime field to DroppedFiles (#3273) 2023-08-23 15:13:47 +02:00
Konkitoman
3b41253442 This should make the viewport to redraw normaly in windows 2023-08-23 14:31:37 +03:00
Konkitoman
3cf9c1c4b1 Make example more complex 2023-08-23 08:11:31 +03:00
Konkitoman
dadcd508c9 Fix deadlock when creating a viewport sync in a viewport sync
But will not affect anything because the viewport builders will processed when the async viewport will end
2023-08-23 07:18:16 +03:00
Konkitoman
189e34e3d2 Fix flickering for Context::create_viewport_sync but now will return a Option<T> 2023-08-23 06:20:31 +03:00
Konkitoman
3f8fe1db3a Merge branch 'master' of https://github.com/emilk/egui into multiples_viewports 2023-08-23 06:10:34 +03:00
Emil Ernerfeldt
ec506c0a43 Use the minus character instead of "dash" (#3271)
* Use the minus character instead of "dash"

See https://github.com/rerun-io/rerun/issues/3053

* docstring

* fix
2023-08-22 15:35:27 +02:00
David M. Lary
32a63da580 Added Context::is_context_menu_open() (#3267)
I encountered a case where I needed to know if an egui context menu was
open, even if the mouse cursor was not in an egui area (full details in
discord).  I found that every resource I needed to detect that the menu
was open was either private, or pub(crate).  While it is possible to
wrap the `Response::context_menu()` in code to do state-tracking, it
becomes necessary to duplicate that code in every place you use a
context menu.

In this commit, I add `Context::is_context_menu_open()`.  Named similarly
to `Context::is_pointer_over_area()`, this method will return true if
any context menu is open.  This is possible because the context menu
uses a temp var with a fixed Id to store its state.  This method just
fetches the state, and interrogates it to see if there is a menu
present.

One helper method, `BarState::has_root()`, was added as all the fields
needed to perform the check were private to the `menu` module.

I've also updated the Context Menu demo to show the result of
`is_context_menu_open()` to verify the code functions as expected.
2023-08-22 15:35:15 +02:00
lucasmerlin
461328f54d Fix iOS support in eframe (#3241)
* Fix the app only taking up half the screen size on iPad

* Fix request_repaint not working on iOS

* Always use run_and_exit on iOS since run_and_return is not supported by winit on iOS right now.

* Fix typo

* Fix eframe glow on ios

* Handle more cases
2023-08-22 14:35:18 +02:00
Konkitoman
d90db12e88 Fix: window not redrawing when moving 2023-08-22 11:33:38 +03:00
Konkitoman
7aefba60df Fix windows and android errors 2023-08-22 11:20:34 +03:00
Konkitoman
8e864bdfbc typo: fix typos 2023-08-22 11:08:56 +03:00
Konkitoman
ab59bf8c88 Now viewports will be identified by there id a normal egui::Id
Before viewports was identified by there title
2023-08-22 10:34:43 +03:00
Konkitoman
2949874287 Update egui::Context::create_viewport documentation and update viewports example 2023-08-22 10:22:21 +03:00
Konkitoman
013f01dbcb * Now: is_desktop can only be set at the creation with egui::Context::new insted of default!
* Removed: egui::Context::is_desktop, egui::Context::set_desktop
* Added: egui::Context::force_embedding, egui::Context::set_force_embedding
2023-08-22 09:39:41 +03:00
Konkitoman
2919a325d9 Fix Typo 2023-08-19 19:30:49 +03:00
Konkitoman
bc04696842 Merge branch 'master' of https://github.com/emilk/egui into multiples_viewports 2023-08-17 21:59:11 +03:00
Brian Janssen
2c7c59820e Expose area::State's Rect in Memory (#3161) 2023-08-16 12:52:36 +02:00
YgorSouza
f0addc339c Add tooltip_delay option (#3245)
* Add tooltip_delay option

Similar to the show_tooltips_only_when_still option, but allows the user
to configure a specific delay in seconds, and also makes the tooltip
disappear if the mouse is moved again.

Closes #3232

* Update crates/egui/src/response.rs

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

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2023-08-15 19:48:36 +02:00
Andreas Reich
b0735775f3 Fix plot formatter not taking closures (#3260)
and fix their their comments
2023-08-15 19:46:04 +02:00
Andreas Reich
b896d641c5 Improved wgpu callbacks (#3253)
* Improved wgpu callbacks

* update documentation on egui_wgpu callbacks

* make shared callback resource map pub

* make it nicer to create epaint::PaintCallback from egui_wgpu callback

* constrain ClippedPrimitive lifetime to outlive wgpu::RenderPass

* Revert callback resources to TypeMap, put finish_prepare on callback trait

* doc string fixes
2023-08-15 17:17:39 +02:00
Emil Ernerfeldt
3c4223c6b1 Support images with rounded corners (#3257)
* Add `Rect::ZERO`

* Add `Rounding::ZERO`

* Add `RectShape::new`

* Add `Image::rounding` to support images with rounded corners
2023-08-15 09:29:30 +02:00
Konkitoman
18575d5931 Fix all warnings 2023-08-15 04:04:52 +03:00
Konkitoman
17cd31636f Remove unused Arc<RwLock<T>> 2023-08-15 02:21:23 +03:00
Konkitoman
191ee82c3e Merge branch 'master' of https://github.com/emilk/egui into multiples_viewports 2023-08-15 02:17:12 +03:00
Emil Ernerfeldt
481f44828c Improve "Reset everything" button in demo (#3255)
Closes https://github.com/emilk/egui/issues/3254
2023-08-14 18:57:39 +02:00
dmackdev
8ee506ec37 Added remove method for CollapsingState. (#3252) 2023-08-14 18:57:07 +02:00
Kamen Yovchevski
e5428a3084 Add Window::drag-to-scroll (#3118) 2023-08-14 18:44:29 +02:00
Kamen Yovchevski
043183a3a4 Add TableBuilder::drag_to_scroll (#3100)
* Add TableBuilder::drag_to_scroll

* Add reference to ScrollArea::drag_to_scroll
2023-08-14 18:21:42 +02:00
JohannesProgrammiert
dbe55ba46a Draw axis labels and ticks outside of plotting window (#2284)
* Always draw axis labels at plot borders

* Revert "Always draw axis labels at plot borders"

This reverts commit 9235e6603366d3b8a8189e2a5fc28c9780b7f54f.

* Add axis labels for plots

* First Draft of axis labels outside of plotting window

* plot: Tick placement of opposite axes and digit constraints

* plot: Axis label API

* plot: Update demo lib

* plot: resolve clippy warning

* Update changelog

* Remove default axis

* Fix clippy

* plot: Remove unused comments

* plot-axis: Rebase label opacity calculation on master

* plot: Resolve check.sh warnings

* plot-axis: Use 'into impl<WidgetText>' as axis label formatter

* plot-axis: Expose more conveniece functions to public API. Add axis labels to demo app

* plot-axes: Resolve ./scripts/check.sh warnings

* typo in comment

* Use `TAU` instead of the legacy `PI`

* Simpler generic syntax

* Use `Arc` to avoid some expensive clones

* Use `Margin` instead of a,b,c,d

* Add some vertical spacing

* De-duplicate color_from_contrast

* better naming

* Fix typos

* cnt -> num

* Axis are present by default, with empty names

* Add HPlacement and VPlacement

* Don't catch clicks and drags on axes

* Remove generics to minimize monomorphization code bloat

* Create helper function

* Remove changelog entry

* Simplify more

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2023-08-14 17:51:17 +02:00
Konkitoman
08f207a0a8 Fix some warnings 2023-08-14 17:59:26 +03:00
Emil Ernerfeldt
a3ae81cadb Add option to truncate text at wrap width (#3244)
* Add option to clip text to wrap width

* Spelling

* Better naming, and report back wether the text was elided

* Improve docstrings

* Simplify

* Fix max_rows with multiple paragraphs

* Add note

* Typos

* fix doclink

* Add `Label::elide`

* Label: show full non-elided text on hover

* Add demo of `Label::elide`

* Call it `Label::truncate`

* Clarify limitations of `break_anywhere`

* Better docstrings
2023-08-14 11:22:04 +02:00
Konkitoman
eccf90701f add: Context::get_viewport_id_by_name, Context::get_viewport_parent_id_by_name, Context::input_for and Context::input_mut_for 2023-08-13 16:20:02 +03:00
Konkitoman
4bbdab1788 Now in screen_rect min is the viewport position and max is the viewport size 2023-08-12 20:36:41 +03:00
Frederic L
1023f937a6 Add option to always open hyperlink in a new browser tab (#3242)
* add option to always open hyperlink in a new browser tab

* Fix logic error
2023-08-12 14:05:49 +02:00
lucasmerlin
1036cb1f7d Change force to be Option<f32> instead of f32 (#3240) 2023-08-12 13:50:40 +02:00
Emil Ernerfeldt
6633ecce64 Fix wrong detection of OS (#3238)
We had a bunch of `cfg!(windows)` and `cfg!(macos)` which should
have been `cfg!(target_os = "windows")`.

I wonder what the effects of this PR will be fore Windows 😬
2023-08-12 13:50:31 +02:00