X-Git-Url: https://git.siccegge.de//index.cgi?p=frida%2Ffrida.git;a=blobdiff_plain;f=src%2Fgui%2Fwidgets%2FBasicBlockWidget.cxx;h=94e07589399da8341d3dee7deb42dd19e714ea8b;hp=689223cbee4ec170a1b037cbad1a9a8733afaa72;hb=78867bb76bf70f3b906d1a1a96edd45a88674c44;hpb=78942350b02f0b23d8152d3f5b06a8d500fedaab diff --git a/src/gui/widgets/BasicBlockWidget.cxx b/src/gui/widgets/BasicBlockWidget.cxx index 689223c..94e0758 100644 --- a/src/gui/widgets/BasicBlockWidget.cxx +++ b/src/gui/widgets/BasicBlockWidget.cxx @@ -1,10 +1,13 @@ #include "BasicBlockWidget.hxx" -BasicBlockWidget::BasicBlockWidget(const QString& name) - : x(-5), y(-20) - , dx(270), dy(45) - , name(name) { +BasicBlockWidget::BasicBlockWidget(const QString& name, BasicBlock * block) + : width(270), height(45) + , name(name), block(block) { + next[0] = NULL; next[1] = NULL; + _widget.move(5, 20); _widget.setGridStyle(Qt::NoPen); + _widget.setShowGrid(false); + _widget.setWordWrap(false); _widget.setMinimumHeight(_widget.rowHeight(0) + 10); _widget.setMaximumHeight(20); _widget.resizeColumnToContents(0); @@ -15,8 +18,8 @@ BasicBlockWidget::BasicBlockWidget(const QString& name) _widget.setColumnCount(3); _widget.verticalHeader()->hide(); _widget.horizontalHeader()->hide(); - dx = _widget.rowHeight(0) + 20; - if (dx < 270) dx = 270; + width = _widget.rowHeight(0) + 20; + if (width < 270) width = 270; } void BasicBlockWidget::addItem(uint8_t* bytes, size_t num_bytes, @@ -50,14 +53,14 @@ void BasicBlockWidget::addItem(uint8_t* bytes, size_t num_bytes, _widget.columnWidth(0) + _widget.columnWidth(1) + _widget.columnWidth(2) + - 2; + 5; _widget.setMinimumWidth(column_width); - _widget.setMinimumHeight(_widget.rowHeight(1) * (_widget.rowCount()) + 2); - _widget.setMaximumHeight(_widget.rowHeight(1) * (_widget.rowCount()) + 2); + _widget.setMinimumHeight((1 + _widget.rowHeight(0)) * (_widget.rowCount()) + 2); + _widget.setMaximumHeight((1 + _widget.rowHeight(0)) * (_widget.rowCount()) + 2); - dy = _widget.rowHeight(0) * (_widget.rowCount()) + 25; - dx = column_width + 10; - if (dx < 270) dx = 270; + height = (1 + _widget.rowHeight(0)) * (_widget.rowCount()) + 25; + width = column_width + 10; + if (width < 270) width = 270; }