X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fviews%2Fdecoder_output%2FQHexView.cpp;h=ccd50f87bccc1291195d2b515a4ee70418e422f0;hb=a767229eb18acbd70af38bb660c8ebd1bbd82e73;hp=0104de1590930f63f3773cd31ca5ab11e63c02ec;hpb=ee4ba097ff5d818ccdf8b3dd417692e39b5b293d;p=pulseview.git diff --git a/pv/views/decoder_output/QHexView.cpp b/pv/views/decoder_output/QHexView.cpp index 0104de15..ccd50f87 100644 --- a/pv/views/decoder_output/QHexView.cpp +++ b/pv/views/decoder_output/QHexView.cpp @@ -142,7 +142,7 @@ pair QHexView::get_selection() const // Nothing is currently selected start = 0; end = data_size_; - } else + } if (end < data_size_) end++; return std::make_pair(start, end); @@ -302,15 +302,17 @@ void QHexView::paintEvent(QPaintEvent *event) lastLineIdx++; } - // Fill address area background - painter.fillRect(QRect(posAddr_, event->rect().top(), - posHex_ - (GAP_ADR_HEX / 2), height()), palette().color(QPalette::Window)); - // Paint divider line between hex and ASCII areas int line_x = posAscii_ - (GAP_HEX_ASCII / 2); painter.setPen(palette().color(QPalette::Midlight)); painter.drawLine(line_x, event->rect().top(), line_x, height()); + // Fill address area background + painter.fillRect(QRect(posAddr_, event->rect().top(), + posHex_ - (GAP_ADR_HEX / 2), height()), palette().color(QPalette::Window)); + painter.fillRect(QRect(posAddr_, event->rect().top(), + posAscii_ - (GAP_HEX_ASCII / 2), charHeight_ + 2), palette().color(QPalette::Window)); + // Paint address area painter.setPen(palette().color(QPalette::ButtonText)); @@ -326,7 +328,7 @@ void QHexView::paintEvent(QPaintEvent *event) painter.setPen(palette().color(QPalette::ButtonText)); for (int offset = 0; offset <= 0xF; offset++) painter.drawText(posHex_ + (1 + offset * 3) * charWidth_, - charHeight_, QString::number(offset, 16).toUpper()); + charHeight_ - 3, QString::number(offset, 16).toUpper()); // Paint hex values QBrush regular = palette().buttonText();