修改控制面板有线/无线网络项悬浮点击背景色
This commit is contained in:
parent
5814900fcf
commit
17659f4b13
|
@ -47,7 +47,7 @@ AddNetBtn::AddNetBtn(bool isWlan, QWidget *parent) : QPushButton(parent)
|
||||||
} else {
|
} else {
|
||||||
textLabel->setText(tr("Add WiredNetork"));
|
textLabel->setText(tr("Add WiredNetork"));
|
||||||
QIcon mAddIcon = QIcon::fromTheme("list-add-symbolic");
|
QIcon mAddIcon = QIcon::fromTheme("list-add-symbolic");
|
||||||
iconLabel->setPixmap(mAddIcon.pixmap(mAddIcon.actualSize(QSize(24, 24))));
|
iconLabel->setPixmap(mAddIcon.pixmap(mAddIcon.actualSize(QSize(16, 16))));
|
||||||
iconLabel->setProperty("useIconHighlightEffect", 0x2);
|
iconLabel->setProperty("useIconHighlightEffect", 0x2);
|
||||||
// iconLabel->setProperty("iconHighlightEffectMode", 1);
|
// iconLabel->setProperty("iconHighlightEffectMode", 1);
|
||||||
|
|
||||||
|
@ -79,17 +79,17 @@ void AddNetBtn::leaveEvent(QEvent *event){
|
||||||
|
|
||||||
void AddNetBtn::paintEvent(QPaintEvent *event)
|
void AddNetBtn::paintEvent(QPaintEvent *event)
|
||||||
{
|
{
|
||||||
QPalette pal = qApp->palette();
|
// QPalette pal = qApp->palette();
|
||||||
|
|
||||||
QPainter painter(this);
|
QPainter painter(this);
|
||||||
painter.setRenderHint(QPainter:: Antialiasing, true); //设置渲染,启动反锯齿
|
painter.setRenderHint(QPainter:: Antialiasing, true); //设置渲染,启动反锯齿
|
||||||
painter.setPen(Qt::NoPen);
|
painter.setPen(Qt::NoPen);
|
||||||
painter.setBrush(this->palette().base().color());
|
painter.setBrush(this->palette().base().color());
|
||||||
|
|
||||||
QColor color = pal.color(QPalette::Button);
|
// QColor color = pal.color(QPalette::Button);
|
||||||
color.setAlphaF(0.5);
|
// color.setAlphaF(0.5);
|
||||||
pal.setColor(QPalette::Button, color);
|
// pal.setColor(QPalette::Button, color);
|
||||||
this->setPalette(pal);
|
// this->setPalette(pal);
|
||||||
|
|
||||||
QRect rect = this->rect();
|
QRect rect = this->rect();
|
||||||
QPainterPath path;
|
QPainterPath path;
|
||||||
|
|
|
@ -89,17 +89,17 @@ void LanItem::stopLoading(){
|
||||||
|
|
||||||
void LanItem::paintEvent(QPaintEvent *event)
|
void LanItem::paintEvent(QPaintEvent *event)
|
||||||
{
|
{
|
||||||
QPalette pal = qApp->palette();
|
// QPalette pal = qApp->palette();
|
||||||
|
|
||||||
QPainter painter(this);
|
QPainter painter(this);
|
||||||
painter.setRenderHint(QPainter:: Antialiasing, true); //设置渲染,启动反锯齿
|
painter.setRenderHint(QPainter:: Antialiasing, true); //设置渲染,启动反锯齿
|
||||||
painter.setPen(Qt::NoPen);
|
painter.setPen(Qt::NoPen);
|
||||||
painter.setBrush(this->palette().base().color());
|
painter.setBrush(this->palette().base().color());
|
||||||
|
|
||||||
QColor color = pal.color(QPalette::Button);
|
// QColor color = pal.color(QPalette::Button);
|
||||||
color.setAlphaF(0.5);
|
// color.setAlphaF(0.5);
|
||||||
pal.setColor(QPalette::Button, color);
|
// pal.setColor(QPalette::Button, color);
|
||||||
this->setPalette(pal);
|
// this->setPalette(pal);
|
||||||
|
|
||||||
QRect rect = this->rect();
|
QRect rect = this->rect();
|
||||||
|
|
||||||
|
|
|
@ -91,17 +91,17 @@ void WlanItem::stopLoading(){
|
||||||
|
|
||||||
void WlanItem::paintEvent(QPaintEvent *event)
|
void WlanItem::paintEvent(QPaintEvent *event)
|
||||||
{
|
{
|
||||||
QPalette pal = qApp->palette();
|
// QPalette pal = qApp->palette();
|
||||||
|
|
||||||
QPainter painter(this);
|
QPainter painter(this);
|
||||||
painter.setRenderHint(QPainter:: Antialiasing, true); //设置渲染,启动反锯齿
|
painter.setRenderHint(QPainter:: Antialiasing, true); //设置渲染,启动反锯齿
|
||||||
painter.setPen(Qt::NoPen);
|
painter.setPen(Qt::NoPen);
|
||||||
painter.setBrush(this->palette().base().color());
|
painter.setBrush(this->palette().base().color());
|
||||||
|
|
||||||
QColor color = pal.color(QPalette::Button);
|
// QColor color = pal.color(QPalette::Button);
|
||||||
color.setAlphaF(0.5);
|
// color.setAlphaF(0.5);
|
||||||
pal.setColor(QPalette::Button, color);
|
// pal.setColor(QPalette::Button, color);
|
||||||
this->setPalette(pal);
|
// this->setPalette(pal);
|
||||||
|
|
||||||
QRect rect = this->rect();
|
QRect rect = this->rect();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue