Codebase list deepin-movie-reborn / dac097c
feat: update shadow with focus change Change-Id: I20abbacda4148e3688da09c49692cf24c33c632e Sian Cao 6 years ago
2 changed file(s) with 20 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
519519
520520 if (composited) {
521521 setAttribute(Qt::WA_TranslucentBackground, true);
522 setAttribute(Qt::WA_NoSystemBackground, false);
522 //setAttribute(Qt::WA_NoSystemBackground, false);
523523 }
524524
525525 DThemeManager::instance()->registerWidget(this);
529529 if (DApplication::isDXcbPlatform()) {
530530 _handle = new DPlatformWindowHandle(this, this);
531531 setAttribute(Qt::WA_TranslucentBackground, true);
532 if (composited)
533 _handle->setTranslucentBackground(true);
532 //if (composited)
533 //_handle->setTranslucentBackground(true);
534534 _handle->setEnableSystemResize(false);
535535 _handle->setEnableSystemMove(false);
536536 _handle->setWindowRadius(4);
537 connect(qApp, &QGuiApplication::focusWindowChanged, this, &MainWindow::updateShadow);
538 updateShadow();
537539 }
538540 #else
539541 winId();
785787 qDebug() << "event listener";
786788 #endif
787789 }
790
791 #ifdef USE_DXCB
792 void MainWindow::updateShadow()
793 {
794 if (isActiveWindow()) {
795 _handle->setShadowRadius(60);
796 _handle->setShadowColor(SHADOW_COLOR_ACTIVE);
797 } else {
798 _handle->setShadowRadius(60);
799 _handle->setShadowColor(SHADOW_COLOR_NORMAL);
800 }
801 }
802 #endif
788803
789804 bool MainWindow::event(QEvent *ev)
790805 {
139139 void onMonitorButtonPressed(int x, int y);
140140 void onMonitorMotionNotify(int x, int y);
141141 void onMonitorButtonReleased(int x, int y);
142
143 void updateShadow();
142144 #endif
143145
144146 void handleHelpAction();