ui: Added shortcuts for navigating to next and previous reference in code view
* Added new class QtCodeNavigator between QtCodeView and QtCodeFileList that handles active ids and navigation * Pass all files as initially collapsed to code view and decide in QtCodeNavigator which ones show content * Rewrote requesting of active snippet display to top down approach * Display other locations focused when active location changes * Show corresponding edges when navigating references
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
class QBoxLayout;
|
||||
class QPushButton;
|
||||
class QtCodeFile;
|
||||
class QtCodeNavigator;
|
||||
class TokenLocationFile;
|
||||
|
||||
class QtCodeSnippet
|
||||
@@ -23,9 +24,10 @@ class QtCodeSnippet
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
static std::shared_ptr<QtCodeSnippet> merged(QtCodeSnippet* a, QtCodeSnippet* b, QtCodeFile* file);
|
||||
static std::shared_ptr<QtCodeSnippet> merged(
|
||||
QtCodeSnippet* a, QtCodeSnippet* b, QtCodeNavigator* navigator, QtCodeFile* file);
|
||||
|
||||
QtCodeSnippet(const CodeSnippetParams& params, QtCodeFile* file);
|
||||
QtCodeSnippet(const CodeSnippetParams& params, QtCodeNavigator* navigator, QtCodeFile* file);
|
||||
virtual ~QtCodeSnippet();
|
||||
|
||||
QtCodeFile* getFile() const;
|
||||
@@ -38,11 +40,9 @@ public:
|
||||
void updateLineNumberAreaWidthForDigits(int digits);
|
||||
void updateContent();
|
||||
|
||||
bool isActive() const;
|
||||
|
||||
void setIsActiveFile(bool isActiveFile);
|
||||
|
||||
uint getFirstActiveLineNumber() const;
|
||||
uint getLineNumberForLocationId(Id locationId) const;
|
||||
QRectF getLineRectForLineNumber(uint lineNumber) const;
|
||||
|
||||
std::string getCode() const;
|
||||
@@ -55,6 +55,9 @@ private:
|
||||
QPushButton* createScopeLine(QBoxLayout* layout);
|
||||
void updateDots();
|
||||
|
||||
QtCodeNavigator* m_navigator;
|
||||
QtCodeFile* m_file;
|
||||
|
||||
Id m_titleId;
|
||||
std::string m_titleString;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user