Donner 0.8.0-pre
Embeddable browser-grade SVG2 engine
Loading...
Searching...
No Matches
donner::editor::SidebarPresenter Class Reference

Renders the editor's tree view and inspector panes. More...

#include "donner/editor/SidebarPresenter.h"

Public Member Functions

void refreshSnapshot (const EditorApp &app)
 Refresh the tree / inspector snapshot from live app state. Safe to call only when the async renderer is idle.
void renderTreeView (EditorApp *liveApp, TreeViewState &state) const
 Render the tree pane from the current snapshot. When liveApp is non-null, click-induced selection mutations are applied to it; when null, clicks are dropped (the render is "read-only" because the worker thread owns the document).
bool renderInspector (EditorApp *liveApp, const ViewportState &viewport) const
 Render the inspector pane from the current snapshot.
bool inspectorHasSelectionForTesting () const
std::span< const std::pair< std::string, std::string > > inspectorXmlAttributesForTesting () const
std::span< const std::pair< std::string, std::string > > inspectorComputedStyleForTesting () const

Detailed Description

Renders the editor's tree view and inspector panes.

The panes are always rendered from an internal snapshot so they stay visible even while the async renderer is mutating the document (the "(rendering…)" placeholder used to cover this gap, which made the panes flash to a disabled message on every render). The snapshot is refreshed from the live EditorApp when the caller indicates the worker thread isn't touching the document; otherwise the most recent capture is replayed unchanged. Click handling is gated the same way so mutations can't race the worker.

Member Function Documentation

◆ renderInspector()

bool donner::editor::SidebarPresenter::renderInspector ( EditorApp * liveApp,
const ViewportState & viewport ) const

Render the inspector pane from the current snapshot.

Parameters
liveAppLive editor app for button actions, or null while the renderer owns the document.
viewportViewport state diagnostics.
Returns
true if an inspector action queued a document mutation.

The documentation for this class was generated from the following file: