Simplify `QPainter::drawRoundedRect` usage

After fixing the porting mistake done in 78d983ee, `drawRoundedRect` can
be further simplified to not use any relative sizes anymore.

We can also assume that the code in `dviRenderer::epsf_special` was
supposed to use a constant corner radius and therefore was wrong
initially. By dropping `Qt::RelativeSize` the code might become closer
to its originally intended behavior.

Test Plan:
  - No change in behavior for rounded corners of "Welcome" popup message
    and "No Annotations" message in sidebar.
  - Could not test DVI code path.
remotes/origin/work/aacid/453987
snooxx 💤 4 years ago
parent 1d30b03e39
commit 2ad9e6f0b3
No known key found for this signature in database
GPG Key ID: 12F8AC0CB32EAC40
  1. 2
      generators/dvi/special.cpp
  2. 2
      part/pageviewutils.cpp
  3. 2
      part/side_reviews.cpp

@ -433,7 +433,7 @@ void dviRenderer::epsf_special(const QString &cp)
foreGroundPainter->setBrush(Qt::red); foreGroundPainter->setBrush(Qt::red);
} }
foreGroundPainter->setPen(Qt::black); foreGroundPainter->setPen(Qt::black);
foreGroundPainter->drawRoundedRect(bbox, 2, 2, Qt::RelativeSize); foreGroundPainter->drawRoundedRect(bbox, 2, 2);
QFont f = foreGroundPainter->font(); QFont f = foreGroundPainter->font();
f.setPointSize(8); f.setPointSize(8);
foreGroundPainter->setFont(f); foreGroundPainter->setFont(f);

@ -360,7 +360,7 @@ void PageViewMessage::paintEvent(QPaintEvent * /* e */)
painter.setPen(Qt::black); painter.setPen(Qt::black);
painter.setBrush(palette().color(QPalette::Window)); painter.setBrush(palette().color(QPalette::Window));
painter.translate(0.5, 0.5); painter.translate(0.5, 0.5);
painter.drawRoundedRect(1, 1, width() - 2, height() - 2, 600.0 / width(), 600.0 / height(), Qt::RelativeSize); painter.drawRoundedRect(1, 1, width() - 2, height() - 2, 3, 3);
// draw icon if present // draw icon if present
if (!m_symbol.isNull()) { if (!m_symbol.isNull()) {

@ -72,7 +72,7 @@ protected:
p.setBrush(palette().window()); p.setBrush(palette().window());
p.translate(0.5, 0.5); p.translate(0.5, 0.5);
p.drawRoundedRect(15, 15, w, h, (3 * 200.0) / w, (3 * 200.0) / h, Qt::RelativeSize); p.drawRoundedRect(15, 15, w, h, 3, 3);
p.translate(20, 20); p.translate(20, 20);
document.drawContents(&p); document.drawContents(&p);

Loading…
Cancel
Save