fix: audit cleanup — themed close button, stale popup dismiss, bitfield clamp, scanner guard, process sort

This commit is contained in:
IChooseYou
2026-03-04 11:15:04 -07:00
committed by IChooseYou
parent 5944dbdc81
commit f4c7e9327d
6 changed files with 21 additions and 6 deletions

View File

@@ -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);
}

View File

@@ -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

View File

@@ -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<ProcessInfo>& 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)

View File

@@ -533,6 +533,7 @@ QVector<ScanResult> ScanEngine::runScan(std::shared_ptr<Provider> prov,
regEnd = qMin(regEnd, req.endAddress);
}
uint64_t regSize = regEnd - regStart;
if (regSize == 0) continue;
if ((uint64_t)patternLen > regSize) {
scannedBytes += regSize;

View File

@@ -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();

View File

@@ -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();
}