修改右键菜单适配最新主题

This commit is contained in:
duanshengchao 2025-06-11 09:36:42 +08:00
parent 695c85536d
commit 027149137e
1 changed files with 13 additions and 3 deletions

View File

@ -8,8 +8,9 @@ CustomMenu::CustomMenu(QWidget* parent)
setStyleSheet("QMenu{\n"
" margin:2px;\n"
" padding:2px;\n"
" background-color:white;\n"
" border:1px solid #bbbbbb;\n"
" color:rgb(240, 240, 240);\n"
" background-color:rgb(30, 30, 30);\n"
" border:1px solid rgb(50, 50, 50);\n"
"}\n"
"QMenu:item{\n"
" height:21px;\n"
@ -18,8 +19,17 @@ CustomMenu::CustomMenu(QWidget* parent)
" padding-left:15px;\n"
" padding-right:15px;\n"
"}\n"
"QMenu:item:disabled{\n"
" color:rgb(140, 140, 140);\n"
"}\n"
"QMenu::separator{\n"
" height:1px;\n"
" background:rgb(140, 140, 140);\n"
" margin-left:1px;\n"
" margin-right:1px;\n"
"}\n"
"QMenu:item:selected{\n"
" background-color:rgb(211,241,250);\n"
" background-color: rgba(49, 91, 125, 180);\n"
"}\n");
//设置阴影
QGraphicsDropShadowEffect* shadow = new QGraphicsDropShadowEffect(this);