FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Remove gradient from HUD drop shadow. · jackcoolpython/ghostwriter@90f66fe · GitHub

Repository navigation

Commit 90f66fe

Browse files
committed
Remove gradient from HUD drop shadow.
1 parent 9f47f37 commit 90f66fe

1 file changed

Lines changed: 3 additions & 10 deletions

File tree

‎src/HudWindow.cpp‎

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -353,13 +353,6 @@ void HudWindow::resizeEvent(QResizeEvent* event)
353353
// resize. We do this because applying a blur effect to the drop
354354
// shadow is computationally expensive.
355355

356-
// First, draw the shadow, using a pleasant gradient.
357-
QLinearGradient shadowGradient;
358-
shadowGradient.setStart(rect().width() / 2, 0.0);
359-
shadowGradient.setFinalStop(rect().width() / 2, rect().height());
360-
shadowGradient.setColorAt(0.0, QColor(0, 0, 0, 20));
361-
shadowGradient.setColorAt(1.0, QColor(0, 0, 0, 200));
362-
363356
QImage unblurredImage
364357
(
365358
rect().width(),
@@ -371,8 +364,8 @@ void HudWindow::resizeEvent(QResizeEvent* event)
371364
QPainter painter(&unblurredImage);
372365
painter.setRenderHint(QPainter::Antialiasing);
373366
painter.setPen(QPen(Qt::NoPen));
374-
painter.setBrush(QBrush(shadowGradient));
375-
painter.drawRoundedRect(rect().adjusted(10, 10, -10, -8), 5, 5);
367+
painter.setBrush(QBrush(QColor(0, 0, 0, 200)));
368+
painter.drawRoundedRect(rect().adjusted(10, 12, -10, -8), 5, 5);
376369
painter.end();
377370

378371
// Now we need to blur the shadow onto its final destination image,
@@ -390,7 +383,7 @@ void HudWindow::resizeEvent(QResizeEvent* event)
390383
painter.setRenderHint(QPainter::Antialiasing);
391384

392385
// Note that the blur only applies to the alpha channel.
393-
qt_blurImage(&painter, unblurredImage, 20, true, true);
386+
qt_blurImage(&painter, unblurredImage, 18, true, true);
394387
painter.end();
395388
}
396389
}

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL