Skip to content

Commit

Permalink
#698 Add egui experiment
Browse files Browse the repository at this point in the history
  • Loading branch information
helgoboss committed Sep 30, 2022
1 parent d1985bf commit 842ad6b
Show file tree
Hide file tree
Showing 19 changed files with 1,949 additions and 84 deletions.
1,109 changes: 1,066 additions & 43 deletions Cargo.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Cargo.toml
Expand Up @@ -2,6 +2,7 @@
members = [
"api",
"dialogs",
"egui",
"playtime-clip-engine",
"playtime-api",
"csi",
Expand Down
4 changes: 2 additions & 2 deletions dialogs/src/base.rs
Expand Up @@ -463,17 +463,17 @@ impl Display for Dialog {
if let Some(font) = self.font.as_ref() {
writeln!(f, "FONT {}", font)?;
}
f.write_str("BEGIN\n")?;
if !self.controls.is_empty() {
f.write_str("BEGIN\n")?;
for control in &self.controls {
#[cfg(target_os = "macos")]
if control.conditions.contains(&Condition::SkipOnMacOs) {
continue;
}
writeln!(f, " {}", control)?;
}
f.write_str("END")?;
}
f.write_str("END")?;
Ok(())
}
}
Expand Down
22 changes: 22 additions & 0 deletions dialogs/src/empty_panel.rs
@@ -0,0 +1,22 @@
use crate::base::*;

pub fn create(context: ScopedContext, ids: &mut IdGenerator) -> Dialog {
use Style::*;
Dialog {
id: ids.named_id("ID_EMPTY_PANEL"),
caption: "Editor",
rect: context.rect(0, 0, 490, 310),
styles: Styles(vec![
DS_SETFONT,
DS_MODALFRAME,
DS_3DLOOK,
DS_FIXEDSYS,
DS_CENTER,
WS_POPUP,
WS_VISIBLE,
WS_CAPTION,
WS_SYSMENU,
]),
..context.default_dialog()
}
}
9 changes: 6 additions & 3 deletions dialogs/src/lib.rs
Expand Up @@ -7,6 +7,7 @@ use std::path::Path;

mod base;
pub mod constants;
mod empty_panel;
mod ext;
mod group_panel;
mod header_panel;
Expand All @@ -16,7 +17,7 @@ mod mapping_row_panel;
mod mapping_rows_panel;
mod message_panel;
mod shared_group_mapping_panel;
mod yaml_editor_panel;
mod simple_editor_panel;

pub fn generate_dialog_files(rc_dir: impl AsRef<Path>, bindings_file: impl AsRef<Path>) {
let default_font = Font {
Expand Down Expand Up @@ -140,7 +141,8 @@ pub fn generate_dialog_files(rc_dir: impl AsRef<Path>, bindings_file: impl AsRef
mapping_rows_panel_dialog.rect.height,
)
};
let yaml_editor_panel_dialog = yaml_editor_panel::create(context.global(), &mut ids);
let simple_editor_panel_dialog = simple_editor_panel::create(context.global(), &mut ids);
let empty_panel_dialog = empty_panel::create(context.global(), &mut ids);
let resource = Resource {
dialogs: vec![
group_panel_dialog,
Expand All @@ -151,7 +153,8 @@ pub fn generate_dialog_files(rc_dir: impl AsRef<Path>, bindings_file: impl AsRef
message_panel_dialog,
shared_group_mapping_panel_dialog,
maine_panel_dialog,
yaml_editor_panel_dialog,
simple_editor_panel_dialog,
empty_panel_dialog,
],
};
let header_info = resource.generate_info(&context);
Expand Down
File renamed without changes.
13 changes: 13 additions & 0 deletions egui/Cargo.toml
@@ -0,0 +1,13 @@
[package]
name = "realearn-egui"
version = "0.1.0"
edition = "2021"
rust-version = "1.61"

[dependencies]
egui = "0.19.0"
egui_glow = "0.19.0"
baseview = { git = "https://github.com/RustAudio/baseview.git", features = ["opengl"] }
tracing = { version = "0.1", default-features = false, features = ["std"] }
keyboard-types = "0.6.2"
raw-window-handle = "0.4.3"

0 comments on commit 842ad6b

Please sign in to comment.