Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ngscopeclient/scopehal-apps
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 6199f86f75a0
Choose a base ref
...
head repository: ngscopeclient/scopehal-apps
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 76deb9d904db
Choose a head ref
  • 1 commit
  • 3 files changed
  • 1 contributor

Commits on Dec 6, 2020

  1. Copy the full SHA
    76deb9d View commit details
Showing with 20 additions and 3 deletions.
  1. +4 −2 src/glscopeclient/FilterGraphEditor.cpp
  2. +2 −1 src/glscopeclient/FilterGraphEditor.h
  3. +14 −0 src/glscopeclient/FilterGraphEditorWidget.cpp
6 changes: 4 additions & 2 deletions src/glscopeclient/FilterGraphEditor.cpp
Original file line number Diff line number Diff line change
@@ -46,9 +46,11 @@ FilterGraphEditor::FilterGraphEditor(OscilloscopeWindow* parent)
, m_editor(this)
{
set_title("Filter Graph Editor");
set_size_request(800, 600);
set_size_request(320, 240);

add(m_editor);
add(m_scroller);
m_scroller.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
m_scroller.add(m_editor);

show_all();
}
3 changes: 2 additions & 1 deletion src/glscopeclient/FilterGraphEditor.h
Original file line number Diff line number Diff line change
@@ -55,7 +55,8 @@ class FilterGraphEditor : public Gtk::Window
protected:
OscilloscopeWindow* m_parent;

FilterGraphEditorWidget m_editor;
Gtk::ScrolledWindow m_scroller;
FilterGraphEditorWidget m_editor;
};

#endif
14 changes: 14 additions & 0 deletions src/glscopeclient/FilterGraphEditorWidget.cpp
Original file line number Diff line number Diff line change
@@ -793,6 +793,20 @@ void FilterGraphEditorWidget::UpdatePositions()
UnplaceMisplacedNodes();
AssignNodesToColumns();
UpdateColumnPositions();

//Calculate overall size
int right = 0;
int bottom = 0;
for(auto it : m_nodes)
{
auto node = it.second;
right = max(node->m_rect.get_right(), right);
bottom = max(node->m_rect.get_bottom(), bottom);
}
right += 20;
bottom += 20;

set_size_request(right, bottom);
}

void FilterGraphEditorWidget::AssignInitialPositions(set<FilterGraphEditorNode*>& nodes)