1 Commits
Author SHA1 Message Date
jorge 79f21bf6f3 Started to try and rebrand this? 2026-10-14 18:13:12 -07:00
30 changed files with 517 additions and 153 deletions
Generated
+8
View File
@@ -1243,6 +1243,7 @@ dependencies = [
"effectcraft-psd",
"effectcraft-raster",
"effectcraft-render",
"effectcraft-rustmotion-common",
"effectcraft-segment",
"effectcraft-svg",
"effectcraft-text",
@@ -1273,6 +1274,7 @@ dependencies = [
"effectcraft-project",
"effectcraft-raster",
"effectcraft-render",
"effectcraft-rustmotion-common",
"effectcraft-time",
"effectcraft-vp9enc",
"filmcraft-aac",
@@ -1541,6 +1543,7 @@ dependencies = [
"effectcraft-path",
"effectcraft-project",
"effectcraft-raster",
"effectcraft-rustmotion-common",
"effectcraft-text",
"effectcraft-time",
"kurbo",
@@ -1551,6 +1554,10 @@ dependencies = [
"web-time",
]
[[package]]
name = "effectcraft-rustmotion-common"
version = "0.10.0"
[[package]]
name = "effectcraft-script"
version = "0.10.0"
@@ -1635,6 +1642,7 @@ dependencies = [
"effectcraft-path",
"effectcraft-project",
"effectcraft-render",
"effectcraft-rustmotion-common",
"effectcraft-text",
"effectcraft-time",
"eframe",
+1
View File
@@ -12,6 +12,7 @@ repository = "https://github.com/storytold/effectcraft"
[workspace.dependencies]
# internal
effectcraft-rustmotion-common = { path = "crates/rustmotion-common" }
effectcraft-time = { path = "crates/time" }
effectcraft-geom = { path = "crates/geom" }
effectcraft-color = { path = "crates/color" }
+5 -3
View File
@@ -31,6 +31,8 @@ mod window;
use effectcraft_ui_egui::EffectcraftApp;
use serde_json::json;
const APP_NAME: &str = "EffectCraft";
/// The app icon for the window, taskbar and Dock (assets/app-icon, regenerated by
/// `packaging/icons.sh`). macOS gets the padded variant so it sits on Apple's icon grid in the Dock.
/// The 256 px app icon (Windows, Linux; the AppImage's desktop integration installs it too).
@@ -161,7 +163,7 @@ fn main() -> eframe::Result {
let notice = launch.notice.take();
let options = eframe::NativeOptions {
viewport: egui::ViewportBuilder::default()
.with_title("EffectCraft")
.with_title(APP_NAME)
.with_inner_size(window::DEFAULT_SIZE)
.with_min_inner_size(window::MIN_SIZE)
.with_drag_and_drop(true)
@@ -184,7 +186,7 @@ fn main() -> eframe::Result {
#[cfg(target_os = "macos")]
let apple_events = &apple_events;
let result = eframe::run_native(
"EffectCraft",
APP_NAME,
options,
Box::new(move |cc| {
match &cc.wgpu_render_state {
@@ -386,7 +388,7 @@ fn startup_failed(e: &eframe::Error, gl_next: bool) {
}
let _ = rfd::MessageDialog::new()
.set_level(rfd::MessageLevel::Error)
.set_title("EffectCraft")
.set_title(APP_NAME)
.set_description(message)
.set_buttons(rfd::MessageButtons::Ok)
.show();
+1
View File
@@ -10,6 +10,7 @@ rust-version.workspace = true
workspace = true
[dependencies]
effectcraft-rustmotion-common = { workspace = true }
effectcraft-time = { workspace = true }
effectcraft-geom = { workspace = true }
effectcraft-color = { workspace = true }
+2 -1
View File
@@ -1,7 +1,8 @@
//! Community and project links (shown in Help ▸, the About dialog, the start screen and the
//! header's Discord button).
pub const APP_NAME: &str = "EffectCraft";
use effectcraft_rustmotion_common::APP_NAME;
pub const APP_SLUG: &str = "effectcraft";
pub const DISCORD: &str = "https://discord.gg/artcraft";
pub const WEBSITE: &str = "https://getartcraft.com";
+1
View File
@@ -10,6 +10,7 @@ rust-version.workspace = true
workspace = true
[dependencies]
effectcraft-rustmotion-common = { workspace = true }
effectcraft-time = { workspace = true }
effectcraft-project = { workspace = true }
effectcraft-raster = { workspace = true }
+3 -1
View File
@@ -28,10 +28,12 @@
//! (plan ADR 0001); nothing outside this crate touches them.
//!
//! H.264 requires even dimensions: odd output sizes are cropped by one pixel (padded when the
//! output is a single pixel wide/high).
#![deny(clippy::unwrap_used, clippy::expect_used, clippy::panic, clippy::unimplemented, clippy::todo, clippy::unreachable)]
use effectcraft_rustmotion_common::APP_NAME;
mod encode;
mod hevc_av1;
mod out;
+2 -2
View File
@@ -182,8 +182,8 @@ pub(crate) async fn webm(job: &Cx<'_>, comp: &Comp, w: u32, h: u32, st: &mut Sta
let mut info = vec![];
el_uint(&mut info, 0x2AD7B1, 1_000_000);
el_float(&mut info, 0x4489, duration_ms);
el_str(&mut info, 0x4D80, "EffectCraft");
el_str(&mut info, 0x5741, "EffectCraft");
el_str(&mut info, 0x4D80, crate::APP_NAME);
el_str(&mut info, 0x5741, crate::APP_NAME);
el(&mut head, INFO, &info);
let mut tracks = vec![];
let mut v = vec![];
+2 -2
View File
@@ -69,8 +69,8 @@ pub(crate) async fn webm_av1(job: &Cx<'_>, comp: &Comp, w: u32, h: u32, st: &mut
let mut info = vec![];
el_uint(&mut info, 0x2AD7B1, 1_000_000);
el_float(&mut info, 0x4489, duration_ms);
el_str(&mut info, 0x4D80, "EffectCraft");
el_str(&mut info, 0x5741, "EffectCraft");
el_str(&mut info, 0x4D80, crate::APP_NAME);
el_str(&mut info, 0x5741, crate::APP_NAME);
el(&mut head, INFO, &info);
let mut tracks = vec![];
let mut v = vec![];
+2 -1
View File
@@ -509,7 +509,8 @@ pub fn export_comp(project: &Project, comp: ItemId, opts: &ExportOptions, read:
pub fn to_dotlottie(res: &ExportResult, id: &str) -> Vec<u8> {
let id: String = id.chars().map(|c| if c.is_ascii_alphanumeric() || c == '_' || c == '-' { c } else { '_' }).collect();
let id = if id.is_empty() { "animation".to_string() } else { id };
let manifest = json!({"version": "1", "generator": "EffectCraft", "author": "", "animations": [{"id": id, "speed": 1, "loop": true}]});
const GENERATOR: &str = "EffectCraft";
let manifest = json!({"version": "1", "generator": GENERATOR, "author": "", "animations": [{"id": id, "speed": 1, "loop": true}]});
crate::zip::store(&[
("manifest.json".into(), serde_json::to_vec(&manifest).unwrap_or_default()),
(format!("animations/{id}.json"), serde_json::to_vec(&res.json).unwrap_or_default()),
+1
View File
@@ -10,6 +10,7 @@ rust-version.workspace = true
workspace = true
[dependencies]
effectcraft-rustmotion-common = { workspace = true }
effectcraft-time = { workspace = true }
effectcraft-geom = { workspace = true }
effectcraft-color = { workspace = true }
+4 -1
View File
@@ -27,6 +27,9 @@ use std::sync::{Arc, Condvar, Mutex};
use effectcraft_effects::Buf;
use effectcraft_raster::Image;
use effectcraft_rustmotion_common::{self, APP_NAME};
// Uses effectcraft_rustmotion_common::APP_NAME (see its definition)
/// File format version (part of the folder layout).
const VERSION: &str = "v1";
@@ -281,7 +284,7 @@ pub fn default_folder() -> PathBuf {
if cfg!(windows)
&& let Some(l) = std::env::var_os("LOCALAPPDATA")
{
return PathBuf::from(l).join("EffectCraft").join("Disk Cache");
return PathBuf::from(l).join(APP_NAME).join("Disk Cache");
}
if let Some(x) = std::env::var_os("XDG_CACHE_HOME") {
return PathBuf::from(x).join("effectcraft/disk-cache");
+6
View File
@@ -0,0 +1,6 @@
[package]
name = "effectcraft-rustmotion-common"
version.workspace = true
edition.workspace = true
license.workspace = true
rust-version.workspace = true
+4
View File
@@ -0,0 +1,4 @@
//! Shared constants for the EffectCraft/rustMotion application suite.
/// The application name (used in UI, export metadata, and app paths).
pub const APP_NAME: &str = "rustMotion";
+1
View File
@@ -10,6 +10,7 @@ rust-version.workspace = true
workspace = true
[dependencies]
effectcraft-rustmotion-common = { workspace = true }
craft-ui = { workspace = true }
effectcraft-time = { workspace = true }
effectcraft-geom = { workspace = true }
+3 -3
View File
@@ -656,18 +656,18 @@ fn ws_menu(app: &mut EffectcraftApp, ui: &mut egui::Ui) {
/// The ArtCraft mark as supplied in `docs/brand` (the README's and getartcraft.com's logo; used
/// unmodified, see `docs/brand/LICENSE-brand.txt`).
static ARTCRAFT_MARK: &[u8] = include_bytes!("../../../docs/brand/artcraft-mark.png");
static ARTCRAFT_MARK: &[u8] = include_bytes!("../../../docs/brand/rustmotion-mark.png");
/// The ArtCraft mark in `r` (decoded once into a mipmapped texture, so it stays crisp from the
/// 24 px Tools bar to the About dialog). Nothing is drawn if it can't be decoded.
pub fn paint_logo(p: &egui::Painter, r: Rect) {
let ctx = p.ctx();
let id = egui::Id::new("artcraft-mark");
let id = egui::Id::new("rustmotion-mark");
let tex = ctx.data(|d| d.get_temp::<Option<egui::TextureHandle>>(id)).unwrap_or_else(|| {
let tex = image::load_from_memory_with_format(ARTCRAFT_MARK, image::ImageFormat::Png).ok().map(|img| {
let img = img.to_rgba8();
let ci = egui::ColorImage::from_rgba_unmultiplied([img.width() as usize, img.height() as usize], img.as_raw());
ctx.load_texture("artcraft-mark", ci, egui::TextureOptions::LINEAR.with_mipmap_mode(Some(egui::TextureFilter::Linear)))
ctx.load_texture("rustmotion-mark", ci, egui::TextureOptions::LINEAR.with_mipmap_mode(Some(egui::TextureFilter::Linear)))
});
ctx.data_mut(|d| d.insert_temp(id, tex.clone()));
tex
+10 -10
View File
@@ -278,7 +278,7 @@ pub(crate) fn submenu(app: &EffectcraftApp, source: &str, shown: String) -> Stri
/// Chinese After Effects documentation and the catalogs the sibling Craft apps ship; see the
/// pull request for the rows taken from #321.
const SIMPLIFIED_CHINESE: &[(&str, &str, &str)] = &[
("", "EffectCraft", "EffectCraft"),
("", crate::APP_NAME, crate::APP_NAME),
("app.about", "About EffectCraft...", "关于 EffectCraft..."),
("", "Settings...", "设置..."),
("app.settings", "General...", "常规..."),
@@ -912,7 +912,7 @@ const SIMPLIFIED_CHINESE: &[(&str, &str, &str)] = &[
/// entry per fixed menu row of the engine's menu tree, mirroring `SIMPLIFIED_CHINESE` in the
/// vocabulary the sibling Craft apps' zh-hant catalogs use.
const TRADITIONAL_CHINESE: &[(&str, &str, &str)] = &[
("", "EffectCraft", "EffectCraft"),
("", "crate::APP_NAME", "crate::APP_NAME"),
("app.about", "About EffectCraft...", "關於 EffectCraft..."),
("", "Settings...", "設定..."),
("app.settings", "General...", "一般..."),
@@ -1543,7 +1543,7 @@ const TRADITIONAL_CHINESE: &[(&str, &str, &str)] = &[
];
const JAPANESE: &[(&str, &str, &str)] = &[
("", "EffectCraft", "EffectCraft"),
("", "crate::APP_NAME", "crate::APP_NAME"),
("app.about", "About EffectCraft...", "EffectCraftについて..."),
("", "Settings...", "設定..."),
("app.settings", "General...", "一般..."),
@@ -2177,7 +2177,7 @@ const JAPANESE: &[(&str, &str, &str)] = &[
/// Ukrainian motion-graphics vocabulary. Product names and technical identifiers stay verbatim.
/// The (command, source) keys match the other catalogs; no proprietary localization was used.
const UKRAINIAN: &[(&str, &str, &str)] = &[
("", "EffectCraft", "EffectCraft"),
("", "crate::APP_NAME", "crate::APP_NAME"),
("app.about", "About EffectCraft...", "Про EffectCraft..."),
("", "Settings...", "Налаштування..."),
("app.settings", "General...", "Загальні..."),
@@ -2812,7 +2812,7 @@ const UKRAINIAN: &[(&str, &str, &str)] = &[
/// Wording follows Adobe's Spanish After Effects documentation (helpx.adobe.com/es) where it
/// names the feature, and macOS Spanish for the app menu.
const SPANISH: &[(&str, &str, &str)] = &[
("", "EffectCraft", "EffectCraft"),
("", "crate::APP_NAME", "crate::APP_NAME"),
("app.about", "About EffectCraft...", "Acerca de EffectCraft..."),
("", "Settings...", "Ajustes..."),
("app.settings", "General...", "General..."),
@@ -3445,7 +3445,7 @@ const SPANISH: &[(&str, &str, &str)] = &[
/// Brazilian Portuguese: the same (command, English label) keys as `JAPANESE`, one entry
/// per fixed menu row of the engine's menu tree.
const PORTUGUESE: &[(&str, &str, &str)] = &[
("", "EffectCraft", "EffectCraft"),
("", "crate::APP_NAME", "crate::APP_NAME"),
("app.about", "About EffectCraft...", "Sobre o EffectCraft..."),
("", "Settings...", "Configurações..."),
("app.settings", "General...", "Geral..."),
@@ -4086,7 +4086,7 @@ const RUSSIAN: &[(&str, &str, &str)] = &[
("", "Side", "Боковая грань"),
("", "Back", "Задняя грань"),
("layer.addTextAnimator", "Color", "Цвет"),
("", "EffectCraft", "EffectCraft"),
("", "crate::APP_NAME", "crate::APP_NAME"),
("app.about", "About EffectCraft...", "О EffectCraft..."),
("", "Settings...", "Настройки..."),
("app.settings", "General...", "Общие..."),
@@ -4719,7 +4719,7 @@ const FRENCH: &[(&str, &str, &str)] = &[
("", "Side", "Côté"),
("", "Back", "Arrière"),
("layer.addTextAnimator", "Color", "Couleur"),
("", "EffectCraft", "EffectCraft"),
("", "crate::APP_NAME", "crate::APP_NAME"),
("app.about", "About EffectCraft...", "À propos d’EffectCraft..."),
("", "Settings...", "Préférences..."),
("app.settings", "General...", "Général..."),
@@ -5352,7 +5352,7 @@ const GERMAN: &[(&str, &str, &str)] = &[
("", "Side", "Seite"),
("", "Back", "Rückseite"),
("layer.addTextAnimator", "Color", "Farbe"),
("", "EffectCraft", "EffectCraft"),
("", "crate::APP_NAME", "crate::APP_NAME"),
("app.about", "About EffectCraft...", "Über EffectCraft..."),
("", "Settings...", "Voreinstellungen..."),
("app.settings", "General...", "Allgemein..."),
@@ -5985,7 +5985,7 @@ const CZECH: &[(&str, &str, &str)] = &[
("", "Side", "Boční strana"),
("", "Back", "Zadní strana"),
("layer.addTextAnimator", "Color", "Barva"),
("", "EffectCraft", "EffectCraft"),
("", "crate::APP_NAME", "crate::APP_NAME"),
("app.about", "About EffectCraft...", "O aplikaci EffectCraft..."),
("", "Settings...", "Nastavení..."),
("app.settings", "General...", "Obecné..."),
+2
View File
@@ -47,6 +47,8 @@ use serde_json::json;
use state::UiState;
use theme::Tokens;
use effectcraft_rustmotion_common::APP_NAME;
const SCREENSHOT_TIMEOUT_S: f64 = 4.0;
/// Seconds without a project change before paused prefetch resumes (see
/// [`EffectcraftApp::editing`]).
+1 -1
View File
@@ -327,7 +327,7 @@ fn about_main(app: &mut EffectcraftApp, ui: &mut egui::Ui, t: &Tokens, cmd: &mut
let p = ui.painter();
p.rect_filled(r, 10.0, Color32::from_rgb(0x1b, 0x22, 0x3c));
crate::header::paint_logo(p, Rect::from_min_size(r.min + vec2(18.0, 20.0), vec2(56.0, 56.0)));
p.text(r.min + vec2(90.0, 34.0), Align2::LEFT_CENTER, "EffectCraft", Tokens::semibold(24.0), Color32::WHITE);
p.text(r.min + vec2(90.0, 34.0), Align2::LEFT_CENTER, crate::APP_NAME, Tokens::semibold(24.0), Color32::WHITE);
p.text(
r.min + vec2(90.0, 62.0),
Align2::LEFT_CENTER,
+11 -118
View File
@@ -17,7 +17,6 @@ use serde_json::json;
use crate::i18n::tr;
use crate::icons::{self, Icon};
use crate::theme::Tokens;
use crate::dock::PanelKind;
use crate::{EffectcraftApp, widgets};
#[derive(Clone, Debug)]
@@ -1238,7 +1237,6 @@ struct KeyDrag {
anchor: f64,
applied: i64,
quick: Option<usize>,
button: egui::PointerButton,
}
fn key_drag_id() -> egui::Id {
@@ -1253,7 +1251,6 @@ struct QuickBar {
origin_x: f32,
layers: usize,
applied: i64,
button: egui::PointerButton,
}
fn quick_bar_id() -> egui::Id {
@@ -1899,38 +1896,6 @@ pub fn show(app: &mut EffectcraftApp, ui: &mut egui::Ui, rect: Rect) {
app.ui.timeline.scroll_y = rows.iter().take(i).map(|r| row_height(r, rh)).sum();
}
}
// Middle-click drag scrolling for testing
let middle_pressed = ctx.input(|i| {
i.events.iter().any(|e| matches!(e, egui::Event::PointerButton { button: egui::PointerButton::Middle, pressed: true, .. }))
});
let middle_released = ctx.input(|i| {
i.events.iter().any(|e| matches!(e, egui::Event::PointerButton { button: egui::PointerButton::Middle, pressed: false, .. }))
});
if middle_pressed && app.ui.timeline.middle_drag_panel.is_none() && ui.rect_contains_pointer(rows_rect) {
// Start middle-click drag
app.ui.timeline.middle_drag_panel = Some(PanelKind::Timeline);
app.ui.timeline.middle_drag_start_scroll_y = app.ui.timeline.scroll_y;
app.ui.timeline.middle_drag_start_pos = ui.input(|i| i.pointer.latest_pos());
}
// End middle-click drag on release
if middle_released && app.ui.timeline.middle_drag_panel == Some(PanelKind::Timeline) {
app.ui.timeline.middle_drag_panel = None;
app.ui.timeline.middle_drag_start_pos = None;
}
if app.ui.timeline.middle_drag_panel == Some(PanelKind::Timeline) {
// Handle middle-click drag scrolling
if let Some(start_pos) = app.ui.timeline.middle_drag_start_pos {
if let Some(current_pos) = ui.input(|i| i.pointer.latest_pos()) {
let delta = (start_pos.y - current_pos.y) as f64;
app.ui.timeline.scroll_y = (app.ui.timeline.middle_drag_start_scroll_y + delta as f32).clamp(0.0, max_scroll);
}
}
}
if ui.rect_contains_pointer(rows_rect) {
let (dy, dx, zoom) = ui.input(|i| (i.smooth_scroll_delta.y, i.smooth_scroll_delta.x, i.modifiers.alt));
// Ctrl/Cmd+wheel and a trackpad pinch reach egui as a zoom factor rather than a scroll
@@ -1967,24 +1932,7 @@ pub fn show(app: &mut EffectcraftApp, ui: &mut egui::Ui, rect: Rect) {
ctx.request_repaint();
}
}
// End middle-click drag on release
if middle_released && app.ui.timeline.middle_drag_panel == Some(PanelKind::Timeline) {
app.ui.timeline.middle_drag_panel = None;
app.ui.timeline.middle_drag_start_pos = None;
}
app.ui.timeline.scroll_y = app.ui.timeline.scroll_y.clamp(0.0, max_scroll);
// Force pointer state reset after MMB scroll - clear any stuck pointer state
if middle_released {
ctx.memory_mut(|m| {
// Clear pointer state to allow normal interactions
});
}
// Force egui to reprocess pointer state after MMB scroll
if middle_released {
ctx.request_repaint();
}
let snap_project = app.session.project.clone();
let snap_expr = app.session.expr.clone();
let ectx = EvalCtx { project: &snap_project, comp_id: cid, comp: &comp, time, expr: snap_expr.as_deref(), footage: None };
@@ -2088,36 +2036,9 @@ pub fn show(app: &mut EffectcraftApp, ui: &mut egui::Ui, rect: Rect) {
);
// Twirl + icon + name.
let tw = Rect::from_center_size(pos2(cw.name + 8.0, cy), vec2(14.0, 14.0));
let is_open = app.ui.timeline.open_layers.contains(&layer.id.0);
if widgets::twirl(ui, tw, is_open, egui::Id::new(("twirl", layer.id.0)), &t).clicked() {
let alt_command = ui.input(|i| i.modifiers.alt || i.modifiers.command);
let shift = ui.input(|i| i.modifiers.shift);
// If layer is not selected, determine what selection should be
let mut layers_to_select: Vec<u64> = vec![];
if !selected.contains(&layer.id) {
if shift {
// SHIFT + click: keep existing selection and add this layer
layers_to_select = selected.iter().map(|id| id.0).collect();
layers_to_select.push(layer.id.0);
} else {
// Normal click: replace selection with just this layer
layers_to_select = vec![layer.id.0];
}
// Send selection action FIRST
actions.push(("layer.select".into(), json!({"layers": layers_to_select, "add": shift})));
} else {
// Layer is already selected, use it as the target for toggles
layers_to_select = selected.iter().map(|id| id.0).collect();
}
// Now toggle properties for the NEW selection (layers_to_select)
let target_state = !is_open;
for layer_id in &layers_to_select {
ui_actions.push(UiAct::ToggleLayer(*layer_id, alt_command, target_state));
}
let open = app.ui.timeline.open_layers.contains(&layer.id.0);
if widgets::twirl(ui, tw, open, egui::Id::new(("twirl", layer.id.0)), &t).clicked() {
ui_actions.push(UiAct::ToggleLayer(layer.id.0, ui.input(|i| i.modifiers.alt || i.modifiers.command)));
}
app.auto.add(&format!("timeline.layer.{}.twirl", layer.id.0), tw, "twirl");
icons::paint(&lp, Rect::from_center_size(pos2(cw.name + 24.0, cy), vec2(13.0, 13.0)), layer_icon(layer, &app.session.project), t.text_dim);
@@ -2157,8 +2078,7 @@ pub fn show(app: &mut EffectcraftApp, ui: &mut egui::Ui, rect: Rect) {
}
// Locked layers can't be selected or moved (unlock them with the lock switch).
let locked = layer.switches.locked;
// Layer reordering only with primary button (not middle/right)
if row_resp.drag_started() && !locked && row_resp.dragged_by(egui::PointerButton::Primary) {
if row_resp.drag_started() && !locked {
// The selected layers move together; an unselected row moves alone.
let moving: Vec<u64> =
if is_sel { comp.layers.iter().filter(|l| selected.contains(&l.id)).map(|l| l.id.0).collect() } else { vec![layer.id.0] };
@@ -2406,46 +2326,24 @@ pub fn show(app: &mut EffectcraftApp, ui: &mut egui::Ui, rect: Rect) {
}
layer_context_menu(&body, &comp, layer, &selected, LayerMenuCaps::of(&app.session.project, layer), &mut actions);
let drag_key = format!("bar-{}", layer.id.0);
// Normal dragging (not Quick Offset) - only primary button
if body.drag_started() && !is_sel && ui.input(|i| i.pointer.primary_pressed()) {
// The selected layers move together; an unselected row moves alone.
let moving: Vec<u64> = vec![layer.id.0];
ctx.data_mut(|d| d.insert_temp(layer_drag_id(), moving));
}
// Ctrl/Cmd+Alt dragging a selected bar: Quick Offset (#1012)
// Ctrl/Cmd+Alt dragging a selected bar: Quick Offset (#1012), chosen as the
// drag starts and followed below the rows until the button is released.
let mods = ui.input(|i| i.modifiers);
if body.drag_started()
&& is_sel
&& mods.command
&& mods.alt
&& ui.input(|i| i.pointer.primary_pressed())
&& let Some(n) = quick_offset_layers(&comp, selected.iter().copied())
&& let Some(p) = ctx.input(|i| i.pointer.press_origin())
{
ctx.data_mut(|d| d.insert_temp(quick_bar_id(), QuickBar { layer: layer.id, origin_x: p.x, layers: n, applied: 0, button: egui::PointerButton::Primary }));
ctx.data_mut(|d| d.insert_temp(quick_bar_id(), QuickBar { layer: layer.id, origin_x: p.x, layers: n, applied: 0 }));
}
let quick = ctx.data(|d| d.get_temp::<QuickBar>(quick_bar_id())).is_some_and(|q| q.layer == layer.id);
for (resp, kind) in [(&body, "move"), (&lin, "in"), (&lout, "out")] {
if kind == "move" && quick {
continue;
}
// Layer bar dragging only with primary button
if resp.dragged() {
let button = if let Some(q) = ctx.data(|d| d.get_temp::<QuickBar>(quick_bar_id())) {
q.button
} else {
// Normal drag without Quick Offset - check current button
if ui.input(|i| i.pointer.primary_pressed()) {
egui::PointerButton::Primary
} else {
egui::PointerButton::Secondary
}
};
if button != egui::PointerButton::Primary {
continue;
}
let acc_id = egui::Id::new(("bar-acc", layer.id.0, kind));
let mut acc: f32 = ctx.data(|d| d.get_temp(acc_id).unwrap_or(0.0));
acc += resp.drag_delta().x;
@@ -3024,8 +2922,6 @@ pub fn show(app: &mut EffectcraftApp, ui: &mut egui::Ui, rect: Rect) {
if kresp.drag_started()
&& mods.alt
&& !mods.command
&& ui.input(|i| i.pointer.button_pressed(egui::PointerButton::Primary))
&& !ui.input(|i| i.pointer.button_pressed(egui::PointerButton::Middle))
&& let Some(c) = app.session.active_comp_arc()
{
super::graph_tools::alt_scale_begin(app, &ctx, &c, ct.seconds());
@@ -3036,13 +2932,11 @@ pub fn show(app: &mut EffectcraftApp, ui: &mut egui::Ui, rect: Rect) {
// (From where the button went down: a drag starts a few pixels later.)
if kresp.drag_started()
&& !super::graph_tools::alt_scale_active(&ctx)
&& ui.input(|i| i.pointer.primary_pressed())
&& !ui.input(|i| i.pointer.button_pressed(egui::PointerButton::Middle))
&& let Some(p) = ctx.input(|i| i.pointer.press_origin())
{
// Ctrl/Cmd+Alt: Quick Offset of the selected keys' layers (#1012).
let quick = (mods.command && mods.alt && ks).then(|| quick_offset_layers(&comp, sel_keys.iter().map(|k| k.layer))).flatten();
ctx.data_mut(|d| d.insert_temp(key_drag_id(), KeyDrag { origin_x: p.x, anchor: ct.seconds(), applied: 0, quick, button: egui::PointerButton::Primary }));
ctx.data_mut(|d| d.insert_temp(key_drag_id(), KeyDrag { origin_x: p.x, anchor: ct.seconds(), applied: 0, quick }));
}
}
}
@@ -3194,7 +3088,6 @@ pub fn show(app: &mut EffectcraftApp, ui: &mut egui::Ui, rect: Rect) {
ctx.data_mut(|d| d.insert_temp(egui::Id::new("tl-box"), br));
}
// Layer reorder drag: a line where the layers will land; the release moves them there.
// Layer reorder drag: a line where the layers will land; the release moves them there.
if let Some(moving) = ctx.data(|d| d.get_temp::<Vec<u64>>(layer_drag_id())) {
let dropped = ctx.data_mut(|d| d.remove_temp::<bool>(layer_drop_id())).unwrap_or(false);
let layer_rows: Vec<(Rect, LayerId)> = hit_rows.iter().filter(|(_, r)| matches!(r.kind, RowKind::Layer)).map(|(rr, r)| (*rr, r.layer)).collect();
@@ -3488,13 +3381,13 @@ pub fn show(app: &mut EffectcraftApp, ui: &mut egui::Ui, rect: Rect) {
// Apply.
for a in ui_actions {
match a {
UiAct::ToggleLayer(id, all, force_state) => {
UiAct::ToggleLayer(id, all) => {
let tl = &mut app.ui.timeline;
// Twirled by hand, the layer shows its whole tree again.
tl.reveal.clear();
tl.layer_reveal.remove(&id);
tl.full_groups.remove(&id);
let open = force_state;
let open = !tl.open_layers.contains(&id);
if open {
tl.open_layers.insert(id);
} else {
@@ -3648,7 +3541,7 @@ fn layer_cells(
}
enum UiAct {
ToggleLayer(u64, bool, bool),
ToggleLayer(u64, bool),
/// Layer, group uid, and whether the whole tree under the group follows.
ToggleGroup(u64, u64, bool),
SetTime(Tick),
-10
View File
@@ -353,13 +353,6 @@ pub struct TimelineState {
#[serde(skip)]
pub before_fit: Option<(f64, f64)>,
pub scroll_y: f32,
/// Middle-click drag state for testing scroll by middle-mouse dragging.
#[serde(skip)]
pub middle_drag_panel: Option<crate::dock::PanelKind>,
#[serde(skip)]
pub middle_drag_start_scroll_y: f32,
#[serde(skip)]
pub middle_drag_start_pos: Option<egui::Pos2>,
/// Left column area width.
pub columns_w: f32,
/// Horizontal scroll of the outline columns (pixels) when they are wider than the pane.
@@ -449,9 +442,6 @@ impl Default for TimelineState {
pps: None,
before_fit: None,
scroll_y: 0.0,
middle_drag_panel: None,
middle_drag_start_scroll_y: 0.0,
middle_drag_start_pos: None,
columns_w: 560.0,
outline_scroll: 0.0,
show_modes: false,
Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 12 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 17 KiB