mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-02 15:45:21 +00:00
modified paint effects
Change-Id: I0e58eb65b3e997201e7c76532c9c29253171e8e1
This commit is contained in:
parent
1c1228a875
commit
61eb74dd48
@ -67,13 +67,27 @@ void AppItem::paintEvent(QPaintEvent *e)
|
||||
const QRect itemRect = rect();
|
||||
|
||||
// draw background
|
||||
const QRect backgroundRect = itemRect.marginsRemoved(QMargins(3, 3, 3, 3));
|
||||
const QRect backgroundRect = itemRect.marginsRemoved(QMargins(1, 2, 1, 2));
|
||||
if (m_itemEntry->active())
|
||||
painter.fillRect(backgroundRect, Qt::blue);
|
||||
{
|
||||
painter.fillRect(backgroundRect, QColor(70, 100, 200, 120));
|
||||
|
||||
const int activeLineWidth = 3;
|
||||
QRect activeRect = backgroundRect;
|
||||
switch (DockPosition)
|
||||
{
|
||||
case Top: activeRect.setBottom(activeRect.top() + activeLineWidth); break;
|
||||
case Bottom: activeRect.setTop(activeRect.bottom() - activeLineWidth); break;
|
||||
case Left: activeRect.setRight(activeRect.left() + activeLineWidth); break;
|
||||
case Right: activeRect.setLeft(activeRect.right() - activeLineWidth); break;
|
||||
}
|
||||
|
||||
painter.fillRect(activeRect, QColor(47, 168, 247));
|
||||
}
|
||||
else if (!m_titles.isEmpty())
|
||||
painter.fillRect(backgroundRect, Qt::cyan);
|
||||
else
|
||||
painter.fillRect(backgroundRect, Qt::gray);
|
||||
painter.fillRect(backgroundRect, QColor(255, 255, 255, 50));
|
||||
// else
|
||||
// painter.fillRect(backgroundRect, Qt::gray);
|
||||
|
||||
// draw icon
|
||||
painter.drawPixmap(itemRect.center() - m_icon.rect().center(), m_icon);
|
||||
|
@ -22,7 +22,7 @@ MainPanel::MainPanel(QWidget *parent)
|
||||
setObjectName("MainPanel");
|
||||
setStyleSheet("QWidget #MainPanel {"
|
||||
"border:none;"
|
||||
"background-color:green;"
|
||||
"background-color:rgba(0, 0, 0, .6);"
|
||||
"border-radius:5px 5px 5px 5px;"
|
||||
"}");
|
||||
|
||||
|
@ -7,7 +7,7 @@ DatetimePlugin::DatetimePlugin(QObject *parent)
|
||||
{
|
||||
m_timeLabel->setAlignment(Qt::AlignCenter);
|
||||
m_timeLabel->setStyleSheet("color:white;"
|
||||
"background-color:black;"
|
||||
// "background-color:black;"
|
||||
"padding:5px;"
|
||||
"font-size:12px;");
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user