Compare commits
6 commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
7215fdfb7c | ||
![]() |
e2778d9d6a | ||
![]() |
38849fe381 | ||
![]() |
df7e5bd57a | ||
![]() |
e3e781ced8 | ||
![]() |
97756bc246 |
14 changed files with 89 additions and 20 deletions
12
.github/workflows/rust.yml
vendored
12
.github/workflows/rust.yml
vendored
|
@ -47,24 +47,30 @@ jobs:
|
|||
with:
|
||||
crate: cargo-cranky
|
||||
|
||||
- name: Check all features
|
||||
- name: check --all-features
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: check
|
||||
args: --locked --all-features --all-targets
|
||||
|
||||
- name: Check default features
|
||||
- name: check default features
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: check
|
||||
args: --locked --all-targets
|
||||
|
||||
- name: Check no default features
|
||||
- name: check --no-default-features
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: check
|
||||
args: --locked --no-default-features --lib --all-targets
|
||||
|
||||
- name: check eframe --no-default-features
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: check
|
||||
args: --locked --no-default-features --lib --all-targets -p eframe
|
||||
|
||||
- name: Test doc-tests
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
|
|
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -1218,7 +1218,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "eframe"
|
||||
version = "0.21.1"
|
||||
version = "0.21.3"
|
||||
dependencies = [
|
||||
"bytemuck",
|
||||
"dark-light",
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
# ecolor - egui color library
|
||||
|
||||
[](https://crates.io/crates/ecolor)
|
||||
[](https://docs.rs/ecolor)
|
||||
[](https://github.com/rust-secure-code/safety-dance/)
|
||||

|
||||

|
||||
|
||||
A simple color storage and conversion library.
|
||||
|
||||
Made for [`egui`](https://github.com/emilk/egui/).
|
||||
|
|
|
@ -7,6 +7,14 @@ NOTE: [`egui-winit`](../egui-winit/CHANGELOG.md), [`egui_glium`](../egui_glium/C
|
|||
## Unreleased
|
||||
|
||||
|
||||
## 0.21.3 - 2023-02-15
|
||||
* Fix typing the letter 'P' on web ([#2740](https://github.com/emilk/egui/pull/2740)).
|
||||
|
||||
|
||||
## 0.21.2 - 2023-02-12
|
||||
* Allow compiling `eframe` with `--no-default-features` ([#2728](https://github.com/emilk/egui/pull/2728)).
|
||||
|
||||
|
||||
## 0.21.1 - 2023-02-12
|
||||
* Fixed crash when native window position is in an invalid state, which could happen e.g. due to changes in monitor size or DPI ([#2722](https://github.com/emilk/egui/issues/2722)).
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "eframe"
|
||||
version = "0.21.1"
|
||||
version = "0.21.3"
|
||||
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
|
||||
description = "egui framework - write GUI apps that compiles to web and/or natively"
|
||||
edition = "2021"
|
||||
|
|
|
@ -10,9 +10,11 @@
|
|||
use std::any::Any;
|
||||
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
#[cfg(any(feature = "glow", feature = "wgpu"))]
|
||||
pub use crate::native::run::UserEvent;
|
||||
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
#[cfg(any(feature = "glow", feature = "wgpu"))]
|
||||
pub use winit::event_loop::EventLoopBuilder;
|
||||
|
||||
/// Hook into the building of an event loop before it is run
|
||||
|
@ -20,6 +22,7 @@ pub use winit::event_loop::EventLoopBuilder;
|
|||
/// You can configure any platform specific details required on top of the default configuration
|
||||
/// done by `EFrame`.
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
#[cfg(any(feature = "glow", feature = "wgpu"))]
|
||||
pub type EventLoopBuilderHook = Box<dyn FnOnce(&mut EventLoopBuilder<UserEvent>)>;
|
||||
|
||||
/// This is how your app is created.
|
||||
|
@ -317,6 +320,7 @@ pub struct NativeOptions {
|
|||
pub hardware_acceleration: HardwareAcceleration,
|
||||
|
||||
/// What rendering backend to use.
|
||||
#[cfg(any(feature = "glow", feature = "wgpu"))]
|
||||
pub renderer: Renderer,
|
||||
|
||||
/// Only used if the `dark-light` feature is enabled:
|
||||
|
@ -355,6 +359,7 @@ pub struct NativeOptions {
|
|||
/// event loop before it is run.
|
||||
///
|
||||
/// Note: A [`NativeOptions`] clone will not include any `event_loop_builder` hook.
|
||||
#[cfg(any(feature = "glow", feature = "wgpu"))]
|
||||
pub event_loop_builder: Option<EventLoopBuilderHook>,
|
||||
|
||||
#[cfg(feature = "glow")]
|
||||
|
@ -381,9 +386,13 @@ impl Clone for NativeOptions {
|
|||
fn clone(&self) -> Self {
|
||||
Self {
|
||||
icon_data: self.icon_data.clone(),
|
||||
|
||||
#[cfg(any(feature = "glow", feature = "wgpu"))]
|
||||
event_loop_builder: None, // Skip any builder callbacks if cloning
|
||||
|
||||
#[cfg(feature = "wgpu")]
|
||||
wgpu_options: self.wgpu_options.clone(),
|
||||
|
||||
..*self
|
||||
}
|
||||
}
|
||||
|
@ -397,8 +406,10 @@ impl Default for NativeOptions {
|
|||
maximized: false,
|
||||
decorated: true,
|
||||
fullscreen: false,
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
fullsize_content: false,
|
||||
|
||||
drag_and_drop_support: true,
|
||||
icon_data: None,
|
||||
initial_window_pos: None,
|
||||
|
@ -413,14 +424,22 @@ impl Default for NativeOptions {
|
|||
depth_buffer: 0,
|
||||
stencil_buffer: 0,
|
||||
hardware_acceleration: HardwareAcceleration::Preferred,
|
||||
|
||||
#[cfg(any(feature = "glow", feature = "wgpu"))]
|
||||
renderer: Renderer::default(),
|
||||
|
||||
follow_system_theme: cfg!(target_os = "macos") || cfg!(target_os = "windows"),
|
||||
default_theme: Theme::Dark,
|
||||
run_and_return: true,
|
||||
|
||||
#[cfg(any(feature = "glow", feature = "wgpu"))]
|
||||
event_loop_builder: None,
|
||||
|
||||
#[cfg(feature = "glow")]
|
||||
shader_version: None,
|
||||
|
||||
centered: false,
|
||||
|
||||
#[cfg(feature = "wgpu")]
|
||||
wgpu_options: egui_wgpu::WgpuConfiguration::default(),
|
||||
}
|
||||
|
@ -559,6 +578,7 @@ pub enum WebGlContextOption {
|
|||
/// What rendering backend to use.
|
||||
///
|
||||
/// You need to enable the "glow" and "wgpu" features to have a choice.
|
||||
#[cfg(any(feature = "glow", feature = "wgpu"))]
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
|
||||
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
|
||||
|
@ -572,6 +592,7 @@ pub enum Renderer {
|
|||
Wgpu,
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "glow", feature = "wgpu"))]
|
||||
impl Default for Renderer {
|
||||
fn default() -> Self {
|
||||
#[cfg(feature = "glow")]
|
||||
|
@ -587,6 +608,7 @@ impl Default for Renderer {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "glow", feature = "wgpu"))]
|
||||
impl std::fmt::Display for Renderer {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
match self {
|
||||
|
@ -599,6 +621,7 @@ impl std::fmt::Display for Renderer {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "glow", feature = "wgpu"))]
|
||||
impl std::str::FromStr for Renderer {
|
||||
type Err = String;
|
||||
|
||||
|
@ -811,6 +834,7 @@ impl Frame {
|
|||
}
|
||||
|
||||
/// for integrations only: call once per frame
|
||||
#[cfg(any(feature = "glow", feature = "wgpu"))]
|
||||
pub(crate) fn take_app_output(&mut self) -> backend::AppOutput {
|
||||
std::mem::take(&mut self.output)
|
||||
}
|
||||
|
|
|
@ -137,6 +137,7 @@ pub async fn start_web(
|
|||
// When compiling natively
|
||||
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
#[cfg(any(feature = "glow", feature = "wgpu"))]
|
||||
mod native;
|
||||
|
||||
/// This is how you start a native (desktop) app.
|
||||
|
@ -179,6 +180,7 @@ mod native;
|
|||
/// This function can fail if we fail to set up a graphics context.
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
#[allow(clippy::needless_pass_by_value)]
|
||||
#[cfg(any(feature = "glow", feature = "wgpu"))]
|
||||
pub fn run_native(
|
||||
app_name: &str,
|
||||
native_options: NativeOptions,
|
||||
|
@ -233,24 +235,28 @@ pub type Result<T> = std::result::Result<T, Error>;
|
|||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// Profiling macro for feature "puffin"
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
macro_rules! profile_function {
|
||||
#[cfg(any(feature = "glow", feature = "wgpu"))]
|
||||
mod profiling_scopes {
|
||||
/// Profiling macro for feature "puffin"
|
||||
macro_rules! profile_function {
|
||||
($($arg: tt)*) => {
|
||||
#[cfg(feature = "puffin")]
|
||||
puffin::profile_function!($($arg)*);
|
||||
};
|
||||
}
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
pub(crate) use profile_function;
|
||||
pub(crate) use profile_function;
|
||||
|
||||
/// Profiling macro for feature "puffin"
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
macro_rules! profile_scope {
|
||||
/// Profiling macro for feature "puffin"
|
||||
macro_rules! profile_scope {
|
||||
($($arg: tt)*) => {
|
||||
#[cfg(feature = "puffin")]
|
||||
puffin::profile_scope!($($arg)*);
|
||||
};
|
||||
}
|
||||
pub(crate) use profile_scope;
|
||||
}
|
||||
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
pub(crate) use profile_scope;
|
||||
#[cfg(any(feature = "glow", feature = "wgpu"))]
|
||||
pub(crate) use profiling_scopes::*;
|
||||
|
|
|
@ -94,7 +94,12 @@ pub fn install_document_events(runner_container: &mut AppRunnerContainer) -> Res
|
|||
// egui wants to use tab to move to the next text field.
|
||||
true
|
||||
} else if egui_key == Some(Key::P) {
|
||||
true // Prevent ctrl-P opening the print dialog. Users may want to use it for a command palette.
|
||||
#[allow(clippy::needless_bool)]
|
||||
if modifiers.ctrl || modifiers.command || modifiers.mac_cmd {
|
||||
true // Prevent ctrl-P opening the print dialog. Users may want to use it for a command palette.
|
||||
} else {
|
||||
false // let normal P:s through
|
||||
}
|
||||
} else if egui_wants_keyboard {
|
||||
matches!(
|
||||
event.key().as_str(),
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
[](https://crates.io/crates/egui_extras)
|
||||
[](https://docs.rs/egui_extras)
|
||||
[](https://github.com/rust-secure-code/safety-dance/)
|
||||

|
||||

|
||||
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
# emath - egui math library
|
||||
|
||||
[](https://crates.io/crates/emath)
|
||||
[](https://docs.rs/emath)
|
||||
[](https://github.com/rust-secure-code/safety-dance/)
|
||||

|
||||

|
||||
|
||||
A bare-bones 2D math library with types and functions useful for GUI building.
|
||||
|
||||
Made for [`egui`](https://github.com/emilk/egui/).
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
# epaint - egui paint library
|
||||
|
||||
[](https://crates.io/crates/epaint)
|
||||
[](https://docs.rs/epaint)
|
||||
[](https://github.com/rust-secure-code/safety-dance/)
|
||||

|
||||

|
||||
|
||||
A bare-bones 2D graphics library for turning simple 2D shapes and text into textured triangles.
|
||||
|
||||
Made for [`egui`](https://github.com/emilk/egui/).
|
||||
|
|
|
@ -224,7 +224,7 @@ function makeMutClosure(arg0, arg1, dtor, f) {
|
|||
function __wbg_adapter_28(arg0, arg1) {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__he2ead792e86f6629(retptr, arg0, arg1);
|
||||
wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h19340d09680f5ee3(retptr, arg0, arg1);
|
||||
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
||||
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
||||
if (r1) {
|
||||
|
@ -236,7 +236,7 @@ function __wbg_adapter_28(arg0, arg1) {
|
|||
}
|
||||
|
||||
function __wbg_adapter_31(arg0, arg1, arg2) {
|
||||
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h37098c33fc6abd40(arg0, arg1, addHeapObject(arg2));
|
||||
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h9fbcfb319cb46254(arg0, arg1, addHeapObject(arg2));
|
||||
}
|
||||
|
||||
function makeClosure(arg0, arg1, dtor, f) {
|
||||
|
@ -393,10 +393,6 @@ async function load(module, imports) {
|
|||
function getImports() {
|
||||
const imports = {};
|
||||
imports.wbg = {};
|
||||
imports.wbg.__wbg_webhandle_new = function(arg0) {
|
||||
const ret = WebHandle.__wrap(arg0);
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
||||
takeObject(arg0);
|
||||
};
|
||||
|
@ -404,6 +400,10 @@ function getImports() {
|
|||
const ret = getStringFromWasm0(arg0, arg1);
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_webhandle_new = function(arg0) {
|
||||
const ret = WebHandle.__wrap(arg0);
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbindgen_cb_drop = function(arg0) {
|
||||
const obj = takeObject(arg0).original;
|
||||
if (obj.cnt-- == 1) {
|
||||
|
|
Binary file not shown.
|
@ -10,6 +10,7 @@ publish = false
|
|||
|
||||
[dependencies]
|
||||
eframe = { path = "../../crates/eframe", features = [
|
||||
"puffin",
|
||||
"__screenshot", # __screenshot is so we can dump a screenshot using EFRAME_SCREENSHOT_TO
|
||||
] }
|
||||
puffin = "0.14"
|
||||
|
|
Loading…
Reference in a new issue