| 17 | namespace EE { namespace UI { namespace Tools { |
| 18 | |
| 19 | UIScrollView* UIDiffView::NewMultiFileDiffViewer( const std::string& patchText ) { |
| 20 | auto scrollView = UIScrollView::New(); |
| 21 | auto vbox = UILinearLayout::NewVertical(); |
| 22 | vbox->setParent( scrollView ); |
| 23 | vbox->setLayoutSizePolicy( SizePolicy::MatchParent, SizePolicy::WrapContent ); |
| 24 | |
| 25 | auto diffs = UIDiffView::splitDiff( patchText ); |
| 26 | |
| 27 | for ( const auto& diff : diffs ) { |
| 28 | auto* diffView = UIDiffView::New(); |
| 29 | diffView->setLayoutSizePolicy( SizePolicy::MatchParent, SizePolicy::WrapContent ); |
| 30 | diffView->setParent( vbox ); |
| 31 | diffView->setHeadersVisible( true ); |
| 32 | diffView->loadFromPatch( diff ); |
| 33 | } |
| 34 | |
| 35 | return scrollView; |
| 36 | } |
| 37 | |
| 38 | class UIDiffEditorPlugin : public UICodeEditorPlugin { |
| 39 | public: |
nothing calls this directly
no test coverage detected