Skip to content

Commit

Permalink
fix: select newly created file even if the source is an item and not …
Browse files Browse the repository at this point in the history
…a folder/project
  • Loading branch information
Freaxed committed Feb 3, 2025
1 parent 3d3c7ac commit 192623f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/ui/ProjectBrowser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -901,9 +901,16 @@ ProjectBrowser::SelectProjectAndScroll(ProjectFolder* projectFolder)
void
ProjectBrowser::SelectNewItemAndScrollDelayed(ProjectItem* parent, const entry_ref ref)
{

// Let's select the new created file.
// just send a message to the ProjectBrowser with the new ref
// .. after some milliseconds..

// the selected item initiating this is not a folder or project but a file.
if (parent->GetSourceItem()->Type() == FileItem) {
parent = (ProjectItem*)fOutlineListView->Superitem(parent);
}

BMessage selectMessage(MSG_BROWSER_SELECT_ITEM);
selectMessage.AddPointer("parent_item", parent);
selectMessage.AddRef("ref", &ref);
Expand Down

0 comments on commit 192623f

Please sign in to comment.