Skip to content

Commit c0eadbb

Browse files
committed
When adding a new scene, set this as active, editing and reset all others
1 parent fbc88d0 commit c0eadbb

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

src/ui/scenes.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ pub fn render_scenes(model: &mut Model, ui: &mut Ui) {
5353
label,
5454
state,
5555
is_editing: true,
56-
last_active: false,
56+
last_active: true,
5757
next_transition: 0.,
5858
});
5959
}
@@ -213,5 +213,15 @@ pub fn render_scenes(model: &mut Model, ui: &mut Ui) {
213213

214214
if let Some(scene) = add_scene {
215215
model.project.scenes.push(scene);
216+
217+
let new_scene_index = model.project.scenes.len() - 1;
218+
219+
// Also, mark all other scenes as not-editing and not-active...
220+
for (index, scene) in model.project.scenes.iter_mut().enumerate() {
221+
if index != new_scene_index {
222+
scene.last_active = false;
223+
scene.is_editing = false;
224+
}
225+
}
216226
}
217227
}

0 commit comments

Comments
 (0)