perf(editor): native Windows preview and UI-first timeline navigation (#11)
Gitea CI / Check code and tests (push) Successful in 8m7s
Gitea CI / Build Windows x64 app (push) Successful in 5m48s
Gitea CI / Build Android APK (push) Successful in 5m59s
Gitea CI / Audit and package Windows x64 (push) Successful in 1m17s
Gitea CI / Assemble and validate CI artifacts (push) Successful in 1m22s
Gitea CI / Gitea CI passed (push) Successful in 2s
Gitea CI / Check code and tests (push) Successful in 8m7s
Gitea CI / Build Windows x64 app (push) Successful in 5m48s
Gitea CI / Build Android APK (push) Successful in 5m59s
Gitea CI / Audit and package Windows x64 (push) Successful in 1m17s
Gitea CI / Assemble and validate CI artifacts (push) Successful in 1m22s
Gitea CI / Gitea CI passed (push) Successful in 2s
This commit was merged in pull request #11.
This commit is contained in:
1 parent
0ecf920669
commit
b4cb12cbe3
36 files changed
+3292
-148
No files matched your search
@@ -24,22 +24,49 @@ class PropertiesInspectorController extends ChangeNotifier {
|
||||
PropertiesInspectorController(this.session) {
|
||||
session.addListener(_sessionChanged);
|
||||
_bindView();
|
||||
_captureSelection();
|
||||
}
|
||||
final EditorTimelineSession session;
|
||||
Listenable? _editingChanges;
|
||||
SequenceId? _lastSequence;
|
||||
Object? _lastVersion;
|
||||
Set<Object> _lastSelection = {};
|
||||
SequenceId? get sequence => session.activeSequenceId;
|
||||
|
||||
void _bindView() {
|
||||
final id = sequence;
|
||||
final next = id == null ? null : session.view(id).editingChanges;
|
||||
if (identical(next, _editingChanges)) return;
|
||||
_editingChanges?.removeListener(notifyListeners);
|
||||
_editingChanges?.removeListener(_viewChanged);
|
||||
_editingChanges = next;
|
||||
_editingChanges?.addListener(notifyListeners);
|
||||
_editingChanges?.addListener(_viewChanged);
|
||||
}
|
||||
|
||||
bool _captureSelection() {
|
||||
final id = sequence;
|
||||
final view = id == null ? null : session.view(id);
|
||||
final version = view?.version.kernelVersion;
|
||||
final selected = view?.selectedIdentities ?? const <Object>{};
|
||||
if (id == _lastSequence &&
|
||||
identical(version, _lastVersion) &&
|
||||
setEquals(selected, _lastSelection)) {
|
||||
return false;
|
||||
}
|
||||
_lastSequence = id;
|
||||
_lastVersion = version;
|
||||
_lastSelection = selected.toSet();
|
||||
return true;
|
||||
}
|
||||
|
||||
void _viewChanged() {
|
||||
// The inspector's selection shell does not depend on the playhead. Its
|
||||
// property editors subscribe separately to position and live edit changes.
|
||||
if (_captureSelection()) notifyListeners();
|
||||
}
|
||||
|
||||
void _sessionChanged() {
|
||||
_bindView();
|
||||
_captureSelection();
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
@@ -66,7 +93,7 @@ class PropertiesInspectorController extends ChangeNotifier {
|
||||
@override
|
||||
void dispose() {
|
||||
session.removeListener(_sessionChanged);
|
||||
_editingChanges?.removeListener(notifyListeners);
|
||||
_editingChanges?.removeListener(_viewChanged);
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user