Refine editor shell asset contract
This commit is contained in:
@@ -19,6 +19,19 @@ Widgets::UIEditorStatusBarSegment BuildDefaultShellModeSegment() {
|
||||
return segment;
|
||||
}
|
||||
|
||||
Widgets::UIEditorStatusBarSegment BuildDefaultActivePanelSegment(
|
||||
const UIEditorWorkspaceModel& workspace) {
|
||||
Widgets::UIEditorStatusBarSegment segment = {};
|
||||
segment.segmentId = "active-panel";
|
||||
segment.label = workspace.activePanelId.empty() ? std::string("(none)") : workspace.activePanelId;
|
||||
segment.slot = Widgets::UIEditorStatusBarSlot::Trailing;
|
||||
segment.tone = Widgets::UIEditorStatusBarTextTone::Muted;
|
||||
segment.interactive = false;
|
||||
segment.showSeparator = false;
|
||||
segment.desiredWidth = 144.0f;
|
||||
return segment;
|
||||
}
|
||||
|
||||
EditorShellAssetValidationResult MakeValidationError(
|
||||
EditorShellAssetValidationCode code,
|
||||
std::string message) {
|
||||
@@ -124,9 +137,13 @@ UIEditorWorkspacePanelPresentationModel BuildShellPresentation(
|
||||
}
|
||||
|
||||
UIEditorShellInteractionDefinition BuildDefaultShellDefinition(
|
||||
const UIEditorPanelRegistry& panelRegistry) {
|
||||
const UIEditorPanelRegistry& panelRegistry,
|
||||
const UIEditorWorkspaceModel& workspace) {
|
||||
UIEditorShellInteractionDefinition definition = {};
|
||||
definition.statusSegments = { BuildDefaultShellModeSegment() };
|
||||
definition.statusSegments = {
|
||||
BuildDefaultShellModeSegment(),
|
||||
BuildDefaultActivePanelSegment(workspace)
|
||||
};
|
||||
definition.workspacePresentations.reserve(panelRegistry.panels.size());
|
||||
for (const UIEditorPanelDescriptor& descriptor : panelRegistry.panels) {
|
||||
definition.workspacePresentations.push_back(BuildShellPresentation(descriptor));
|
||||
@@ -144,7 +161,7 @@ EditorShellAsset BuildDefaultEditorShellAsset(const std::filesystem::path& repoR
|
||||
asset.panelRegistry = BuildDefaultEditorShellPanelRegistry();
|
||||
asset.workspace = BuildDefaultEditorShellWorkspaceModel();
|
||||
asset.workspaceSession = BuildDefaultUIEditorWorkspaceSession(asset.panelRegistry, asset.workspace);
|
||||
asset.shellDefinition = BuildDefaultShellDefinition(asset.panelRegistry);
|
||||
asset.shellDefinition = BuildDefaultShellDefinition(asset.panelRegistry, asset.workspace);
|
||||
return asset;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user