Skip to content

Commit

Permalink
FilterGraphEdtiro: added icons for add and subtract filters
Browse files Browse the repository at this point in the history
  • Loading branch information
azonenberg committed Sep 4, 2023
1 parent 29741a3 commit 08d2814
Show file tree
Hide file tree
Showing 5 changed files with 159 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/ngscopeclient/FilterGraphEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ FilterGraphEditor::FilterGraphEditor(Session& session, MainWindow* parent)
m_context = ax::NodeEditor::CreateEditor(&m_config);

//Load icons for filters
m_parent->GetTextureManager()->LoadTexture("filter-add", FindDataFile("icons/filters/filter-add.png"));
m_parent->GetTextureManager()->LoadTexture("filter-multiply", FindDataFile("icons/filters/filter-multiply.png"));
m_parent->GetTextureManager()->LoadTexture("filter-subtract", FindDataFile("icons/filters/filter-subtract.png"));
m_parent->GetTextureManager()->LoadTexture("filter-threshold", FindDataFile("icons/filters/filter-threshold.png"));
m_parent->GetTextureManager()->LoadTexture("filter-upsample", FindDataFile("icons/filters/filter-upsample.png"));
m_parent->GetTextureManager()->LoadTexture("input-banana-dual", FindDataFile("icons/filters/input-banana-dual.png"));
Expand Down Expand Up @@ -1157,8 +1159,12 @@ void FilterGraphEditor::NodeIcon(InstrumentChannel* chan, ImVec2 pos, ImVec2 ico
break;
}
}
else if(dynamic_cast<AddFilter*>(chan))
iconname = "filter-add";
else if(dynamic_cast<MultiplyFilter*>(chan))
iconname = "filter-multiply";
else if(dynamic_cast<SubtractFilter*>(chan))
iconname = "filter-subtract";
else if(dynamic_cast<ThresholdFilter*>(chan))
iconname = "filter-threshold";
else if(dynamic_cast<UpsampleFilter*>(chan))
Expand All @@ -1177,11 +1183,7 @@ void FilterGraphEditor::NodeIcon(InstrumentChannel* chan, ImVec2 pos, ImVec2 ico

//Default to no icon, then add icons for basic math blocks
string str = "";
if(dynamic_cast<AddFilter*>(chan))
str = "+";
else if(dynamic_cast<SubtractFilter*>(chan))
str = "-";
else if(dynamic_cast<DivideFilter*>(chan))
if(dynamic_cast<DivideFilter*>(chan))
str = "÷";
else if(dynamic_cast<ToneGeneratorFilter*>(chan))
str = "";
Expand Down
Binary file added src/ngscopeclient/icons/filters/filter-add.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
78 changes: 78 additions & 0 deletions src/ngscopeclient/icons/scalable/filter-add.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
74 changes: 74 additions & 0 deletions src/ngscopeclient/icons/scalable/filter-subtract.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 08d2814

Please sign in to comment.