Skip to content

Commit

Permalink
Filter graph editor now opens by default in new sessions
Browse files Browse the repository at this point in the history
  • Loading branch information
azonenberg committed Aug 23, 2024
1 parent e9be98e commit 6c96adf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/ngscopeclient/Dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ bool Dialog::Render()
return false;

string name = m_title + "###" + m_id;

ImGui::SetNextWindowSize(m_defaultSize, ImGuiCond_Appearing);
if(!ImGui::Begin(name.c_str(), &m_open, ImGuiWindowFlags_NoCollapse))
{
Expand Down
3 changes: 3 additions & 0 deletions src/ngscopeclient/Dialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ class Dialog
const std::string& GetID()
{ return m_id; }

std::string GetTitleAndID()
{ return m_title + "###" + m_id; }

//TODO: this might be better off as a global method?
static bool Combo(const std::string& label, const std::vector<std::string>& items, int& selection);
static bool UnitInputWithImplicitApply(
Expand Down
7 changes: 5 additions & 2 deletions src/ngscopeclient/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1260,15 +1260,18 @@ void MainWindow::DockingArea()
auto topNode = ImGui::DockBuilderGetNode(dockspace_id);
if(topNode != nullptr)
{
LogTrace("Docking dialog\n");
LogTrace("Docking newly created dialogs under %08x\n", dockspace_id);

//Traverse down the top/left of the tree as long as such a node exists
auto node = topNode;
while(node->ChildNodes[0])
node = node->ChildNodes[0];

for(auto dock : m_dockRequests)
ImGui::DockBuilderDockWindow(dock.m_dlg->GetID().c_str(), node->ID);
{
LogTrace("Docking %s under %08x\n", dock.m_dlg->GetTitleAndID().c_str(), node->ID);
ImGui::DockBuilderDockWindow(dock.m_dlg->GetTitleAndID().c_str(), node->ID);
}
m_dockRequests.clear();

//Finish up
Expand Down

0 comments on commit 6c96adf

Please sign in to comment.