mirror of
https://github.com/rizinorg/cutter.git
synced 2025-02-21 14:16:08 +00:00
Fix hiding opcode info in SidebarWidget
This commit is contained in:
parent
875fad3d67
commit
2a7981a36a
@ -21,8 +21,6 @@ SidebarWidget::SidebarWidget(QWidget *parent, Qt::WindowFlags flags) :
|
|||||||
ui(new Ui::SidebarWidget)
|
ui(new Ui::SidebarWidget)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
this->xrefToTreeWidget_2 = ui->xrefToTreeWidget_2;
|
|
||||||
this->xreFromTreeWidget_2 = ui->xreFromTreeWidget_2;
|
|
||||||
|
|
||||||
// Add margin to function name line edit
|
// Add margin to function name line edit
|
||||||
ui->fcnNameEdit->setTextMargins(5, 0, 0, 0);
|
ui->fcnNameEdit->setTextMargins(5, 0, 0, 0);
|
||||||
@ -63,9 +61,17 @@ void SidebarWidget::refresh(RVA addr)
|
|||||||
fillOffsetInfo(RAddressString(addr));
|
fillOffsetInfo(RAddressString(addr));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
void SidebarWidget::on_xrefFromTreeWidget_itemDoubleClicked(QTreeWidgetItem *item, int /*column*/)
|
||||||
* Context menu functions
|
{
|
||||||
*/
|
XrefDescription xref = item->data(0, Qt::UserRole).value<XrefDescription>();
|
||||||
|
Core()->seek(xref.to);
|
||||||
|
}
|
||||||
|
|
||||||
|
void SidebarWidget::on_xrefToTreeWidget_itemDoubleClicked(QTreeWidgetItem *item, int /*column*/)
|
||||||
|
{
|
||||||
|
XrefDescription xref = item->data(0, Qt::UserRole).value<XrefDescription>();
|
||||||
|
Core()->seek(xref.from);
|
||||||
|
}
|
||||||
|
|
||||||
void SidebarWidget::on_offsetToolButton_clicked()
|
void SidebarWidget::on_offsetToolButton_clicked()
|
||||||
{
|
{
|
||||||
@ -81,43 +87,45 @@ void SidebarWidget::on_offsetToolButton_clicked()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SidebarWidget::on_xreFromTreeWidget_2_itemDoubleClicked(QTreeWidgetItem *item, int /*column*/)
|
void SidebarWidget::on_opcodeDescToolButton_clicked()
|
||||||
{
|
{
|
||||||
XrefDescription xref = item->data(0, Qt::UserRole).value<XrefDescription>();
|
if (ui->opcodeDescToolButton->isChecked())
|
||||||
Core()->seek(xref.to);
|
|
||||||
}
|
|
||||||
|
|
||||||
void SidebarWidget::on_xrefToTreeWidget_2_itemDoubleClicked(QTreeWidgetItem *item, int /*column*/)
|
|
||||||
{
|
|
||||||
XrefDescription xref = item->data(0, Qt::UserRole).value<XrefDescription>();
|
|
||||||
Core()->seek(xref.from);
|
|
||||||
}
|
|
||||||
|
|
||||||
void SidebarWidget::on_xrefFromToolButton_2_clicked()
|
|
||||||
{
|
|
||||||
if (ui->xrefFromToolButton_2->isChecked())
|
|
||||||
{
|
{
|
||||||
ui->xreFromTreeWidget_2->hide();
|
ui->opcodeDescText->hide();
|
||||||
ui->xrefFromToolButton_2->setArrowType(Qt::RightArrow);
|
ui->opcodeDescToolButton->setArrowType(Qt::RightArrow);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ui->xreFromTreeWidget_2->show();
|
ui->opcodeDescText->show();
|
||||||
ui->xrefFromToolButton_2->setArrowType(Qt::DownArrow);
|
ui->opcodeDescToolButton->setArrowType(Qt::DownArrow);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SidebarWidget::on_xrefToToolButton_2_clicked()
|
void SidebarWidget::on_xrefFromToolButton_clicked()
|
||||||
{
|
{
|
||||||
if (ui->xrefToToolButton_2->isChecked())
|
if (ui->xrefFromToolButton->isChecked())
|
||||||
{
|
{
|
||||||
ui->xrefToTreeWidget_2->hide();
|
ui->xrefFromTreeWidget->hide();
|
||||||
ui->xrefToToolButton_2->setArrowType(Qt::RightArrow);
|
ui->xrefFromToolButton->setArrowType(Qt::RightArrow);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ui->xrefToTreeWidget_2->show();
|
ui->xrefFromTreeWidget->show();
|
||||||
ui->xrefToToolButton_2->setArrowType(Qt::DownArrow);
|
ui->xrefFromToolButton->setArrowType(Qt::DownArrow);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void SidebarWidget::on_xrefToToolButton_clicked()
|
||||||
|
{
|
||||||
|
if (ui->xrefToToolButton->isChecked())
|
||||||
|
{
|
||||||
|
ui->xrefToTreeWidget->hide();
|
||||||
|
ui->xrefToToolButton->setArrowType(Qt::RightArrow);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ui->xrefToTreeWidget->show();
|
||||||
|
ui->xrefToToolButton->setArrowType(Qt::DownArrow);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -155,7 +163,7 @@ void SidebarWidget::fill_refs(QList<XrefDescription> refs, QList<XrefDescription
|
|||||||
tempConfig.set("scr.html", false)
|
tempConfig.set("scr.html", false)
|
||||||
.set("scr.color", false);
|
.set("scr.color", false);
|
||||||
|
|
||||||
this->xreFromTreeWidget_2->clear();
|
ui->xrefFromTreeWidget->clear();
|
||||||
for (int i = 0; i < refs.size(); ++i)
|
for (int i = 0; i < refs.size(); ++i)
|
||||||
{
|
{
|
||||||
XrefDescription xref = refs[i];
|
XrefDescription xref = refs[i];
|
||||||
@ -166,16 +174,16 @@ void SidebarWidget::fill_refs(QList<XrefDescription> refs, QList<XrefDescription
|
|||||||
QString tooltip = Core()->cmd("pdi 10 @ " + QString::number(xref.to)).trimmed();
|
QString tooltip = Core()->cmd("pdi 10 @ " + QString::number(xref.to)).trimmed();
|
||||||
tempItem->setToolTip(0, tooltip);
|
tempItem->setToolTip(0, tooltip);
|
||||||
tempItem->setToolTip(1, tooltip);
|
tempItem->setToolTip(1, tooltip);
|
||||||
this->xreFromTreeWidget_2->insertTopLevelItem(0, tempItem);
|
ui->xrefFromTreeWidget->insertTopLevelItem(0, tempItem);
|
||||||
}
|
}
|
||||||
// Adjust columns to content
|
// Adjust columns to content
|
||||||
int count = this->xreFromTreeWidget_2->columnCount();
|
int count = ui->xrefFromTreeWidget->columnCount();
|
||||||
for (int i = 0; i != count; ++i)
|
for (int i = 0; i != count; ++i)
|
||||||
{
|
{
|
||||||
this->xreFromTreeWidget_2->resizeColumnToContents(i);
|
ui->xrefFromTreeWidget->resizeColumnToContents(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
this->xrefToTreeWidget_2->clear();
|
ui->xrefToTreeWidget->clear();
|
||||||
for (int i = 0; i < xrefs.size(); ++i)
|
for (int i = 0; i < xrefs.size(); ++i)
|
||||||
{
|
{
|
||||||
XrefDescription xref = xrefs[i];
|
XrefDescription xref = xrefs[i];
|
||||||
@ -190,13 +198,13 @@ void SidebarWidget::fill_refs(QList<XrefDescription> refs, QList<XrefDescription
|
|||||||
//tempItem->setToolTip(0, this->core->cmd("pdi 10 @ " + tooltip).trimmed());
|
//tempItem->setToolTip(0, this->core->cmd("pdi 10 @ " + tooltip).trimmed());
|
||||||
//tempItem->setToolTip(1, this->core->cmd("pdi 10 @ " + tooltip).trimmed());
|
//tempItem->setToolTip(1, this->core->cmd("pdi 10 @ " + tooltip).trimmed());
|
||||||
|
|
||||||
this->xrefToTreeWidget_2->insertTopLevelItem(0, tempItem);
|
ui->xrefToTreeWidget->insertTopLevelItem(0, tempItem);
|
||||||
}
|
}
|
||||||
// Adjust columns to content
|
// Adjust columns to content
|
||||||
int count2 = this->xrefToTreeWidget_2->columnCount();
|
int count2 = ui->xrefToTreeWidget->columnCount();
|
||||||
for (int i = 0; i != count2; ++i)
|
for (int i = 0; i != count2; ++i)
|
||||||
{
|
{
|
||||||
this->xrefToTreeWidget_2->resizeColumnToContents(i);
|
ui->xrefToTreeWidget->resizeColumnToContents(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -254,6 +262,6 @@ void SidebarWidget::setFcnName(RVA addr)
|
|||||||
|
|
||||||
void SidebarWidget::setScrollMode()
|
void SidebarWidget::setScrollMode()
|
||||||
{
|
{
|
||||||
qhelpers::setVerticalScrollMode(ui->xreFromTreeWidget_2);
|
qhelpers::setVerticalScrollMode(ui->xrefFromTreeWidget);
|
||||||
qhelpers::setVerticalScrollMode(ui->xrefToTreeWidget_2);
|
qhelpers::setVerticalScrollMode(ui->xrefToTreeWidget);
|
||||||
}
|
}
|
||||||
|
@ -33,9 +33,6 @@ public:
|
|||||||
explicit SidebarWidget(QWidget *parent = nullptr, Qt::WindowFlags flags = 0);
|
explicit SidebarWidget(QWidget *parent = nullptr, Qt::WindowFlags flags = 0);
|
||||||
~SidebarWidget();
|
~SidebarWidget();
|
||||||
|
|
||||||
QTreeWidget *xrefToTreeWidget_2;
|
|
||||||
QTreeWidget *xreFromTreeWidget_2;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::unique_ptr<Ui::SidebarWidget> ui;
|
std::unique_ptr<Ui::SidebarWidget> ui;
|
||||||
|
|
||||||
@ -51,11 +48,13 @@ private slots:
|
|||||||
|
|
||||||
void refresh(RVA addr = RVA_INVALID);
|
void refresh(RVA addr = RVA_INVALID);
|
||||||
|
|
||||||
void on_xreFromTreeWidget_2_itemDoubleClicked(QTreeWidgetItem *item, int column);
|
void on_xrefFromTreeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column);
|
||||||
void on_xrefToTreeWidget_2_itemDoubleClicked(QTreeWidgetItem *item, int column);
|
void on_xrefToTreeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column);
|
||||||
void on_xrefFromToolButton_2_clicked();
|
|
||||||
void on_xrefToToolButton_2_clicked();
|
|
||||||
void on_offsetToolButton_clicked();
|
void on_offsetToolButton_clicked();
|
||||||
|
void on_opcodeDescToolButton_clicked();
|
||||||
|
void on_xrefFromToolButton_clicked();
|
||||||
|
void on_xrefToToolButton_clicked();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // SIDEBARWIDGET_H
|
#endif // SIDEBARWIDGET_H
|
||||||
|
@ -253,7 +253,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QToolButton" name="opcodeDescButton">
|
<widget class="QToolButton" name="opcodeDescToolButton">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>...</string>
|
<string>...</string>
|
||||||
</property>
|
</property>
|
||||||
@ -326,7 +326,7 @@
|
|||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QToolButton" name="xrefToToolButton_2">
|
<widget class="QToolButton" name="xrefToToolButton">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>...</string>
|
<string>...</string>
|
||||||
</property>
|
</property>
|
||||||
@ -348,7 +348,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="xrefToLabel_2">
|
<widget class="QLabel" name="xrefToLabel">
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
<weight>75</weight>
|
<weight>75</weight>
|
||||||
@ -363,7 +363,7 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QTreeWidget" name="xrefToTreeWidget_2">
|
<widget class="QTreeWidget" name="xrefToTreeWidget">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
|
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
@ -440,7 +440,7 @@ QToolTip {
|
|||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QToolButton" name="xrefFromToolButton_2">
|
<widget class="QToolButton" name="xrefFromToolButton">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
@ -462,7 +462,7 @@ QToolTip {
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="xrefFromLabel_2">
|
<widget class="QLabel" name="xrefFromLabel">
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
<weight>75</weight>
|
<weight>75</weight>
|
||||||
@ -477,7 +477,7 @@ QToolTip {
|
|||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QTreeWidget" name="xreFromTreeWidget_2">
|
<widget class="QTreeWidget" name="xrefFromTreeWidget">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
|
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
|
Loading…
Reference in New Issue
Block a user