MCPcopy Create free account
hub / github.com/LibreSprite/LibreSprite / onAddDocument

Method onAddDocument

src/app/ui_context.cpp:186–205  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

184}
185
186void UIContext::onAddDocument(doc::Document* doc)
187{
188 m_lastSelectedDoc = static_cast<app::Document*>(doc);
189
190 // We don't create views in batch mode.
191 if (!App::instance()->isGui())
192 return;
193
194 // Add a new view for this document
195 DocumentView* view = new DocumentView(
196 m_lastSelectedDoc,
197 DocumentView::Normal,
198 App::instance()->mainWindow()->getPreviewEditor());
199
200 // Add a tab with the new view for the document
201 App::instance()->workspace()->addView(view);
202
203 setActiveView(view);
204 view->editor()->setDefaultScroll();
205}
206
207void UIContext::onRemoveDocument(doc::Document* doc)
208{

Callers

nothing calls this directly

Calls 8

instanceFunction · 0.85
isGuiMethod · 0.80
getPreviewEditorMethod · 0.80
mainWindowMethod · 0.80
workspaceMethod · 0.80
setDefaultScrollMethod · 0.80
addViewMethod · 0.45
editorMethod · 0.45

Tested by

no test coverage detected