forked from qt-creator/qt-creator
Make "X occurrences replaced" indicator less annoying
- make smaller - make transparent for mouse events - reduce opacity Affects a few other indicators too (zoom, -presentationMode). Fixes: QTCREATORBUG-27513 Change-Id: Iec516202e047c5d9aa0a0b8cab42891c9bac5be3 Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io> Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -47,13 +47,14 @@ public:
|
|||||||
FadingIndicatorPrivate(QWidget *parent, FadingIndicator::TextSize size)
|
FadingIndicatorPrivate(QWidget *parent, FadingIndicator::TextSize size)
|
||||||
: QWidget(parent)
|
: QWidget(parent)
|
||||||
{
|
{
|
||||||
|
setAttribute(Qt::WA_TransparentForMouseEvents, true);
|
||||||
m_effect = new QGraphicsOpacityEffect(this);
|
m_effect = new QGraphicsOpacityEffect(this);
|
||||||
setGraphicsEffect(m_effect);
|
setGraphicsEffect(m_effect);
|
||||||
m_effect->setOpacity(.999);
|
m_effect->setOpacity(.999);
|
||||||
|
|
||||||
m_label = new QLabel;
|
m_label = new QLabel;
|
||||||
QFont font = m_label->font();
|
QFont font = m_label->font();
|
||||||
font.setPixelSize(size == FadingIndicator::LargeText ? 45 : 22);
|
font.setPixelSize(size == FadingIndicator::LargeText ? 30 : 18);
|
||||||
m_label->setFont(font);
|
m_label->setFont(font);
|
||||||
QPalette pal = palette();
|
QPalette pal = palette();
|
||||||
pal.setColor(QPalette::WindowText, pal.color(QPalette::Window));
|
pal.setColor(QPalette::WindowText, pal.color(QPalette::Window));
|
||||||
@@ -67,6 +68,7 @@ public:
|
|||||||
{
|
{
|
||||||
m_pixmap = QPixmap();
|
m_pixmap = QPixmap();
|
||||||
m_label->setText(text);
|
m_label->setText(text);
|
||||||
|
m_effect->setOpacity(.6); // because of the fat opaque background color
|
||||||
layout()->setSizeConstraint(QLayout::SetFixedSize);
|
layout()->setSizeConstraint(QLayout::SetFixedSize);
|
||||||
adjustSize();
|
adjustSize();
|
||||||
QWidget *parent = parentWidget();
|
QWidget *parent = parentWidget();
|
||||||
|
Reference in New Issue
Block a user