Files
Sourcetrail/src/lib_gui/qt/element/QtCodeNavigateable.h
T
Eberhard Graether 95ef8c3eec ui: Added on-screen search feature (issue #79)
* Use menu action "Edit -> Find in View" or Ctrl + D
* UI displayed as search bar at bottom of main window
* Hide search bar with ECS or close button
* Entering a query searches in name of graph nodes and code contents of code view
* Use Enter to iterate through matches, well move match into view in graph and code view
* Checkboxes allow for adding/removing results for certain views
* Create Bookmark shortcut is now CTRL + S

bug id = 79
2017-09-19 14:00:40 +02:00

41 lines
1.1 KiB
C++

#ifndef QT_CODE_NAVIGATEABLE_H
#define QT_CODE_NAVIGATEABLE_H
#include <set>
#include "utility/types.h"
#include "component/view/helper/CodeSnippetParams.h"
class FilePath;
class QRectF;
class QAbstractScrollArea;
class QtCodeArea;
class QWidget;
class QtCodeNavigateable
{
public:
virtual ~QtCodeNavigateable();
virtual QAbstractScrollArea* getScrollArea() = 0;
virtual void addCodeSnippet(const CodeSnippetParams& params) = 0;
virtual void requestFileContent(const FilePath& filePath) = 0;
virtual bool requestScroll(const FilePath& filePath, uint lineNumber, Id locationId, bool animated, bool onTop) = 0;
virtual void updateFiles() = 0;
virtual void showContents() = 0;
virtual void onWindowFocus() = 0;
virtual void findScreenMatches(const std::string& query, std::vector<std::pair<QtCodeArea*, Id>>* screenMatches) = 0;
protected:
void ensureWidgetVisibleAnimated(QWidget* parentWidget, QWidget *childWidget, QRectF rect, bool animated, bool onTop);
void ensurePercentVisibleAnimated(double percentA, double percentB, bool animated, bool onTop);
};
#endif // QT_CODE_NAVIGATEABLE_H