mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-19 19:36:11 +00:00
Centerize the indicator in the address maps in the Section Widget when seek changed (#956)
This commit is contained in:
parent
b606ece545
commit
58fcd70fd2
@ -267,6 +267,7 @@ void SectionsWidget::updateIndicator(SectionAddrDock *targetDock, QString name,
|
||||
QGraphicsRectItem *indicator = new QGraphicsRectItem(QRectF(0, y, indicatorWidth, indicatorHeight));
|
||||
indicator->setBrush(QBrush(color));
|
||||
targetDock->graphicsScene->addItem(indicator);
|
||||
targetDock->graphicsView->centerOn(indicator);
|
||||
|
||||
targetDock->addTextItem(color, QPoint(targetDock->rectOffset + targetDock->rectWidth, y - indicatorParamPosY), name);
|
||||
targetDock->addTextItem(color, QPoint(0, y - indicatorParamPosY), QString("0x%1").arg(offset, 0, 16));
|
||||
|
@ -91,7 +91,13 @@ class SectionAddrDock : public QDockWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
friend SectionsWidget;
|
||||
|
||||
private slots:
|
||||
void updateDock();
|
||||
void addTextItem(QColor color, QPoint pos, QString string);
|
||||
|
||||
private:
|
||||
enum AddrType { Raw = 0, Virtual };
|
||||
int heightThreshold;
|
||||
int rectOffset;
|
||||
@ -99,17 +105,11 @@ public:
|
||||
QColor indicatorColor;
|
||||
explicit SectionAddrDock(SectionsModel *model, AddrType type, QWidget *parent = nullptr);
|
||||
QGraphicsScene *graphicsScene;
|
||||
QGraphicsView *graphicsView;
|
||||
SectionsProxyModel *proxyModel;
|
||||
AddrType addrType;
|
||||
QHash<QString, int> namePosYMap;
|
||||
QHash<QString, int> nameHeightMap;
|
||||
|
||||
public slots:
|
||||
void updateDock();
|
||||
void addTextItem(QColor color, QPoint pos, QString string);
|
||||
|
||||
private:
|
||||
QGraphicsView *graphicsView;
|
||||
};
|
||||
|
||||
#endif // SECTIONSWIDGET_H
|
||||
|
Loading…
Reference in New Issue
Block a user