Commit graph

118 commits

Author SHA1 Message Date
Emil Ernerfeldt
eca5e6a4d2
Update to Rust 1.65 (#2314)
* Update to Rust 1.65

Because then you can use dynamic linking on Linux

* Fix a bunch of clippy lints

* Update changelogs

* More clippy fixes
2022-11-16 19:08:03 +01:00
Clement Rey
f7019926dc
wgpu backend: do not try to render zero-sized surfaces (#2313)
* wgpu backend: do not try to render zero-sized surfaces

* reverse if

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2022-11-16 18:03:57 +01:00
Emil Ernerfeldt
9268f43896
eframe: make RequestRepaintEvent into an enum UserEvent (#2311)
Preparation for https://github.com/emilk/egui/pull/2294
to make that a smaller diff.
2022-11-16 12:17:41 +01:00
Robert Walter
0ff1ee3893
feat(combobox): implement text wrap for selected text (#2272)
* feat(combobox): implement text wrap for selected text

* chore(changelog): add line to changelog

* feat(combobox-text-wrap): make wrap boolean

- specifying a wrap width didn't really make sense so now it's boolean
- the selected text will now use the maximum available width while still
  respecting the spacing and icon coming after it

* feat(combobox-text-wrap): update changelog
2022-11-16 11:57:27 +01:00
Arshia Soleimani
0ba04184d5
Improve mouse selection accuracy (#2304)
* updated

* Update crates/egui/src/context.rs

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

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2022-11-16 11:26:02 +01:00
Matt Fellenz
690dc2d2e8
Add 'none' alias to Sense::hover (#2306) 2022-11-14 11:44:46 +01:00
Emil Ernerfeldt
ef931c406c
Add Window::pivot and position combo boxes better (#2303)
* Paint ComboBox icon differently if opening upwards

* Add Area::pivot and Window::pivot

* Add Window::contrain

* ComboBox: pop up above if it doesn't fit below

* Add line to changelog
2022-11-13 22:17:33 +01:00
LoganDark
f0f41d60e1
eframe: Don't show window until after initialization (#2279)
* Don't show window until after initialization

Shortens #1802, but does not completely solve it

* format code

* Present first frame immediately before showing window

This resolves the white flash almost completely, but is a hack. Window
visibility should be derived from the AppOutput, and the first frame
should not be painted before the event loop has processed initial
events.

Working on a better implementation.

* Integrate window showing with AppOutput

This allows an app to keep the window hidden (never shown) by calling
Frame.set_visible(false) on the first update. This includes a slightly
less nasty hack than the last commit did.

Also fixes an accidental cross-contamination of pull requests.

* fmt

* add comments

* add comments

* add comments

* add comments

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2022-11-13 20:30:52 +01:00
LoganDark
5bac853d9c
eframe: Repaint immediately on RepaintAsap, fixes #903 (#2280)
* eframe: Repaint immediately on RepaintAsap, fixes #903

This completely eliminates the white flickering seen on Windows when
rapidly resizing a window on the glow backend. The reason that happens
is because DWM only waits for the resize event to be delivered before
displaying the window at its new size. You must repaint synchronously
inside that iteration of the event loop or else you get flickering.

* Differentiate between RepaintAsap and RepaintNext

RepaintNext looks like it is indeed needed in at least one case instead
of RepaintAsap.

* Use RepaintNext in more situations

Starting to understand why this was the behavior. It looks like only a
few special cases should be given RepaintAsap, such as the window being
resized. All other cases should be RepaintNext, as it can wait.

Using RepaintAsap in all situations will cause things like lag when
changing a slider by keyboard with a high key repeat rate.

* Add explanatory comments

I am a total hypocrite for forgetting to add these.

* Rename RepaintAsap to RepaintNow

There is no notion of "possibility" here like there is when waiting for
RedrawEventsCleared. RepaintNow causes an immediate repaint no matter
what.

* Fix RepaintNow comment

"Delays" is ambiguous.
2022-11-13 20:30:39 +01:00
ItsEthra
f790e248e4
Fixed color edit popup going outside the screen (#2270)
* Fixed color edit popup going outside the screen

* Added option to constrain areas

* Constrain color picker area

* Constrain popups

* Updated changelog
2022-11-11 14:09:54 +01:00
Red Artist
8ff139687a
bump msrv 1.64 and tts + bindgen dep (#2274)
* bump msrv 1.64 and tts + bindgen dep

* Update crates/egui-winit/Cargo.toml

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

* Update crates/eframe/Cargo.toml

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

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2022-11-11 10:27:25 +01:00
Emil Ernerfeldt
e225c6b8d0 Opt-in logging of egui-wgpu using puffin 2022-11-10 16:28:08 +01:00
WesleyCh3n
b2edbe617e
Fixed Plot Line::fill does not fill last segment correctly (#2275)
* Fix missing vertex to fill the triangle

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2022-11-10 15:00:20 +01:00
Emil Ernerfeldt
b1e71d308f
Only show tooltips when mouse pointer is still (#2263)
* Only show tooltips when mouse pointer is still

Revert to the old behavior by setting
`style.interaction.show_tooltips_only_when_still = false`.

* Area: take `impl Into<Id>`

* refactor tooltips

* Fix was_tooltip_open_last_frame

* Bug fix

* Add some spacing between tooltips
2022-11-09 19:35:08 +01:00
Emil Ernerfeldt
51ff32797d
Give each tooltip area its own unique Id (#2264)
* Don't check for clicks on non-interactive areas

* Give each tooltip area its own unique Id
2022-11-08 11:04:54 +01:00
Emil Ernerfeldt
35213606c4 Bug fix: don't paint panel separation lines on top of everything else 2022-11-08 08:27:49 +01:00
Emil Ernerfeldt
5515d2db77 Add ui.centered 2022-11-08 01:07:51 +01:00
Emil Ernerfeldt
c3edc1b88e fix mistake added in #2261 2022-11-08 00:51:50 +01:00
Emil Ernerfeldt
4aacb4575b
Panel visual improvements (#2261)
* Remove stroke around panels and replace with separator single line

* Remove item_spacing between panels

* Update changelog
2022-11-08 00:34:31 +01:00
qthree
75a825e9a1
Fix ScrollArea::show_rows (#2258) 2022-11-07 23:26:01 +01:00
blusk
3805a3282f
feat: add a way to provide customable scaling to SVG rasterization (#2252) 2022-11-07 16:52:14 +01:00
Emil Ernerfeldt
b3ab47a594 eframe: warn if web_sys_unstable_apis was not set 2022-11-07 14:00:00 +01:00
Emil Ernerfeldt
d5eb8779cb
Allow overlapping interactive widgets (#2244)
* Turn off optimization for debug builds again

* Optimize rect_contains_pointer

* Fix for colorpicker: make popup immovable

* Area: interact first

* ScrollArea: do interaction first

* Window: shrink double-clickable area of titelbar

* Only the top-most (latest added) interactive widget gets `hovered=true`

* Add Frame::total_margin

* Update changelog

* Add debug-options to visualize what widgets cover which other widget
2022-11-07 12:44:35 +01:00
Emil Ernerfeldt
8c76b8caff
Update op puffin 0.14.0 (#2257) 2022-11-07 12:37:37 +01:00
Emil Ernerfeldt
eec18290a4
eframe: make sure to update native_pixels_per_point when dpi changes (#2256)
* eframe: make sure to update native_pixels_per_point when dpi changes

* Update changelog
2022-11-07 12:36:17 +01:00
axxop
940b896cbb
use RandomState::with_seeds replace AHasher::default (#2254)
* use `RandomState::with_seeds` replace `AHasher::default`

* remove history checkout

* update seeds to `1,2,3,4`
2022-11-07 10:53:07 +01:00
Emil Ernerfeldt
17501d7e3e
Update arboard, fixing copy-paste on X11 (#2238)
* Revert "Fix copy-paste on Windows (#2120)"

This reverts commit f61044cef7.

* Update arboard to 3.2
2022-11-07 09:54:42 +01:00
Max Wase
22a917c00a
Painter extend accepts IntoIter (#2249)
* `Painter` extend accepts `IntoIter`

* Update painter.rs
2022-11-07 09:32:28 +01:00
Emil Ernerfeldt
e48602059d
Update ahash to 0.8.1 (#2255) 2022-11-07 09:23:45 +01:00
Steven Casper
7434a7d7d5
Implement Debug for egui::Context (#2248)
* Implement Debug for Context

* Update changelog
2022-11-06 22:49:29 +01:00
Emil Ernerfeldt
a0b3f1126b
Add helpers for zooming an app using Ctrl+Plus and Ctrl+Minus (#2239)
* Using tracing-subscriber in hello_world example

* Add Key::Plus/Minus/Equals

* Warn if failing to guess OS from User-Agent

* Remove jitter when using Context::set_pixels_per_point

* Demo app: zoom in/out using ⌘+ and ⌘-

* Demo app: make backend panel GUI scale slider better

* Optimize debug builds a bit

* typo

* Update changelog

* Add helper module `egui::gui_zoom` for zooming an app

* Better names, and update changelog

* Combine Plus and Equals keys

* Last fix

* Fix docs
2022-11-05 11:18:13 +01:00
Mikhail Sheldyakov
25718f2774
fix comment for WebOptions follow_system_theme (#2233) 2022-11-05 09:20:53 +01:00
Clement Rey
fcb00723bc
wgpu: add support for user-level command buffers + viewport clarification (#2230)
* wgpu: add support for user-level command buffers
* updated wgpu demo app
2022-11-04 09:54:29 +01:00
ItsEthra
4d1e858a52
Use total_cmp for clamping drag value in order to avoid floating point ambiguities (#2213)
* Use total_cmp for clamping DragValue

* Added test for clamping

* Increase MSRV in all crates

* Increased rust version for github actions and lib.rs

* Inversed ranges are now working properply with clamp_to_range

* Added more tests
2022-11-02 19:38:39 +01:00
Emil Ernerfeldt
34e6e12f00
Specify deifferent minification and magnification filters (#2224)
* Specify deifferent minification and magnification filters

* Fixes

* Update changelogs

* Doctest fixes

* Add deprecation notice for RetainedImage::with_texture_filter
2022-11-02 17:54:06 +01:00
ItsEthra
76d0cf5034
Fixed datepicker not being marked as changed (#2208) 2022-10-31 21:40:49 +01:00
Antoine Marras
1fb19f08ce
Typo in egui, layout: alignmen => alignment (#2209) 2022-10-31 21:39:49 +01:00
Andreas Reich
4c82519fb8
configurable wgpu backend (#2207)
* introduce new wgpu configuration option to allow configuring wgpu renderer

* use new options with wgpu web painter

* use on_surface_error callback

* changelog update

* cleanup

* changelog and comment fixes
2022-10-31 17:57:32 +01:00
ItsEthra
f71cbc2475
Fixed menu popups going outside of the screen (#2191)
* Fixed menu popups going outside of the screen

* Made menu appear above above the button instead
2022-10-31 17:57:15 +01:00
Emil Ernerfeldt
02b9d2d082
Keyboard shortcut helpers (#2202)
* eframe web: Add WebInfo::user_agent

* Deprecate `Modifier::ALT_SHIFT`

* Add code for formatting Modifiers and Key

* Add type KeyboardShortcut

* Code cleanup

* Add Context::os/set_os to query/set what OS egui believes it is on

* Add Fonts::has_glyph(s)

* Add helper function for formatting keyboard shortcuts

* Faster code

* Add way to set a shortcut text on menu buttons

* Cleanup

* format_keyboard_shortcut -> format_shortcut

* Add TODO about supporting more keyboard sumbols

* Modifiers::plus

* Use the new keyboard shortcuts in emark editor demo

* Explain why ALT+SHIFT is a bad modifier combo

* Fix doctest
2022-10-31 12:58:26 +01:00
Mason Feurer
d97282cd92
Interact with non-Rect shapes (#2199)
* added Ui::interact_with_hovered

* fixed typo
2022-10-30 20:59:19 +01:00
Emil Ernerfeldt
2b1341095d
CI: Run cargo clippy for wasm32-unknown-unknown (#2200)
* CI: Run cargo clippy for wasm32-unknown-unknown

* wasm32 clippy fixes

* Document when AppRunner::new can fail
2022-10-30 20:55:07 +01:00
Andreas Reich
53b800502a
wgpu renderer no longer creates a sampler with every texture (#2198) 2022-10-30 15:14:45 +01:00
Emil Ernerfeldt
f7a15a34f9
Panel collapse/expansion animation (#2190)
* Add API for querying the size of a panel

* demo app: animate backend panel collapse

* Add helper function for animating panels

* More animation functions

* Add line to changelog
2022-10-28 11:51:56 +02:00
Emil Ernerfeldt
da96fcacd3 Improve panel sizing API 2022-10-28 10:16:02 +02:00
Lily M. Lyons
1fadc7396a
Add CollapsingHeader::show_unindented (#2154) 2022-10-24 17:10:13 +02:00
Emil Ernerfeldt
aebec6329a Use ⚠ instead of ‼ in "Debug build" warning
The latter is not supported by the default fonts
2022-10-24 15:00:50 +02:00
Emil Ernerfeldt
7b8c17042c eframe: Make fullsize_content mac-only 2022-10-21 08:55:56 +02:00
Paul Hazen
5e44c13b48
Allows creating a ColorImage struct without an alpha channel (#2167)
* Added functionality to image.rs that allows for creating an image from rgb instead of just rgba

* remove "unmultiplied"

* remove "unmultiplied"

* rgba -> rgb

Co-authored-by: Mingun <Alexander_Sergey@mail.ru>

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
Co-authored-by: Mingun <Alexander_Sergey@mail.ru>
2022-10-19 15:01:53 +02:00
Clement Rey
3d36a20376
table: fix deadlocks caused by lock fairness (#2156) 2022-10-16 20:10:48 +02:00