Merge branch 'worktree-agent-a549a3d1a8812e372'
# Conflicts: # apps/effectcraft-cli/src/main.rs # crates/host/src/lib.rs # crates/render/src/lib.rs
This commit is contained in:
@@ -6,7 +6,7 @@ use serde_json::json;
|
||||
|
||||
use crate::icons::{self, Icon};
|
||||
use crate::theme::Tokens;
|
||||
use crate::{Dialog, EffectcraftApp, widgets};
|
||||
use crate::{Dialog, EffectcraftApp};
|
||||
|
||||
pub use super::comp_settings::CompDraft;
|
||||
|
||||
@@ -19,6 +19,9 @@ pub struct DialogState {
|
||||
pub solid_size: [u32; 2],
|
||||
pub palette_query: String,
|
||||
pub palette_sel: usize,
|
||||
pub velocity: super::key_dialogs::VelocityDraft,
|
||||
pub interp: super::key_dialogs::InterpDraft,
|
||||
pub stretch: super::key_dialogs::StretchDraft,
|
||||
}
|
||||
|
||||
pub fn open_new_comp(app: &mut EffectcraftApp) {
|
||||
@@ -63,7 +66,7 @@ pub fn open_new_solid(app: &mut EffectcraftApp) -> Result<(), String> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn modal(ctx: &egui::Context, title: &str, size: egui::Vec2, t: &Tokens, body: impl FnOnce(&mut egui::Ui)) {
|
||||
pub(crate) fn modal(ctx: &egui::Context, title: &str, size: egui::Vec2, t: &Tokens, body: impl FnOnce(&mut egui::Ui)) {
|
||||
// Dim the app.
|
||||
let screen = ctx.content_rect();
|
||||
ctx.layer_painter(egui::LayerId::new(egui::Order::Middle, egui::Id::new("modal-dim"))).rect_filled(screen, 0.0, Color32::from_black_alpha(120));
|
||||
@@ -86,6 +89,9 @@ pub fn show(app: &mut EffectcraftApp, ctx: &egui::Context) {
|
||||
Dialog::NewComp | Dialog::CompSettings => comp_settings(app, ctx, &t, d == Dialog::CompSettings),
|
||||
Dialog::SolidSettings => solid(app, ctx, &t),
|
||||
Dialog::CommandPalette => palette(app, ctx, &t),
|
||||
Dialog::KeyVelocity => super::key_dialogs::velocity(app, ctx, &t),
|
||||
Dialog::KeyInterpolation => super::key_dialogs::interpolation(app, ctx, &t),
|
||||
Dialog::TimeStretch => super::key_dialogs::time_stretch(app, ctx, &t),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -185,7 +191,7 @@ fn comp_settings(app: &mut EffectcraftApp, ctx: &egui::Context, t: &Tokens, exis
|
||||
}
|
||||
}
|
||||
|
||||
fn ui_enter(ctx: &egui::Context) -> bool {
|
||||
pub(crate) fn ui_enter(ctx: &egui::Context) -> bool {
|
||||
!ctx.egui_wants_keyboard_input() && ctx.input(|i| i.key_pressed(egui::Key::Enter))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user