mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-05 01:35:45 +08:00
refs #883, overlay messages can have shadow
This commit is contained in:
committed by
Mathew Sutcliffe
parent
1690c560b7
commit
8ca8f51802
@@ -30,6 +30,7 @@
|
|||||||
#include <QSize>
|
#include <QSize>
|
||||||
#include <QStackedWidget>
|
#include <QStackedWidget>
|
||||||
#include <QStyle>
|
#include <QStyle>
|
||||||
|
#include <QGraphicsDropShadowEffect>
|
||||||
#include <QTextEdit>
|
#include <QTextEdit>
|
||||||
#include <QToolButton>
|
#include <QToolButton>
|
||||||
#include <Qt>
|
#include <Qt>
|
||||||
@@ -382,6 +383,15 @@ namespace BlackGui
|
|||||||
return this->m_awaitingConfirmation;
|
return this->m_awaitingConfirmation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void COverlayMessages::addShadow()
|
||||||
|
{
|
||||||
|
QGraphicsDropShadowEffect *shadow = new QGraphicsDropShadowEffect(this);
|
||||||
|
QColor color(Qt::blue);
|
||||||
|
color.setAlpha(96);
|
||||||
|
shadow->setColor(color);
|
||||||
|
this->setGraphicsEffect(shadow);
|
||||||
|
}
|
||||||
|
|
||||||
void COverlayMessages::keyPressEvent(QKeyEvent *event)
|
void COverlayMessages::keyPressEvent(QKeyEvent *event)
|
||||||
{
|
{
|
||||||
if (!this->isVisible()) { QFrame::keyPressEvent(event); }
|
if (!this->isVisible()) { QFrame::keyPressEvent(event); }
|
||||||
|
|||||||
@@ -108,6 +108,9 @@ namespace BlackGui
|
|||||||
//! Is awaiting a conformation
|
//! Is awaiting a conformation
|
||||||
bool hasPendingConfirmation() const;
|
bool hasPendingConfirmation() const;
|
||||||
|
|
||||||
|
//! Add a shadow
|
||||||
|
void addShadow();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
//! Confirmation completed
|
//! Confirmation completed
|
||||||
void confirmationCompleted();
|
void confirmationCompleted();
|
||||||
|
|||||||
@@ -114,8 +114,11 @@ namespace BlackGui
|
|||||||
if (!this->m_overlayMessages)
|
if (!this->m_overlayMessages)
|
||||||
{
|
{
|
||||||
this->m_overlayMessages = new COverlayMessages(inner.width(), inner.height(), this);
|
this->m_overlayMessages = new COverlayMessages(inner.width(), inner.height(), this);
|
||||||
|
this->m_overlayMessages->addShadow();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Q_ASSERT(this->m_overlayMessages);
|
||||||
|
|
||||||
const bool isFrameless = CGuiUtility::isMainWindowFrameless();
|
const bool isFrameless = CGuiUtility::isMainWindowFrameless();
|
||||||
const QPoint middle = this->geometry().center();
|
const QPoint middle = this->geometry().center();
|
||||||
const double yFactor = isFrameless ? 1.25 : 1.5; // 2 is middle in normal window
|
const double yFactor = isFrameless ? 1.25 : 1.5; // 2 is middle in normal window
|
||||||
|
|||||||
Reference in New Issue
Block a user