diff options
| author | Rusty Wagner <rusty.wagner@gmail.com> | 2021-07-29 21:17:38 -0400 |
|---|---|---|
| committer | Rusty Wagner <rusty.wagner@gmail.com> | 2021-07-29 21:18:15 -0400 |
| commit | 4c1e6c0348fd0d275c077b93db06fa7d82c1941f (patch) | |
| tree | 3d80615afdff4f989ebf56975ad9db7f395c1b9d /ui | |
| parent | 1a4a0f56dc17e68e5743fa3a550b46992ec461e1 (diff) | |
Fix some sidebar focus issues and add a toggle command
Diffstat (limited to 'ui')
| -rw-r--r-- | ui/sidebar.h | 4 | ||||
| -rw-r--r-- | ui/stringsview.h | 4 | ||||
| -rw-r--r-- | ui/symbolsview.h | 1 | ||||
| -rw-r--r-- | ui/typeview.h | 22 |
4 files changed, 29 insertions, 2 deletions
diff --git a/ui/sidebar.h b/ui/sidebar.h index 0c3bc2c7..b2ae9261 100644 --- a/ui/sidebar.h +++ b/ui/sidebar.h @@ -176,6 +176,8 @@ public: void updateViewLocation(View* view, const ViewLocation& viewLocation); void viewChanged(); + void toggleSidebar(); + Q_SIGNALS: void showContents(); void hideContents(); @@ -215,6 +217,8 @@ public: void updateTheme(); void updateFonts(); + void toggleSidebar(); + static void addSidebarWidgetType(SidebarWidgetType* type); static SidebarWidgetType* typeFromName(const QString& name); static const std::vector<SidebarWidgetType*>& contentTypes() { return m_contentTypes; } diff --git a/ui/stringsview.h b/ui/stringsview.h index 9dc71fed..e9d435d4 100644 --- a/ui/stringsview.h +++ b/ui/stringsview.h @@ -157,9 +157,11 @@ class BINARYNINJAUIAPI StringsViewSidebarWidget: public SidebarWidget Q_OBJECT QWidget* m_header; + StringsContainer* m_container; public: StringsViewSidebarWidget(BinaryViewRef data, ViewFrame* frame); - virtual QWidget* headerWidget() { return m_header; } + virtual QWidget* headerWidget() override { return m_header; } + virtual void focus() override; }; diff --git a/ui/symbolsview.h b/ui/symbolsview.h index 26a0a7d0..0a948d81 100644 --- a/ui/symbolsview.h +++ b/ui/symbolsview.h @@ -49,6 +49,7 @@ public: void toggleLocalDataVars() { m_funcList->toggleLocalDataVars(); } virtual QWidget* headerWidget() override { return m_header; } + virtual void focus() override; protected: virtual void contextMenuEvent(QContextMenuEvent* event) override; diff --git a/ui/typeview.h b/ui/typeview.h index 5d0a59fc..5c29bdd7 100644 --- a/ui/typeview.h +++ b/ui/typeview.h @@ -239,6 +239,8 @@ public: void showContextMenu(Menu* source = nullptr); + void focusAtTopOfView(); + protected: virtual void resizeEvent(QResizeEvent* event) override; virtual void paintEvent(QPaintEvent* event) override; @@ -299,13 +301,28 @@ public: }; +class BINARYNINJAUIAPI TypeFilterEdit: public QLineEdit +{ + Q_OBJECT + +public: + TypeFilterEdit(QWidget* parent); + +protected: + virtual void keyPressEvent(QKeyEvent* event) override; + +Q_SIGNALS: + void focusView(); +}; + + class BINARYNINJAUIAPI TypeFilter: public QWidget { Q_OBJECT TypesContainer* m_container; ClickableIcon* m_showSystemTypes; - QLineEdit* m_textFilter; + TypeFilterEdit* m_textFilter; bool MatchesAutoFilter(BinaryViewRef data, const BinaryNinja::QualifiedName& name); bool MatchesTextFilter(const std::vector<TypeDefinitionLine>& lines); @@ -313,6 +330,9 @@ class BINARYNINJAUIAPI TypeFilter: public QWidget Q_SIGNALS: void filterChanged(); +private Q_SLOTS: + void focusView(); + public: TypeFilter(TypesContainer* container = nullptr); void setContainer(TypesContainer* container) { m_container = container; } |
