Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasmerlin committed Dec 29, 2024
1 parent 77ce48b commit 0f54561
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions crates/eframe/src/epi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ impl Frame {
wgpu_render_state: None,
}
}

/// True if you are in a web environment.
///
/// Equivalent to `cfg!(target_arch = "wasm32")`
Expand Down Expand Up @@ -847,11 +847,11 @@ impl IntegrationInfo {
host: "localhost".to_owned(),
hostname: "localhost".to_owned(),
port: "80".to_owned(),
hash: "".to_owned(),
query: "".to_owned(),
hash: String::new(),
query: String::new(),
query_map: Default::default(),
origin: "http://localhost".to_owned(),
}
},
},
cpu_usage: None,
}
Expand Down
3 changes: 2 additions & 1 deletion crates/egui_demo_app/src/apps/image_viewer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ impl eframe::App for ImageViewer {
egui::TopBottomPanel::new(TopBottomSide::Top, "url bar").show(ctx, |ui| {
ui.horizontal_centered(|ui| {
let label = ui.label("URI:");
ui.text_edit_singleline(&mut self.uri_edit_text).labelled_by(label.id);
ui.text_edit_singleline(&mut self.uri_edit_text)
.labelled_by(label.id);
if ui.small_button("✔").clicked() {
ctx.forget_image(&self.current_uri);
self.uri_edit_text = self.uri_edit_text.trim().to_owned();
Expand Down
2 changes: 1 addition & 1 deletion crates/egui_demo_app/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ mod backend_panel;
mod frame_history;
mod wrap_app;

pub use wrap_app::{WrapApp, Anchor};
pub use wrap_app::{Anchor, WrapApp};

/// Time of day as seconds since midnight. Used for clock in demo app.
pub(crate) fn seconds_since_midnight() -> f64 {
Expand Down
5 changes: 2 additions & 3 deletions crates/egui_demo_app/tests/test_demo_app.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use egui::accesskit::Role;
use egui::{Key, Modifiers};
use egui_demo_app::{Anchor, WrapApp};
use egui_kittest::kittest::Queryable;

Expand Down Expand Up @@ -52,7 +51,7 @@ fn test_demo_app() {
harness
.get_by_role_and_label(Role::TextInput, "URI:")
.focus();
harness.press_key_modifiers(Modifiers::COMMAND, Key::A);
harness.press_key_modifiers(egui::Modifiers::COMMAND, egui::Key::A);

harness
.get_by_role_and_label(Role::TextInput, "URI:")
Expand All @@ -73,7 +72,7 @@ fn test_demo_app() {
});
}

for error in results {
if let Some(error) = results.first() {
panic!("{error}");
}
}
2 changes: 1 addition & 1 deletion crates/egui_kittest/src/app_kind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ type AppKindContext<'a> = Box<dyn FnMut(&egui::Context) + 'a>;
type AppKindUi<'a> = Box<dyn FnMut(&mut egui::Ui) + 'a>;

/// In order to access the [eframe::App] trait from the generic [State], we store a function pointer
/// here that will return the dyn trait from the struct. In the builder we have the correct where
/// here that will return the dyn trait from the struct. In the builder we have the correct where
/// clause to be able to create this.
/// Later we can use it anywhere to get the [eframe::App] from the [State].
#[cfg(feature = "eframe")]
Expand Down
2 changes: 1 addition & 1 deletion crates/egui_kittest/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ impl<State> HarnessBuilder<State> {
) -> Harness<'a, State> {
Harness::from_builder(&self, AppKind::UiState(Box::new(app)), state, None)
}

/// Create a new [Harness] from the given eframe creation closure.
/// The app can be accessed via the [Harness::state] / [Harness::state_mut] methods.
#[cfg(feature = "eframe")]
Expand Down
2 changes: 1 addition & 1 deletion crates/egui_kittest/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ impl<'a, State> Harness<'a, State> {
physical_key: None,
});
}

/// Press a key with modifiers.
/// This will create a key down event and a key up event.
pub fn press_key_modifiers(&mut self, modifiers: Modifiers, key: egui::Key) {
Expand Down

0 comments on commit 0f54561

Please sign in to comment.