forked from openkylin/qt5-ukui-platformtheme
修改qmenu的阴影圆角
This commit is contained in:
parent
eca73264f6
commit
15cfe366fe
|
@ -37,6 +37,8 @@
|
|||
#include <QApplication>
|
||||
|
||||
#include <QDebug>
|
||||
#include <QMenu>
|
||||
#include "settings/ukui-style-settings.h"
|
||||
|
||||
#define INNERRECT_WIDTH 1
|
||||
|
||||
|
@ -155,9 +157,15 @@ QPixmap ConfigShadowHelper::getShadowPixmap(QColor color, /*ConfigShadowHelper::
|
|||
QPoint currentPos;
|
||||
|
||||
int qAppMaxradius = maxRadius;
|
||||
if(widget && widget->property("maxRadius").isValid()){
|
||||
qAppMaxradius = widget->property("maxRadius").toInt();
|
||||
// qDebug() << "radius...." << qAppMaxradius;
|
||||
if(widget){
|
||||
if(qobject_cast<QMenu *>(widget)){
|
||||
auto settings = UKUIStyleSettings::globalInstance();
|
||||
if(settings && settings->keys().contains("windowRadius"))
|
||||
qAppMaxradius = settings->get("windowRadius").toInt();
|
||||
}
|
||||
else if(widget->property("maxRadius").isValid())
|
||||
qAppMaxradius = widget->property("maxRadius").toInt();
|
||||
// qDebug() << "radius...." << qAppMaxradius;
|
||||
}
|
||||
// move to top left arc start point
|
||||
windowRelativePath.moveTo(borderRadiusTopLeft, 0);
|
||||
|
@ -259,9 +267,15 @@ QPainterPath ConfigShadowHelper::caculateRelativePainterPath(QWidget *widget, qr
|
|||
QPointF currentPos;
|
||||
|
||||
int qAppMaxradius = maxRadius;
|
||||
if(widget && widget->property("maxRadius").isValid()){
|
||||
qAppMaxradius = widget->property("maxRadius").toInt();
|
||||
//qDebug() << "radius...." << qAppMaxradius;
|
||||
if(widget){
|
||||
if(qobject_cast<QMenu *>(widget)){
|
||||
auto settings = UKUIStyleSettings::globalInstance();
|
||||
if(settings && settings->keys().contains("windowRadius"))
|
||||
qAppMaxradius = settings->get("windowRadius").toInt();
|
||||
|
||||
}
|
||||
else if(widget->property("maxRadius").isValid())
|
||||
qAppMaxradius = widget->property("maxRadius").toInt();
|
||||
}
|
||||
|
||||
// move to top left arc start point
|
||||
|
|
Loading…
Reference in New Issue