@@ -66,6 +66,10 @@ void ColorButton::paintEvent(QPaintEvent *)
6666 }
6767}
6868
69+ static bool supportWindowEffect ()
70+ {
71+ return DWindowManagerHelper::instance ()->hasComposite () && DWindowManagerHelper::instance ()->hasBlurWindow ();
72+ }
6973DPrintPickColorWidget::DPrintPickColorWidget (QWidget *parent)
7074 : DWidget(parent)
7175 , pinterface(nullptr )
@@ -115,7 +119,7 @@ void DPrintPickColorWidget::initUI()
115119 pickColorBtn->setFixedSize (55 , 36 );
116120 pickColorBtn->setIcon (DIconTheme::findQIcon (" dorpper_normal" ));
117121 pickColorBtn->setIconSize (QSize (32 , 32 ));
118- pickColorBtn->setEnabled (DWindowManagerHelper::instance ()-> hasComposite ());
122+ pickColorBtn->setEnabled (supportWindowEffect ());
119123 rgbPickColorLayout->addWidget (rgbLabel);
120124 rgbPickColorLayout->addWidget (rEdit);
121125 rgbPickColorLayout->addWidget (gEdit );
@@ -162,7 +166,10 @@ void DPrintPickColorWidget::initConnection()
162166
163167 connect (valueLineEdit, SIGNAL (textChanged (QString)), this , SLOT (slotEditColor (QString)));
164168 connect (DWindowManagerHelper::instance (), &DWindowManagerHelper::hasCompositeChanged, this , [this ]() {
165- this ->pickColorBtn ->setEnabled (DWindowManagerHelper::instance ()->hasComposite ());
169+ this ->pickColorBtn ->setEnabled (supportWindowEffect ());
170+ });
171+ connect (DWindowManagerHelper::instance (), &DWindowManagerHelper::hasBlurWindowChanged, this , [this ]() {
172+ this ->pickColorBtn ->setEnabled (supportWindowEffect ());
166173 });
167174}
168175
0 commit comments