summaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorAlexander Taylor <alex@vector35.com>2026-04-29 00:00:26 -0400
committerAlexander Taylor <alex@vector35.com>2026-04-29 22:37:02 -0400
commitbd7de3ec2b41046f865ac3bcfd2fd770a44ce357 (patch)
tree7f80394664efb9e7d59a2bc79fe82679e75af761 /ui
parent40d4ddeadf9110e6188532bc922571ffa9a1b6d9 (diff)
Add horizontal scrolling to Stack View.
Diffstat (limited to 'ui')
-rw-r--r--ui/stackview.h26
1 files changed, 15 insertions, 11 deletions
diff --git a/ui/stackview.h b/ui/stackview.h
index ec3b3d08..7afa1eb6 100644
--- a/ui/stackview.h
+++ b/ui/stackview.h
@@ -80,13 +80,13 @@ class StackViewLine
//! Get the stack frame offset for this line.
int64_t offset() const;
- //! Get the value of the base offset
+ //! Get the value of the base offset.
int64_t baseOffset() const;
- //! Get the name of the base offset
+ //! Get the name of the base offset.
std::string baseName() const;
- //! Set the base offset to a given name and value. Does not affect offset()
+ //! Set the base offset to a given name and value. Does not affect offset().
void setBase(const std::string& baseName, int64_t baseOffset);
//! Get the number of bytes this line represents on the stack.
@@ -219,11 +219,15 @@ class BINARYNINJAUIAPI StackView : public QAbstractScrollArea, public View, publ
//! Find the end of a stack void given a start offset.
int64_t findVoidEnd(int64_t start) const;
- //! Get the beginning of the current selection (min position)
+ //! Get the beginning of the current selection (min position).
void getSelectionRange(size_t& startLine, size_t& startToken, size_t& endLine, size_t& endToken) const;
+ //! Update scrollbar ranges after content, font, or viewport size changes.
+ void updateScrollBars();
+
protected:
void paintEvent(QPaintEvent* event) override;
+ void resizeEvent(QResizeEvent* event) override;
void mousePressEvent(QMouseEvent* event) override;
void mouseMoveEvent(QMouseEvent* event) override;
void mouseReleaseEvent(QMouseEvent* event) override;
@@ -283,28 +287,28 @@ class BINARYNINJAUIAPI StackView : public QAbstractScrollArea, public View, publ
//! Create a new struct at the cursor, spanning until the next stack variable.
void quickCreateStructAtCursor();
- //! Show the dialog to switch which base register is used for offsets
+ //! Show the dialog to switch which base register is used for offsets.
void chooseBaseRegister();
- //! Show the dialog to pick a constant base offset
+ //! Show the dialog to pick a constant base offset.
void chooseBaseOffset();
- //! Set the base offset to a register (or clear on nullopt)
+ //! Set the base offset to a register (or clear on nullopt).
void setBaseRegister(ArchitectureRef arch, std::optional<std::string> regName);
- //! Get the base offset
+ //! Get the base offset.
int64_t getBaseOffset(FunctionRef func);
- //! Set the base offset to a constant (or clear on nullopt)
+ //! Set the base offset to a constant (or clear on nullopt).
void setBaseOffset(FunctionRef func, std::optional<int64_t> offset);
- //! Set whether we show only the vars relevant for the current address
+ //! Set whether we show only the vars relevant for the current address.
void setPositionAware(bool positionAware);
//! Override the default event handler so we can have nice tooltips.
bool event(QEvent* event) override;
- //! Get the current base name/offset using the currently selected base register
+ //! Get the current base name/offset using the currently selected base register.
std::pair<std::string, int64_t> calculateBaseOffset() const;
BinaryViewRef getData() override;