mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-21 04:16:12 +00:00
Fix a bug that caused startup to hang
This commit is contained in:
parent
691d567c61
commit
6c3d1d2582
@ -31,7 +31,12 @@ DisassemblyWidget::DisassemblyWidget(QWidget *parent)
|
||||
|
||||
setAllowedAreas(Qt::AllDockWidgetAreas);
|
||||
setObjectName("DisassemblyWidget");
|
||||
colorsUpdatedSlot();
|
||||
|
||||
setupFonts();
|
||||
setupColors();
|
||||
|
||||
maxLines = 0;
|
||||
updateMaxLines();
|
||||
|
||||
mDisasTextEdit->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
mDisasTextEdit->setFont(Config()->getFont());
|
||||
@ -52,9 +57,6 @@ DisassemblyWidget::DisassemblyWidget(QWidget *parent)
|
||||
connect(mDisasTextEdit, SIGNAL(customContextMenuRequested(const QPoint &)),
|
||||
this, SLOT(showDisasContextMenu(const QPoint &)));
|
||||
|
||||
maxLines = 0;
|
||||
updateMaxLines();
|
||||
|
||||
|
||||
// Space to switch to graph
|
||||
QShortcut *graphShortcut = new QShortcut(QKeySequence(Qt::Key_Space), this);
|
||||
@ -453,7 +455,7 @@ void DisassemblyWidget::raisePrioritizedMemoryWidget(CutterCore::MemoryWidgetTyp
|
||||
|
||||
void DisassemblyWidget::fontsUpdatedSlot()
|
||||
{
|
||||
mDisasTextEdit->setFont(Config()->getFont());
|
||||
setupFonts();
|
||||
|
||||
if (!updateMaxLines()) // updateMaxLines() returns true if it already refreshed.
|
||||
{
|
||||
@ -462,13 +464,24 @@ void DisassemblyWidget::fontsUpdatedSlot()
|
||||
}
|
||||
|
||||
void DisassemblyWidget::colorsUpdatedSlot()
|
||||
{
|
||||
setupColors();
|
||||
refreshDisasm();
|
||||
}
|
||||
|
||||
void DisassemblyWidget::setupFonts()
|
||||
{
|
||||
mDisasTextEdit->setFont(Config()->getFont());
|
||||
}
|
||||
|
||||
void DisassemblyWidget::setupColors()
|
||||
{
|
||||
mDisasTextEdit->setStyleSheet(QString("QPlainTextEdit { background-color: %1; color: %2; }")
|
||||
.arg(ConfigColor("gui.background").name())
|
||||
.arg(ConfigColor("btext").name()));
|
||||
refreshDisasm();
|
||||
}
|
||||
|
||||
|
||||
DisassemblyScrollArea::DisassemblyScrollArea(QWidget *parent) : QAbstractScrollArea(parent)
|
||||
{
|
||||
}
|
||||
|
@ -51,6 +51,9 @@ private:
|
||||
RVA readDisassemblyOffset(QTextCursor tc);
|
||||
bool eventFilter(QObject *obj, QEvent *event);
|
||||
|
||||
void setupFonts();
|
||||
void setupColors();
|
||||
|
||||
void updateCursorPosition();
|
||||
|
||||
void connectCursorPositionChanged(bool disconnect);
|
||||
|
Loading…
Reference in New Issue
Block a user