diff --git a/src/core.h b/src/core.h index af50a16..5c3d106 100644 --- a/src/core.h +++ b/src/core.h @@ -303,7 +303,7 @@ struct Node { QJsonObject bm = v.toObject(); BitfieldMember m; m.name = bm["name"].toString(); - m.bitOffset = (uint8_t)bm["bitOffset"].toInt(0); + m.bitOffset = (uint8_t)qBound(0, bm["bitOffset"].toInt(0), 255); m.bitWidth = (uint8_t)qBound(1, bm["bitWidth"].toInt(1), 64); n.bitfieldMembers.append(m); } diff --git a/src/editor.cpp b/src/editor.cpp index 405cf6b..2988a40 100644 --- a/src/editor.cpp +++ b/src/editor.cpp @@ -966,12 +966,20 @@ void RcxEditor::applyDocument(const ComposeResult& result) { // Reset hint line - applySelectionOverlay will repaint indicators m_hintLine = -1; - // Restore hover state + // Restore hover state — but clear if the node was deleted m_hoveredNodeId = savedHoverId; m_hoveredLine = savedHoverLine; m_hoverInside = savedHoverInside; m_applyingDocument = false; + if (m_hoveredNodeId != 0 && !m_nodeLineIndex.contains(m_hoveredNodeId)) { + m_hoveredNodeId = 0; + m_hoveredLine = -1; + dismissHistoryPopup(); + if (m_disasmPopup) m_disasmPopup->hide(); + if (m_structPreviewPopup) m_structPreviewPopup->hide(); + } + // Re-apply hover markers (setText() clears all Scintilla markers). // Reset m_prevHoveredNodeId so the incremental logic re-adds markers. // applyHoverCursor() is NOT called here — it evaluates hitTest() against diff --git a/src/processpicker.cpp b/src/processpicker.cpp index 9aba24a..30946bf 100644 --- a/src/processpicker.cpp +++ b/src/processpicker.cpp @@ -55,6 +55,7 @@ void ProcessPicker::initUi() ui->processTable->setColumnWidth(0, 80); // PID column ui->processTable->setColumnWidth(1, 200); // Name column ui->processTable->horizontalHeader()->setStretchLastSection(true); + ui->processTable->setSortingEnabled(true); ui->processTable->setWordWrap(false); ui->processTable->setTextElideMode(Qt::ElideLeft); ui->processTable->setShowGrid(false); @@ -329,6 +330,9 @@ void ProcessPicker::populateTable(const QList& processes) pathItem->setToolTip(proc.path); // Show full path on hover ui->processTable->setItem(i, 2, pathItem); } + + // Default sort: highest PID first (most recently launched processes on top) + ui->processTable->sortItems(0, Qt::DescendingOrder); } void ProcessPicker::filterProcesses(const QString& text) diff --git a/src/scanner.cpp b/src/scanner.cpp index 7ceb25c..950e0c3 100644 --- a/src/scanner.cpp +++ b/src/scanner.cpp @@ -533,6 +533,7 @@ QVector ScanEngine::runScan(std::shared_ptr prov, regEnd = qMin(regEnd, req.endAddress); } uint64_t regSize = regEnd - regStart; + if (regSize == 0) continue; if ((uint64_t)patternLen > regSize) { scannedBytes += regSize; diff --git a/src/themes/themeeditor.cpp b/src/themes/themeeditor.cpp index 1c33338..396a7d2 100644 --- a/src/themes/themeeditor.cpp +++ b/src/themes/themeeditor.cpp @@ -64,7 +64,8 @@ ThemeEditor::ThemeEditor(int themeIndex, QWidget* parent) // ── File info ── m_fileInfoLabel = new QLabel; - m_fileInfoLabel->setStyleSheet(QStringLiteral("color: #666; font-size: 10px; padding: 0 0 4px 0;")); + m_fileInfoLabel->setStyleSheet(QStringLiteral("color: %1; font-size: 10px; padding: 0 0 4px 0;") + .arg(tm.current().textDim.name())); QString path = tm.themeFilePath(themeIndex); m_fileInfoLabel->setText(path.isEmpty() ? QStringLiteral("Built-in theme (edits save as user copy)") @@ -109,7 +110,8 @@ ThemeEditor::ThemeEditor(int themeIndex, QWidget* parent) auto* hexLbl = new QLabel; hexLbl->setFixedWidth(60); - hexLbl->setStyleSheet(QStringLiteral("color: #aaa; font-size: 10px;")); + hexLbl->setStyleSheet(QStringLiteral("color: %1; font-size: 10px;") + .arg(tm.current().textMuted.name())); row->addWidget(hexLbl); row->addStretch(); diff --git a/src/titlebar.cpp b/src/titlebar.cpp index 3fe4dfb..edd3b93 100644 --- a/src/titlebar.cpp +++ b/src/titlebar.cpp @@ -95,10 +95,10 @@ void TitleBarWidget::applyTheme(const Theme& theme) { m_btnMin->setStyleSheet(btnStyle); m_btnMax->setStyleSheet(btnStyle); - // Close button: red hover + // Close button: themed red hover m_btnClose->setStyleSheet(QStringLiteral( "QToolButton { background: transparent; border: none; }" - "QToolButton:hover { background: #c42b1c; }")); + "QToolButton:hover { background: %1; }").arg(theme.indHeatHot.name())); update(); }