Commit graph

2467 commits

Author SHA1 Message Date
Emil Ernerfeldt
d15ce22e2e winit: Fix bug where the cursor could get stuck using the wrong icon 2023-02-05 08:48:40 +01:00
hinto-janaiyo
628c84cbee
Add trailing_fill() toggle to Slider (#2660)
* slider: add trailing_color toggle

* slider/visuals: add global option in visuals with override toggle

* slider: add to demos

* use `.unwrap_or_else()` instead of match
2023-02-05 08:17:58 +01:00
Luc (Echow) Varoqui
212656f3fc
Fix set_plot_bounds (#2653) 2023-02-04 16:17:15 +01:00
Emil Ernerfeldt
660566c499
eframe: ask if the window is minimized or maximized (#2672)
* eframe: ask if the window is minimized or maximized

* Improve note
2023-02-04 16:05:23 +01:00
Hoping White
430cbe541c
New feature to support unity vertex layout requirement (#2493)
* Update mesh.rs

adjust Vertex layout

* add unity feature

* add unity feature

* document the `unity` feature flag

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2023-02-04 15:33:41 +01:00
Sheldon M
53f8e4049f
Position persistence and sane clamping to still-available monitors for Windows (#2583)
* Attempt to fix monitor clamping on Windows so window positions can be restored between sessions.

* Missed a change.

* Renamed variables, reorganized some lines of code, and added some more comments.

* Cargo fmt run

* Updated CHANGELOG.md to briefly describe my change

* Updated CHANGELOG.md to briefly describe my change

* Applied suggested fixes from emilk
Discovered an issue where putting the monitor off a non-primary monitor to the left causes the position to be off the monitor x and y range, clamping to the primary instead of the non-primary.

* Fix for matching negative restored window positions. Should clamp if any part of the window had been visible on a remaining monitor.

* Apparently compiler attributes on statements have been marked unstable.
Rather than just wrap in blocks, I kind of prefer the more explicit if cfg! call for line 114.

CHANGELOG.md - correct a missing paren I noticed

* I was being silly, I don't need to clone inner_size_points on line 112

* Cargo fmt run

* Update crates/egui-winit/CHANGELOG.md

emilk suggested changelog formatting

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

* Update window_settings.rs

Satisfy CI Error

* clippy

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2023-02-04 15:33:32 +01:00
SunDoge
f0718a61d3
eframe: add set_minimized and set_maximized (#2292)
* add actions for window controls

* add maximized to WindowInfo
update button text
fix clippy

* add overlap icon when maximized

* remove argument `app`

* remove WindowInfo { maximized }

* Update minimum window size

* Double-click titlebar to toggle maximized state

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2023-02-04 14:42:42 +01:00
tlhenvironment
fb5cb3052d
Fix typo in docstring (#2643)
Tiny typo fix <3
2023-02-04 13:53:20 +01:00
itfanr
9c270448a6
Add link to tauri-egui in README.md
add a 3rd party integration: tauri-egui for tauri
2023-02-04 13:52:47 +01:00
lictex_
d15f4ef992
select all text when dragvalue gets focus (#2650) 2023-02-04 13:46:16 +01:00
Emil Ernerfeldt
21a59143a4
cargo update (#2671)
* cargo update

    Updating crates.io index
    Updating ab_glyph v0.2.18 -> v0.2.20
    Updating ab_glyph_rasterizer v0.1.7 -> v0.1.8
    Updating ahash v0.8.2 -> v0.8.3
    Updating anyhow v1.0.66 -> v1.0.68
    Updating async-broadcast v0.4.1 -> v0.5.0
    Updating async-recursion v1.0.0 -> v1.0.2
    Updating async-trait v0.1.59 -> v0.1.64
    Updating atomic_refcell v0.1.8 -> v0.1.9
    Updating bumpalo v3.11.1 -> v3.12.0
    Updating bytemuck v1.12.3 -> v1.13.0
    Updating bytemuck_derive v1.3.0 -> v1.4.0
    Updating bytes v1.3.0 -> v1.4.0
    Updating calloop v0.10.3 -> v0.10.5
    Updating cc v1.0.77 -> v1.0.79
    Removing chunked_transfer v1.4.0
    Updating clipboard-win v4.4.2 -> v4.5.0
    Updating concurrent-queue v2.0.0 -> v2.1.0
    Updating cxx v1.0.83 -> v1.0.89
    Updating cxx-build v1.0.83 -> v1.0.89
    Updating cxxbridge-flags v1.0.83 -> v1.0.89
    Updating cxxbridge-macro v1.0.83 -> v1.0.89
    Updating document-features v0.2.6 -> v0.2.7
    Updating dyn-clone v1.0.9 -> v1.0.10
    Updating either v1.8.0 -> v1.8.1
    Updating enum-map v2.4.1 -> v2.4.2
    Updating enum-map-derive v0.10.0 -> v0.11.0
    Updating futures-core v0.3.25 -> v0.3.26
    Updating futures-io v0.3.25 -> v0.3.26
    Updating futures-sink v0.3.25 -> v0.3.26
    Updating futures-task v0.3.25 -> v0.3.26
    Updating futures-util v0.3.25 -> v0.3.26
    Updating glob v0.3.0 -> v0.3.1
    Updating heck v0.4.0 -> v0.4.1
    Updating image v0.24.4 -> v0.24.5
    Updating itoa v1.0.4 -> v1.0.5
    Updating jpeg-decoder v0.2.6 -> v0.3.0
    Updating js-sys v0.3.60 -> v0.3.61
    Updating libc v0.2.138 -> v0.2.139
    Updating link-cplusplus v1.0.7 -> v1.0.8
    Updating nom v7.1.1 -> v7.1.3
      Adding nom8 v0.2.0
    Updating num_enum v0.5.7 -> v0.5.9
    Updating num_enum_derive v0.5.7 -> v0.5.9
    Updating once_cell v1.16.0 -> v1.17.0
    Updating ordered-stream v0.1.2 -> v0.1.4
    Updating owned_ttf_parser v0.17.1 -> v0.18.1
    Updating parking_lot_core v0.9.5 -> v0.9.7
    Updating paste v1.0.9 -> v1.0.11
    Updating plist v1.3.1 -> v1.4.0
    Updating polling v2.5.1 -> v2.5.2
    Updating proc-macro-crate v1.2.1 -> v1.3.0
    Updating proc-macro2 v1.0.47 -> v1.0.50
    Updating puffin v0.14.0 -> v0.14.2
    Updating puffin_http v0.11.0 -> v0.11.1
      Adding quick-xml v0.26.0
    Updating quote v1.0.21 -> v1.0.23
    Updating regex v1.7.0 -> v1.7.1
    Updating rustls v0.20.7 -> v0.20.8
    Updating ryu v1.0.11 -> v1.0.12
    Updating scratch v1.0.2 -> v1.0.3
    Updating serde v1.0.149 -> v1.0.152
    Updating serde_derive v1.0.149 -> v1.0.152
    Updating serde_json v1.0.89 -> v1.0.91
    Updating serde_repr v0.1.9 -> v0.1.10
    Updating syn v1.0.105 -> v1.0.107
    Updating termcolor v1.1.3 -> v1.2.0
    Updating thiserror v1.0.37 -> v1.0.38
    Updating thiserror-impl v1.0.37 -> v1.0.38
    Updating tinyvec_macros v0.1.0 -> v0.1.1
    Updating toml v0.5.9 -> v0.5.11
      Adding toml_datetime v0.5.1
      Adding toml_edit v0.18.1
    Updating ttf-parser v0.17.1 -> v0.18.1
    Updating typenum v1.15.0 -> v1.16.0
    Updating unicode-bidi v0.3.8 -> v0.3.10
    Updating unicode-ident v1.0.5 -> v1.0.6
    Updating ureq v2.5.0 -> v2.6.2
    Updating wasm-bindgen v0.2.83 -> v0.2.84
    Updating wasm-bindgen-backend v0.2.83 -> v0.2.84
    Updating wasm-bindgen-futures v0.4.33 -> v0.4.34
    Updating wasm-bindgen-macro v0.2.83 -> v0.2.84
    Updating wasm-bindgen-macro-support v0.2.83 -> v0.2.84
    Updating wasm-bindgen-shared v0.2.83 -> v0.2.84
    Updating wayland-sys v0.30.0 -> v0.30.1
    Updating web-sys v0.3.60 -> v0.3.61
    Updating webbrowser v0.8.6 -> v0.8.7
    Updating webpki-roots v0.22.5 -> v0.22.6
    Updating which v4.3.0 -> v4.4.0
    Updating x11-dl v2.20.1 -> v2.21.0
    Updating zbus v3.6.2 -> v3.8.0
    Updating zbus_macros v3.6.2 -> v3.8.0
    Updating zbus_names v2.4.0 -> v2.5.0
    Updating zstd-sys v2.0.4+zstd.1.5.2 -> v2.0.6+zstd.1.5.2
    Updating zvariant v3.9.0 -> v3.10.0
    Updating zvariant_derive v3.9.0 -> v3.10.0

* Remove unnecessary import of wasm_bindgen::JsCast (its now in prelude)

* egui_glow/README.md: add line on how to run the example

* revert wasm-bindgen update

* Revert "Remove unnecessary import of wasm_bindgen::JsCast (its now in prelude)"

This reverts commit 95c3076cce76577d9f0f35e48f99b4acd2dbe62e.
2023-02-04 13:41:34 +01:00
Emil Ernerfeldt
06d753c289
Update SVG crates (#2670)
* Update resvg, tiny-skia and usv to latest

* Remove default features from svg crates

Users can always opt-in to them themselves

* Update png 0.17.6 -> 0.17.7
2023-02-04 13:00:04 +01:00
Emil Ernerfeldt
8344e88f8a
Update to to winit 0.28 (#2654)
* Update to winit 0.28

Mac trackpads pinch gestures will now generate `egui::Event::Zoom`

* Update accesskit_winit

* Try to get Android CI green

* Fix wayland compilation

* Add comment about android-activity

* Update changelogs

* Fix call to register_xlib_error_hook
2023-02-04 12:43:43 +01:00
Emil Ernerfeldt
e4eaf99072
Remove native screen reader support (#2669)
* Remove native screen reader support

Use the "accesskit" feature flag to `eframe` instead.
[AccessKit](https://github.com/AccessKit/accesskit) is the future.

`tts` was a mess to compile on many platforms, so I no longer want
the native `tts` dependency.

* Update tts to 0.25

* Update changelogs

* Turn on all feature flags for package.metadata.docs.rs

* remove tts from deny.toml skip-tree

* Update web build scripts

* Update deny.toml
2023-02-04 11:47:36 +01:00
Emil Ernerfeldt
1353a5733f
Deprecate egui_glium - looking for new maintainer (#2668)
* Deprecate egui_glium - looking for new maintainer

egui_glium was the first backend of egui, and it served us well for
a long time, but we have long since moved on to glow and wgpu.

Not egui_glium is holding back an update to latest winit.

Since development on glium has long since been discontinued I will
therefore deprecate egui_glium with this PR.

The code is still there in the repository for a while longer,
but is no longer compiled.

If there is any interest in maintaining egui_glium, then fork it and
make a PR to remove the last egui_glium from this repository.
I will give you publish rights on crates.io.

* update glutin 0.30.2 -> 0.30.3

* cargo update -p backtrace

    Updating crates.io index
    Updating addr2line v0.17.0 -> v0.19.0
    Updating backtrace v0.3.66 -> v0.3.67
    Updating gimli v0.26.2 -> v0.27.1
    Removing miniz_oxide v0.5.4
    Updating object v0.29.0 -> v0.30.3

* cargo deny: allow duplicates of windows-sys, wayland-sys, and nix

* cargo-deny whitelist tiny-skia
2023-02-04 11:21:02 +01:00
Andreas Reich
8aa07e9d43
Clear color values are now explicitely sent to the rendering backend as-is. (#2666)
* Clear color values are not explicitely sent to the rendering backend as-is.
Previously, converting from Color32 to Rgba caused an srgb->linear conversion. This conversion is incorrect if the backbuffer doesn't perform automatic conversion from linear->srgb (lack of this conversion is generally what egui assumes!).

* fill in pr numbers in changelog

* Epi comment fix

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

* Color32 comment fix

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

* move changelog line

* rename fix

* use backticks in doc

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2023-02-04 11:02:15 +01:00
Emil Ernerfeldt
a6b60d5d58
Control Separator widths, and less clipping in ScrollArea (#2665)
* Add Separator::grow and Separator::shrink

* Be more conservative with the clipping in ScrollArea:s

* Add test of the growing separator

* Improve test output

* Update changelog

* Add back a little bit more clipping

* Make the minimum scroll handle length a bit longer

* More clip rect tweaks
2023-02-03 13:19:25 +01:00
John Hughes
8c59888ebd
Add simple Windows CI workflow check (#2663)
* Add simple Windows CI workflow check

* Fix Windows build in CI

* Windows fix
2023-02-03 13:19:12 +01:00
NemuiSen
5725868b57
ggez-egui was renamed to ggegui (#2662) 2023-02-03 10:59:28 +01:00
Emil Ernerfeldt
8c3d8b3ba5 Make sure the panel resize lines are visible when hovered/resizing 2023-02-03 09:31:24 +01:00
Emil Ernerfeldt
312cab5355 Export egui::Margin 2023-02-03 09:31:04 +01:00
Emil Ernerfeldt
5444ab269a Add Response::with_new_rect 2023-02-02 21:12:06 +01:00
Emil Ernerfeldt
d01e4342f0
Update accesskit_winit and dark_light (#2655)
* Update accesskit_winit to 0.8.1

* Update dark_light to 1.0
2023-01-31 10:41:27 +01:00
Emil Ernerfeldt
cc20dcb9d0
eframe: Improve window centering (#2651)
* Create the winit::Window in one unified place

* Fix wrong unit of initial_window_pos

* Improve centering
2023-01-30 15:52:30 +01:00
Emil Ernerfeldt
f222ee044e Fix for highlighting SelectableLabel 2023-01-28 00:21:53 +01:00
Emil Ernerfeldt
c72bdb77b5
Add ability to highlight any widget (#2632)
* Add ability to highlight any widget

* Add line to changelog

* Demote the demo to a test
2023-01-27 23:36:14 +01:00
Emil Ernerfeldt
e7c0547e23
DragValue and Slider text is now proportional instead of monospace (#2638)
* DragValue and Slider text is now proportional instead of monospace

Control with `Style::drag_value_text_style`

* Update changelog
2023-01-27 23:30:20 +01:00
Emil Ernerfeldt
fe7ff66266
Make the line left of indented regions optional (#2636)
* Make the line left of indented regions optional

Controlled with Visuals::indent_has_left_vline

* Add line to changelog

* Fix doclink
2023-01-27 11:12:08 +01:00
Red Artist
ce62b61e15
wgpu upgraded to 0.15. demo working on linux (#2629) 2023-01-27 09:19:47 +01:00
Emil Ernerfeldt
4a0bafbeab
Update webbrowser (#2631)
* Update webbrowser

* Update webbrowser in Cargo.toml too

Make sure all users get updated too
2023-01-26 11:31:39 +01:00
Emil Ernerfeldt
5b1cad2b72 Constrain menus to the screen 2023-01-26 11:13:21 +01:00
Emil Ernerfeldt
8ce0e1c520
Avoid deadlocks by using lambdas for context lock (#2625)
ctx.input().key_pressed(Key::A) -> ctx.input(|i| i.key_pressed(Key::A))
2023-01-25 10:24:23 +01:00
lictex_
eee4cf6a82
add functions to check which button triggered a drag start & end (#2507)
* add button release events for drags

* add utility functions

* fix CHANGELOG.md

* fix CHANGELOG.md

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2023-01-24 10:11:32 +01:00
Emil Ernerfeldt
4bd4eca2e4
Add ability to hide button backgrounds (#2621)
* Add Spacing::combo_width

* Put ComboBox arrow closer to the text

* Tweak faint_bg_color

* Make it possible to have buttons without background

…while still having background for sliders, checkboxes, etc

* Rename mandatory_bg_fill -> bg_fill

* tweak grid stripe color (again)

* Make the animated part of the ProgressBar more visible

* Add line in changelog

* Add another line in changelog

* Menu fix: use the `open` widget style for open menus

* Adjust sizes on menu buttons and regular buttons to make sure they match

* Update comment

Co-authored-by: Andreas Reich <andreas@rerun.io>

* optional_bg_fill -> weak_bg_fill

Co-authored-by: Andreas Reich <andreas@rerun.io>
2023-01-24 10:11:05 +01:00
Emil Ernerfeldt
c75e72693c Fix rendering of (ellipsis)
Broken when we introduced thing space support
2023-01-23 20:24:38 +01:00
Pâris DOUADY
518b4f447e
Allow changing ProgressBar fill color (#2618) 2023-01-23 15:33:02 +01:00
Emil Ernerfeldt
d4f9f6984d Fix red doctest 2023-01-23 15:04:35 +01:00
Weasy
356ebe55da
Add rounding fn to Button, to enable rounded buttons (#2616) 2023-01-23 12:37:39 +01:00
LEAVING
5029575ed0
Fix typo: 'Viewport width' -> 'Viewport height' (#2615) 2023-01-23 12:37:26 +01:00
Timon
30e49f1da2
Expose area interactable and movable to Window api. (#2610)
* Expose area interactable to window.

* Add movable function

* update dockstring
2023-01-23 12:37:15 +01:00
lictex_
01bbda4544
check point count before tessellating bezier (#2506) 2023-01-23 12:20:05 +01:00
Ales Tsurko
f87c6cbd7c
Derive Hash for KeyboardShortcut and Modifiers (#2563) 2023-01-23 10:06:54 +01:00
RadonCoding
ce5472633d
Fix close button not working (#2533)
* Fix close button not working

By adding the close button after the title bar drag listener the close button will sense clicks.

* Update main.rs
2023-01-23 09:55:57 +01:00
Robert Walter
0ad8aea811
Fix: button_padding when using image+text buttons (#2510)
* feat(image-button-margin): implement image button margin

- add `image_margin` field on `Button` widget
- implement setter method called `image_margin` for `Button` widget
- use margin from `image_margin` field of `Button` widget in `Widget`
  trait functions

* feat(image-button-margin): update changelog

* feat(image-button-margin): implement `map_or` clippy fix

* feat(image-button-margin): remove margin field & fix button-padding instead

* feat(image-button-margin): fix CI errors

* feat(image-button-margin): update changelog to include fix

* feat(image-button-margin): re-add changes after creating screenshots for PR
2023-01-23 09:23:57 +01:00
Fangdun Tsai
53b1d0e5e9
Add menu with an image button (#2488) 2023-01-23 08:22:43 +01:00
apoorv569
0eabd894bd
Fix typo in cargo run command. (#2582)
I think someone by mistake wrote `cargo run -p hello_world` instead of `cargo run -p keyboard_events`.
2023-01-17 10:58:38 +01:00
Emil Ernerfeldt
cd0f66b9ae
eframe web: ctrl-P and cmd-P will not open the print dialog (#2598) 2023-01-16 14:40:19 +01:00
Andreas Reich
60b4f5e3fe
changelog & doc fix for #2539 (Window::default_open) 2023-01-07 20:51:01 +01:00
joffreybesos
f7ed135192
window starting collapsed state (#2539) 2023-01-07 20:48:49 +01:00
Kornel
e70204d726
Point to caller's location when using log_or_panic (#2552) 2023-01-07 20:27:19 +01:00