Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/aspectron/egui
Browse files Browse the repository at this point in the history
  • Loading branch information
surinder83singh committed Aug 23, 2024
2 parents 00c6541 + 9a1e358 commit 4621cb2
Show file tree
Hide file tree
Showing 416 changed files with 38,918 additions and 25,741 deletions.
3 changes: 3 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
# we don't use `[build]` because of rust analyzer's build cache invalidation https://github.com/emilk/eframe_template/issues/93
[target.wasm32-unknown-unknown]
rustflags = ["--cfg=web_sys_unstable_apis"]

[alias]
xtask = "run --quiet --package xtask --"
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* text=auto eol=lf
Cargo.lock linguist-generated=false
10 changes: 6 additions & 4 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@
Please read the "Making a PR" section of [`CONTRIBUTING.md`](https://github.com/emilk/egui/blob/master/CONTRIBUTING.md) before opening a Pull Request!
* Keep your PR:s small and focused.
* The PR title is what ends up in the changelog, so make it descriptive!
* If applicable, add a screenshot or gif.
* If it is a non-trivial addition, consider adding a demo for it to `egui_demo_lib`, or a new example.
* Do NOT open PR:s from your `master` branch, as that makes it hard for maintainers to add commits to your PR.
* Remember to run `cargo fmt` and `cargo cranky`.
* Do NOT open PR:s from your `master` branch, as that makes it hard for maintainers to test and add commits to your PR.
* Remember to run `cargo fmt` and `cargo clippy`.
* Open the PR as a draft until you have self-reviewed it and run `./scripts/check.sh`.
* When you have addressed a PR comment, mark it as resolved.
Please be patient! I will review you PR, but my time is limited!
Please be patient! I will review your PR, but my time is limited!
-->

Closes <https://github.com/emilk/egui/issues/THE_RELEVANT_ISSUE>.
* Closes <https://github.com/emilk/egui/issues/THE_RELEVANT_ISSUE>
* [ ] I have followed the instructions in the PR template
66 changes: 66 additions & 0 deletions .github/workflows/deploy_web_demo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Deploy web demo

on:
# We only run this on merges to master
push:
branches: ["master"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# to only run when you do a new github release, comment out above part and uncomment the below trigger.
# on:
# release:
# types: ["published"]


permissions:
contents: write # for committing to gh-pages branch

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

env:
# web_sys_unstable_apis is required to enable the web_sys clipboard API which eframe web uses,
# as well as by the wasm32-backend of the wgpu crate.
# https://rustwasm.github.io/wasm-bindgen/api/web_sys/struct.Clipboard.html
# https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html
RUSTFLAGS: --cfg=web_sys_unstable_apis -D warnings
RUSTDOCFLAGS: -D warnings

jobs:
# Single deploy job since we're just deploying
deploy:
name: Deploy web demo

runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- uses: actions-rs/toolchain@v1
with:
profile: minimal
target: wasm32-unknown-unknown
toolchain: 1.76.0
override: true

- uses: Swatinem/rust-cache@v2
with:
prefix-key: "web-demo-"

- name: "Install wasmopt / binaryen"
run: |
sudo apt-get update && sudo apt-get install binaryen
- run: |
scripts/build_demo_web.sh --release
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: web_demo
# this option will not maintain any history of your previous pages deployment
# set to false if you want all page build to be committed to your gh-pages branch history
single-commit: true
2 changes: 1 addition & 1 deletion .github/workflows/labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ jobs:
with:
mode: minimum
count: 1
labels: "CI, dependencies, docs and examples, ecolor, eframe, egui_extras, egui_glow, egui_plot, egui-wgpu, egui-winit, egui, epaint, typo"
labels: "CI, dependencies, docs and examples, ecolor, eframe, egui_extras, egui_glow, egui-wgpu, egui-winit, egui, epaint, epaint_default_fonts, exclude from changelog, typo"
38 changes: 17 additions & 21 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

- uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.70.0
toolchain: 1.76.0

- name: Install packages (Linux)
if: runner.os == 'Linux'
Expand All @@ -40,11 +40,6 @@ jobs:
- name: Lint vertical spacing
run: ./scripts/lint.py

- name: Install cargo-cranky
uses: baptiste0928/cargo-install@v1
with:
crate: cargo-cranky

- name: check --all-features
run: cargo check --locked --all-features --all-targets

Expand Down Expand Up @@ -78,8 +73,11 @@ jobs:
- name: Test
run: cargo test --all-features

- name: Cranky
run: cargo cranky --all-targets --all-features -- -D warnings
- name: clippy
run: cargo clippy --all-targets --all-features -- -D warnings

- name: clippy release
run: cargo clippy --all-targets --all-features --release -- -D warnings

# ---------------------------------------------------------------------------

Expand All @@ -90,19 +88,14 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.70.0
toolchain: 1.76.0
targets: wasm32-unknown-unknown

- run: sudo apt-get update && sudo apt-get install libgtk-3-dev
- run: sudo apt-get update && sudo apt-get install libgtk-3-dev libatk1.0-dev

- name: Set up cargo cache
uses: Swatinem/rust-cache@v2

- name: Install cargo-cranky
uses: baptiste0928/cargo-install@v1
with:
crate: cargo-cranky

- name: Check wasm32 egui_demo_app
run: cargo check -p egui_demo_app --lib --target wasm32-unknown-unknown

Expand All @@ -115,11 +108,11 @@ jobs:
- name: wasm-bindgen
uses: jetli/[email protected]
with:
version: "0.2.87"
version: "0.2.92"

- run: ./scripts/wasm_bindgen_check.sh --skip-setup

- name: Cranky wasm32
- name: clippy wasm32
run: ./scripts/clippy_wasm.sh

# ---------------------------------------------------------------------------
Expand Down Expand Up @@ -148,7 +141,7 @@ jobs:
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v1
with:
rust-version: "1.70.0"
rust-version: "1.76.0"
log-level: error
command: check
arguments: --target ${{ matrix.target }}
Expand All @@ -163,7 +156,7 @@ jobs:

- uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.70.0
toolchain: 1.76.0
targets: aarch64-linux-android

- name: Set up cargo cache
Expand All @@ -181,10 +174,13 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.70.0
toolchain: 1.76.0

- name: Set up cargo cache
uses: Swatinem/rust-cache@v2

- name: Check
- name: Check all
run: cargo check --all-targets --all-features

- name: Check hello_world
run: cargo check -p hello_world
38 changes: 38 additions & 0 deletions .github/workflows/spelling_and_links.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Check spelling and links
on: [pull_request]

jobs:
typos:
# https://github.com/crate-ci/typos
# Add exceptions to _typos.toml
# install and run locally: cargo install typos-cli && typos
name: typos
runs-on: ubuntu-latest
steps:
- name: Checkout Actions Repository
uses: actions/checkout@v4

- name: Check spelling of entire workspace
uses: crate-ci/typos@master
# Disabled: too many names of crates and user-names etc
# spellcheck:
# name: Spellcheck
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: streetsidesoftware/cspell-action@v2
# with:
# files: "**/*.md"
linkinator:
name: linkinator
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: jprochazk/linkinator-action@main
with:
linksToSkip: "https://crates.io/crates/.*, http://localhost:.*" # Avoid crates.io rate-limiting
retry: true
retryErrors: true
retryErrorsCount: 5
retryErrorsJitter: 2000

17 changes: 0 additions & 17 deletions .github/workflows/typos.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
/.*.json
/.vscode
/media/*
.idea/
7 changes: 4 additions & 3 deletions .typos.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
# run: typos

[default.extend-words]
nknown = "nknown" # part of @55nknown username
Prefence = "Prefence" # typo in glutin_winit API
ime = "ime" # Input Method Editor
nknown = "nknown" # part of @55nknown username
ro = "ro" # read-only, also part of the username @Phen-Ro

[files]
extend-exclude = ["docs/egui_demo_app.js"] # auto-generated
extend-exclude = ["web_demo/egui_demo_app.js"] # auto-generated
7 changes: 5 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,22 @@
// Tell Rust Analyzer to use its own target directory, so we don't need to wait for it to finish wen we want to `cargo run`
"rust-analyzer.check.overrideCommand": [
"cargo",
"cranky",
"clippy",
"--target-dir=target_ra",
"--workspace",
"--message-format=json",
"--all-targets",
"--all-features",
],
"rust-analyzer.cargo.buildScripts.overrideCommand": [
"cargo",
"check",
"clippy",
"--quiet",
"--target-dir=target_ra",
"--workspace",
"--message-format=json",
"--all-targets",
"--all-features",
],
"rust-analyzer.showUnlinkedFileNotification": false,
}
15 changes: 7 additions & 8 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Also see [`CONTRIBUTING.md`](CONTRIBUTING.md) for what to do before opening a PR


## Crate overview
The crates in this repository are: `egui, emath, epaint, egui_extras, egui_plot, egui-winit, egui_glium, egui_glow, egui_demo_lib, egui_demo_app`.
The crates in this repository are: `egui, emath, epaint, epaint_default_fonts, egui_extras, egui-winit, egui_glow, egui_demo_lib, egui_demo_app`.

### `egui`: The main GUI library.
Example code: `if ui.button("Click me").clicked() { … }`
Expand All @@ -19,22 +19,21 @@ Examples: `Vec2, Pos2, Rect, lerp, remap`

Example: `Shape::Circle { center, radius, fill, stroke }`

Depends on `emath`.
Depends on `emath`. Also depends on `epaint_default_fonts` when the `default_fonts` feature is enabled.

### `epaint_default_fonts`
Embedded fonts (using `include_bytes!()`) for use by `epaint` in selecting defaults.

Since the font files themselves are licensed differently from the `epaint` source code, this simplifies licenses for callers who disable the default fonts.

### `egui_extras`
This adds additional features on top of `egui`.

### `egui_plot`
Plotting for `egui`.

### `egui-winit`
This crates provides bindings between [`egui`](https://github.com/emilk/egui) and [winit](https://crates.io/crates/winit).

The library translates winit events to egui, handled copy/paste, updates the cursor, open links clicked in egui, etc.

### `egui_glium`
Puts an egui app inside a native window on your laptop. Paints the triangles that egui outputs using [glium](https://github.com/glium/glium).

### `egui_glow`
Puts an egui app inside a native window on your laptop. Paints the triangles that egui outputs using [glow](https://github.com/grovesNL/glow).

Expand Down
Loading

0 comments on commit 4621cb2

Please sign in to comment.