Commit Graph
100 Commits
Author SHA1 Message Date
Emil Ernerfeldt b8f427ddd6 Add a Code of Conduct, based on the Contributor Covenant
Taken verbatim (with an added mention of the egui Discord) from
https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
2022-02-21 15:30:53 +01:00
Emil Ernerfeldt b360dffdbf Demo app: handle the case of wrong selected anchor 2022-02-21 15:29:18 +01:00
Emil Ernerfeldt c3fc8997d6 Introduce egui_extras with RetainedImage for loading svg,png,jpeg,… (#1282) 2022-02-21 15:26:26 +01:00
Emil Ernerfeldt 713917e481 refactor egui_web (break up lib.rs) 2022-02-21 09:28:12 +01:00
Emil Ernerfeldt 89d19860b8 Misc code cleanup, docs fixes, etc 2022-02-19 20:58:28 +01:00
Emil Ernerfeldt e49245fae5 Improve the anti-aliasing of filled paths with sharp corners
This comes at the cost of these corners sometimes becoming badly
extruded instead. The sharper the corner, the bigger the problem.

A proper fix will have to wait for later.

Part of https://github.com/emilk/egui/issues/1226
2022-02-19 20:46:44 +01:00
Emil Ernerfeldt b8fbbf7d62 Fix anti-aliasing of filled paths with counter-clockwise winding order
Part of https://github.com/emilk/egui/issues/1226
2022-02-19 20:46:44 +01:00
Emil Ernerfeldt 10634fc344 Improve the Bézier demo: drag control points and simplify code
Follow-up to https://github.com/emilk/egui/pull/1178
2022-02-19 20:46:44 +01:00
Emil Ernerfeldt 3a5ec4733f Fix bug when debug-painting clip rectangles 2022-02-19 20:46:40 +01:00
Emil Ernerfeldt aa53522179 Slider event fixes (#1270)
* Slider: return drag_started,dragged,drag_released if value was dragged

Closes https://github.com/emilk/egui/issues/1269

* Fix: DragValue correctly reports gained_focus

* Make `Slider` report gained_focus,has_focus,lost_focus from DragValue

Closes https://github.com/emilk/egui/issues/1268
2022-02-19 19:56:12 +01:00
Emil Ernerfeldt 3ed68274b0 Make Slider report gained_focus,has_focus,lost_focus from DragValue
Closes https://github.com/emilk/egui/issues/1268
2022-02-19 11:12:09 +01:00
Emil Ernerfeldt 0d21405855 Fix: DragValue correctly reports gained_focus 2022-02-19 11:05:02 +01:00
Emil Ernerfeldt 989a6d202f Slider: return drag_started,dragged,drag_released if value was dragged
Closes https://github.com/emilk/egui/issues/1269
2022-02-19 10:58:07 +01:00
Emil Ernerfeldt 3d754e3a16 Prevent ScrollArea:s from becoming tiny (#1255)
Closes https://github.com/emilk/egui/issues/1097
2022-02-17 17:08:05 +01:00
Emil Ernerfeldt b5c8f034e7 Add web location info to egui_web/epi (#1258)
This adds all parts of the web "location" (URL) to frame.info().web_info, included a HashMap of the query parameters, percent-decoded and ready to go.

This lets you easily pass key-value pairs to your eframe web app.
2022-02-17 16:46:43 +01:00
Emil Ernerfeldt 4e316d32e5 Fix scroll_to with align
Broke in https://github.com/emilk/egui/pull/1252
2022-02-17 16:45:42 +01:00
Emil Ernerfeldt 4af3cae26d Scroll so that text cursor remains visible (#1252)
Closes https://github.com/emilk/egui/issues/165
2022-02-16 21:34:47 +01:00
Emil Ernerfeldt c1cd47e3a7 README: Add section to FAQ about how to work with async code 2022-02-13 23:04:08 +01:00
Emil Ernerfeldt f92df7db56 README: Add screenshot to demonstrate the skin-ability of egui 2022-02-13 23:04:08 +01:00
Emil Ernerfeldt 69626296f1 Make v-align and scale of user fonts tweakable (#1241)
* Add ability to "tweak" the scale and y-offsets of individual fonts
* Change default font tweak

This help vertically center large text.
2022-02-12 18:22:42 +01:00
Emil Ernerfeldt 3f8ba3a542 Improve the contrast of the default light mode style (#1238)
Makes backgrounds brighter and foregrounds darker.
2022-02-11 13:58:50 +01:00
Emil Ernerfeldt 815598a842 .vscode/settings.json: insertFinalNewline and trimTrailingWhitespace
For when people make PR:s touching .toml, .md files
2022-02-10 19:34:07 +01:00
Emil Ernerfeldt b2323bd13e Add VSCode settings with {"editor.formatOnSave": true}
Hopefully this will increase the number of PR:s with correct formatting.
2022-02-09 18:14:55 +01:00
Emil Ernerfeldt 4cede42748 Add ui.weak(text) 2022-02-09 15:08:01 +01:00
Emil Ernerfeldt defc400c21 Add an example of how to display an SVG image in egui (#1228) 2022-02-09 08:12:12 +01:00
Emil Ernerfeldt 603ec82a5e cargo deny: clarify MPL-2.0 license and use un-patched ureq again (#1222)
See https://github.com/algesten/ureq/issues/478#issuecomment-1031029647
2022-02-07 10:38:08 +01:00
Emil Ernerfeldt 5459ab29b7 Fix: allow calling set_pixels_per_point before first frame
Closes https://github.com/emilk/egui/issues/1153
2022-02-06 00:16:59 +01:00
Emil Ernerfeldt 55067f54ce Demo app fix: respect native pixels_per_point on startup 2022-02-05 23:54:44 +01:00
Emil Ernerfeldt cbc53fbe2e eframe: Add epi::NativeOptions::initial_window_pos 2022-02-05 19:12:03 +01:00
Emil Ernerfeldt 9ed96155e9 Rename corner_radius to rounding
Also update changelogs and clean up other aspects of
https://github.com/emilk/egui/pull/1206
2022-02-05 18:13:46 +01:00
Emil Ernerfeldt ace2ac00da Update to tts 0.20.2 which resolves copy-left license issue
See https://github.com/ndarilek/tts-rs/pull/21
2022-02-05 17:53:37 +01:00
Emil Ernerfeldt 0fa4bb9c64 Clean up all Cargo.toml: put features higher, and document them better 2022-02-05 11:11:15 +01:00
Emil Ernerfeldt 712d8c9a2b Run cargo deny in CI (#1205)
* Run cargo deny in CI
* Use patched fork of ureq to avoid copy-left license
* Use patched fork of tts to avoid LGPL license

More:
* https://github.com/ndarilek/tts-rs/pull/21
* https://github.com/algesten/ureq/pull/479
2022-02-04 22:08:15 +01:00
Emil Ernerfeldt 1b623fdd34 Update rfd 0.6 -> 0.7 2022-02-04 13:31:06 +01:00
Emil Ernerfeldt 47038c631e Update image 0.23 -> 0.24 2022-02-04 13:31:06 +01:00
Emil Ernerfeldt 8dfa6ce2f0 Update tts 0.19 -> 0.20 2022-02-04 13:18:03 +01:00
Emil Ernerfeldt 3999e5b373 cargo update
Updating crates.io index
    Removing anyhow v1.0.52
    Updating atk-sys v0.14.0 -> v0.15.1
    Updating backtrace v0.3.63 -> v0.3.64
    Updating cairo-sys-rs v0.14.9 -> v0.15.1
    Updating cfg-expr v0.8.1 -> v0.9.1
    Updating clang-sys v1.3.0 -> v1.3.1
    Updating crc32fast v1.3.0 -> v1.3.1
    Updating enum-map v2.0.0 -> v2.0.1
    Updating enum-map-derive v0.7.0 -> v0.8.0
    Updating gdk-pixbuf-sys v0.14.0 -> v0.15.1
    Updating gdk-sys v0.14.0 -> v0.15.1
    Updating gio-sys v0.14.0 -> v0.15.4
    Updating glib-sys v0.14.0 -> v0.15.4
    Updating gobject-sys v0.14.0 -> v0.15.1
    Updating gtk-sys v0.14.0 -> v0.15.3
    Updating heck v0.3.3 -> v0.4.0
    Updating js-sys v0.3.55 -> v0.3.56
    Updating libc v0.2.116 -> v0.2.117
    Updating lock_api v0.4.5 -> v0.4.6
    Updating mint v0.5.8 -> v0.5.9
    Updating nix v0.22.0 -> v0.22.3
      Adding num_threads v0.1.3
    Updating pango-sys v0.14.0 -> v0.15.1
    Updating quote v1.0.14 -> v1.0.15
    Updating rfd v0.6.3 -> v0.6.4
    Updating serde v1.0.133 -> v1.0.136
    Updating serde_derive v1.0.133 -> v1.0.136
    Updating serde_json v1.0.75 -> v1.0.78
    Removing strum v0.21.0
    Removing strum_macros v0.21.1
    Updating syn v1.0.85 -> v1.0.86
    Updating system-deps v3.2.0 -> v6.0.1
    Updating time v0.3.5 -> v0.3.7
    Updating tracing v0.1.29 -> v0.1.30
    Updating tracing-attributes v0.1.18 -> v0.1.19
    Updating tracing-core v0.1.21 -> v0.1.22
    Removing unicode-segmentation v1.8.0
      Adding valuable v0.1.0
    Updating version-compare v0.0.11 -> v0.1.0
    Updating wasm-bindgen-futures v0.4.28 -> v0.4.29
    Updating web-sys v0.3.55 -> v0.3.56
    Updating which v4.2.2 -> v4.2.4
      Adding windows v0.30.0
      Adding windows_aarch64_msvc v0.30.0
      Adding windows_i686_gnu v0.30.0
      Adding windows_i686_msvc v0.30.0
      Adding windows_x86_64_gnu v0.30.0
      Adding windows_x86_64_msvc v0.30.0
    Updating zbus v2.1.0 -> v2.1.1
    Updating zbus_macros v2.1.0 -> v2.1.1
2022-02-04 13:17:58 +01:00
Emil Ernerfeldt fd267c542e Add a link to smithay-egui 2022-02-04 10:55:14 +01:00
Emil Ernerfeldt c3be566574 egui-winit: Automatically detect and apply dark or light mode (#1045) 2022-02-02 17:09:36 +01:00
Emil Ernerfeldt c6ac1827f6 Use tracing crate for logging (#1192)
* egui_web: use tracing crate
* egui_glow: use tracing crate
* Log at the debug level
* egui_demo_app: enable tracing to log to stdout
* Use tracing in egui-winit
* Add opt-in tracing support to egui
2022-02-01 12:27:39 +01:00
Emil Ernerfeldt b5aaa5fa6f Improve some feature flags 2022-01-31 19:24:56 +01:00
Emil Ernerfeldt 2183e9fdea Add early egui history to changelog 2022-01-31 19:17:26 +01:00
Emil Ernerfeldt 7eddd20a01 index.html: catch and display errors 2022-01-31 19:16:50 +01:00
Emil Ernerfeldt 871a200ecf egui_web glow painter: return errors instead of panic 2022-01-31 19:15:48 +01:00
Emil Ernerfeldt ef81a52951 egui_web: log panics using console.error 2022-01-31 19:14:50 +01:00
Emil Ernerfeldt 532990d3dd emilk.github.io -> www.egui.rs 2022-01-30 22:01:33 +01:00
Emil Ernerfeldt b4be94df35 Create CNAME 2022-01-30 21:26:26 +01:00
Emil Ernerfeldt 25c03e49eb Delete CNAME 2022-01-30 19:50:53 +01:00
Emil Ernerfeldt 7ccc7caffd Create CNAME 2022-01-30 19:50:23 +01:00
Emil Ernerfeldt ea04ce9d58 Delete CNAME 2022-01-30 19:46:38 +01:00
Emil Ernerfeldt f6b1feddcd Create CNAME 2022-01-30 19:40:34 +01:00
Emil Ernerfeldt 4db6984e74 Delete CNAME 2022-01-30 16:21:38 +01:00
Emil Ernerfeldt 785c6f4c85 Create CNAME 2022-01-30 16:20:19 +01:00
Emil Ernerfeldt b618636425 Add ui.data(), ctx.data(), ctx.options() and ctx.tessellation_options() (#1175)
Helpful access deeper into Memory
2022-01-29 17:53:41 +01:00
Emil Ernerfeldt 3333d63b91 Return more info from ScrollArea::show (#1166) 2022-01-26 22:19:32 +01:00
Emil Ernerfeldt 1134258441 Documentation improvements 2022-01-26 22:09:19 +01:00
Emil Ernerfeldt 26be0ace1d Tidy up README.md 2022-01-26 17:25:59 +01:00
Emil Ernerfeldt 04c3efd01a Minor optimization: avoid reallocating set of visible ID:s 2022-01-26 14:44:10 +01:00
Emil Ernerfeldt 417bb3123a Fonts: only pre-render glyphs for fonts in the current egui styles 2022-01-26 14:42:44 +01:00
Emil Ernerfeldt 1e4d8ae943 Remove warm-up of demo app
Since https://github.com/emilk/egui/pull/1149 we only update the
region of the font atlas that has changes, so loading new glyphs is much
cheaper. This means warm-up is much less needed.

There is now a small delay when opening the font book,
but not when opening anything else.
2022-01-25 01:08:10 +01:00
Emil Ernerfeldt 7ed0880b8f Lower default font atlas size (#1160)
In https://github.com/emilk/egui/pull/1154 the default was set to
16k x 512, which is way excessive, as most of it will be blank.

This PR changes it to 8k x 64, which will make egui
use less RAM and VRAM, and load quicker again.

This also decreases the max size from 16k² to 8k².
That should be enough.
2022-01-25 01:04:28 +01:00
Emil Ernerfeldt fa43d16c41 Choose your own font and size (#1154)
* Refactor text layout: don't need &Fonts in all functions
* Replace indexing in Fonts with member function
* Wrap Fonts in a Mutex
* Remove mutex for Font::glyph_info_cache
* Remove RwLock around Font::characters
* Put FontsImpl and GalleyCache behind the same Mutex
* Round font sizes to whole pixels before deduplicating them
* Make TextStyle !Copy
* Implement user-named TextStyle:s
* round font size earlier
* Cache fonts based on family and size
* Move TextStyle into egui and Style
* Remove body_text_style
* Query graphics about max texture size and use that as font atlas size
* Recreate texture atlas when it is getting full
2022-01-24 14:32:36 +01:00
Emil Ernerfeldt bb407e9b00 Plot text can now contain rich text 2022-01-23 12:01:34 +01:00
Emil Ernerfeldt 462f181db3 Partial font texture update (#1149) 2022-01-22 11:23:12 +01:00
Emil Ernerfeldt e957674467 glow on web: simplify the webgl2 vs webgl1 selection 2022-01-22 09:07:41 +01:00
Emil Ernerfeldt 199bbef77b Add misc documentation 2022-01-22 09:07:41 +01:00
Emil Ernerfeldt 8138a073e7 glow: reuse the same GL texture when possible (#1142) 2022-01-21 19:51:52 +01:00
Emil Ernerfeldt a689b623a6 Make shift-scroll do horizontal scrolling on all platforms (#1136)
Closes https://github.com/emilk/egui/issues/1135
2022-01-21 10:48:44 +01:00
Emil Ernerfeldt 76ac41f9b5 WidgetGallery: hide spinner widget to save CPU in reactive mode 2022-01-17 19:57:32 +01:00
Emil Ernerfeldt 9df0c68a38 Small improvements to check.sh 2022-01-17 19:57:32 +01:00
Emil Ernerfeldt 39dd6d7644 clippy fixes 2022-01-17 19:57:32 +01:00
Emil Ernerfeldt c713fd98dd Fix horizontal scrolling direction on Linux
Closes https://github.com/emilk/egui/issues/356

Work-around until https://github.com/rust-windowing/winit/pull/2105 is merged and released
2022-01-16 09:49:22 +01:00
Emil Ernerfeldt ad5418777d Fix dead-lock in TextEdit on touch-screens (#1118)
Introduced in https://github.com/emilk/egui/pull/1035

Fixes https://github.com/emilk/egui/issues/1116
2022-01-15 22:40:53 +01:00
Emil Ernerfeldt b2c8cd0867 Simplify http demo and add new download_image eframe demo 2022-01-15 20:34:03 +01:00
Emil Ernerfeldt 66d80e2519 Texture loading in egui (#1110)
* Move texture allocation into epaint/egui proper
* Add TextureHandle
* egui_glow: cast using bytemuck instead of unsafe code
* Optimize glium painter
* Optimize WebGL
* Add example of loading an image from file
2022-01-15 13:59:52 +01:00
Emil Ernerfeldt 205e04aa18 Fix bugs in glow on web (#1092)
* Re-add check of WEBGL_debug_renderer_info to avoid OpenGL error

I removed this check in https://github.com/emilk/egui/pull/1020
because it produced a warning on Firefox. Better a warning
than an OpenGL error though.

* Bug fix: don't ask for webgl context and then later for webgl2 context

The browser will only allow the first thing we check, so this will
prevent webgl2 from working.
2022-01-10 23:19:30 +01:00
Emil ErnerfeldtandDaniel Keller d5673412dd Put everything in Context behind the same Mutex (#1050)
* Move all interior mutability from Context to CtxRef and make it a handle
* Rename `CtxRef` to `Context`
* The old `Context` is now `ContextImpl` and is non-pub
* Add benchmark Painter::rect

Co-authored-by: Daniel Keller <dklr433@gmail.com>
2022-01-10 23:13:10 +01:00
Emil Ernerfeldt 650057dd4a Improve OpenGL error detection and reporting in egui_glow
May help to diagnose https://github.com/emilk/egui/issues/1087
2022-01-09 23:04:00 +01:00
Emil Ernerfeldt 342737e2f0 Improve a couple of docstrings 2022-01-08 11:15:15 +01:00
Emil Ernerfeldt 1f93c7b0b6 Implement Clone & PartialEq on RichText WidgetTextJob WidgetTextGalley 2022-01-07 15:22:21 +01:00
Emil Ernerfeldt 7863f44111 Add demo of advanced TextEdit usage 2022-01-06 11:53:23 +01:00
Emil Ernerfeldt 79cfdaa1f9 Better docs and spelling fixes 2022-01-03 23:58:06 +01:00
Emil Ernerfeldt b1fd6a44e8 Switch to using glow as the default renderer both on native and the web (#1020)
* Switch to using glow as the default renderer both on native and the web
* Simplify code to find WebGL context for glow
* egui_web: make webgl an opt-in feature
* Stop using deprecated WEBGL_debug_renderer_info
2021-12-31 15:17:55 +01:00
Emil Ernerfeldt b5c119ef19 0.16.1 patch release: Add back CtxRef::begin_frame/end_frame (#1019)
`begin_frame`, `end_frame` is more convenient when using egui in a game engine. In particular, 0.16.0 was incompatible with https://github.com/mvlabat/bevy_egui>.
2021-12-31 11:45:57 +01:00
Emil Ernerfeldt b00edfe97f Remove keyboard focus from a widget if something else is dragged
Closes https://github.com/emilk/egui/issues/618
2021-12-30 23:24:29 +01:00
Emil Ernerfeldt 753d709d3d Hide console on windows for all examples in release builds (#1008) 2021-12-30 22:43:53 +01:00
Emil Ernerfeldt 4ef21380a2 Add Ui::add_visible and Ui::add_visible_ui
Also rename `Ui::visible` to `Ui::is_visible`.
2021-12-30 22:39:41 +01:00
Emil Ernerfeldt db110b1690 Remove deprecated functions 2021-12-30 22:37:58 +01:00
Emil Ernerfeldt 0960f38552 Add inter-linking between different forms of documentations and examples 2021-12-29 21:44:48 +01:00
Emil Ernerfeldt f779e8a346 Add an eframe example of how to install a custom font 2021-12-29 21:43:37 +01:00
Emil Ernerfeldt 0146c7e7fc Release 0.16.0 - Context menus and rich text 2021-12-29 12:07:05 +01:00
Emil Ernerfeldt 77869c21ea Publish new web demo 2021-12-29 12:06:25 +01:00
Emil Ernerfeldt 037ca5f9cd update tts 0.17 -> 0.19 2021-12-29 10:56:16 +01:00
Emil Ernerfeldt ffd28252ab cargo update 2021-12-29 10:49:40 +01:00
Emil Ernerfeldt 84399cde83 Small tweaks to documentation and demo 2021-12-29 10:49:22 +01:00
Emil Ernerfeldt d0a47bf8e8 setup_web.sh: don't force-install wasm-bindgen-cli 2021-12-28 21:30:36 +01:00
Emil Ernerfeldt 190c85a40f Rename Texture to FontImage 2021-12-28 21:19:24 +01:00
Emil Ernerfeldt d775eb3733 Fix wrong label on the feature request PR template 2021-12-28 17:34:27 +01:00
Emil Ernerfeldt 68fca09df9 Improve documentation 2021-12-28 17:34:27 +01:00
Emil Ernerfeldt 00f965de87 Add Context::animate_bool_with_time
Closes https://github.com/emilk/egui/discussions/984
2021-12-28 17:34:27 +01:00