@@ -60,6 +60,10 @@ bool GraphListPane::DrawPanes(const uint32_t& /*vCurrentFrame*/, bool* vOpened,
6060 flags = ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoBringToFrontOnFocus | ImGuiWindowFlags_MenuBar;
6161#endif
6262 if (ProjectFile::Instance ()->IsProjectLoaded ()) {
63+ if (ImGui::BeginMenuBar ()) {
64+ DrawMenuBar ();
65+ ImGui::EndMenuBar ();
66+ }
6367 DrawTree ();
6468 }
6569 }
@@ -90,6 +94,7 @@ void GraphListPane::DisplayItem(const int& vIdx, const SignalSerieWeak& vDatasSe
9094 ImGui::PushID (vIdx);
9195 ImGui::TableSetColumnIndex (0 );
9296 if (ImGui::Selectable (datas_ptr->category .c_str (), &datas_ptr->show , ImGuiSelectableFlags_SpanAllColumns, ImVec2 (0 , GRAPHS_HEIGHT))) {
97+ ProjectFile::Instance ()->SetProjectChange ();
9398 LogEngine::Instance ()->ShowHideSignal (datas_ptr->category , datas_ptr->name , datas_ptr->show );
9499 if (ProjectFile::Instance ()->m_CollapseLogSelection ) {
95100 LogPane::Instance ()->PrepareLog ();
@@ -99,6 +104,7 @@ void GraphListPane::DisplayItem(const int& vIdx, const SignalSerieWeak& vDatasSe
99104
100105 ImGui::TableSetColumnIndex (1 );
101106 if (ImGui::Selectable (datas_ptr->name .c_str (), &datas_ptr->show , ImGuiSelectableFlags_SpanAllColumns, ImVec2 (0 , GRAPHS_HEIGHT))) {
107+ ProjectFile::Instance ()->SetProjectChange ();
102108 LogEngine::Instance ()->ShowHideSignal (datas_ptr->category , datas_ptr->name , datas_ptr->show );
103109 if (ProjectFile::Instance ()->m_CollapseLogSelection ) {
104110 LogPane::Instance ()->PrepareLog ();
@@ -159,28 +165,45 @@ void GraphListPane::DisplayItem(const int& vIdx, const SignalSerieWeak& vDatasSe
159165 }
160166}
161167
162- void GraphListPane::DrawTree () {
163- auto & search_string = ProjectFile::Instance ()->m_AllGraphSignalsSearchString ;
164-
165- if (ImGui::BeginMenuBar ()) {
166- ImGui::Text (" %s" , " Search : " );
168+ void GraphListPane::DrawMenuBar () {
169+ bool change = false ;
167170
168- snprintf (m_search_buffer, 1024 , " %s" , search_string.c_str ());
169- if (ImGui::ContrastedButton (" R##GraphListPane_SearchDrawTree" )) {
170- search_string.clear ();
171- m_search_buffer[0 ] = ' \0 ' ;
172- PrepareLog (search_string);
171+ if (ImGui::BeginMenu (" Settings" )) {
172+ if (ImGui::MenuItem (" Show variable signals only" , nullptr , &ProjectFile::Instance ()->m_ShowVariableSignalsInAllGraphView )) {
173+ ProjectFile::Instance ()->SetProjectChange ();
174+ change = true ;
173175 }
174176
175- ImGui::PushItemWidth (ImGui::GetContentRegionAvail ().x );
176- if (ImGui::InputText (" ##GraphListPane_Search" , m_search_buffer, 1024 )) {
177- search_string = ez::str::toLower (m_search_buffer);
178- PrepareLog (search_string);
179- }
180- ImGui::PopItemWidth ();
177+ ImGui::EndMenu ();
178+ }
179+
180+ ImGui::Text (" %s" , " Search : " );
181+
182+ auto & search_string = ProjectFile::Instance ()->m_AllGraphSignalsSearchString ;
183+ snprintf (m_search_buffer, 1024 , " %s" , search_string.c_str ());
184+
185+ if (ImGui::ContrastedButton (" R##GraphListPane_SearchDrawTree" )) {
186+ ProjectFile::Instance ()->SetProjectChange ();
187+ search_string.clear ();
188+ m_search_buffer[0 ] = ' \0 ' ;
189+ change = true ;
190+ }
181191
182- ImGui::EndMenuBar ();
192+ ImGui::PushItemWidth (ImGui::GetContentRegionAvail ().x );
193+ if (ImGui::InputText (" ##GraphListPane_Search" , m_search_buffer, 1024 )) {
194+ ProjectFile::Instance ()->SetProjectChange ();
195+ search_string = ez::str::toLower (m_search_buffer);
196+ change = true ;
183197 }
198+ ImGui::PopItemWidth ();
199+
200+ if (change) {
201+ PrepareLog (search_string);
202+ }
203+ }
204+
205+ void GraphListPane::DrawTree () {
206+ auto & search_string = ProjectFile::Instance ()->m_AllGraphSignalsSearchString ;
184207
185208 static ImGuiTableFlags flags = ImGuiTableFlags_SizingFixedFit | ImGuiTableFlags_RowBg | ImGuiTableFlags_Hideable | ImGuiTableFlags_ScrollY |
186209 ImGuiTableFlags_NoHostExtendY | ImGuiTableFlags_Resizable;
@@ -232,7 +255,9 @@ void GraphListPane::PrepareLog(const std::string& vSearchString) {
232255 if (is_their_some_search && signal_ptr->low_case_name_for_search .find (vSearchString) == std::string::npos) {
233256 continue ;
234257 }
235-
258+ if (ProjectFile::Instance ()->m_ShowVariableSignalsInAllGraphView && signal_ptr->isConstant ()) {
259+ continue ;
260+ }
236261 m_FilteredSignalSeries.push_back (item_name);
237262 }
238263 }
0 commit comments