diff --git a/include/dashboardFrame.h b/include/dashboardFrame.h index d47cb07..3e80689 100644 --- a/include/dashboardFrame.h +++ b/include/dashboardFrame.h @@ -41,6 +41,7 @@ public: Dashboard* getDashboard(const QString&); Dashboard* takeDashboard(const QString&); DashboardFrame* getDashboardFrame(const QString&); + void setDashboardAreaHighlight(bool); void moveDashboardToNewDVIEWindow(const QString&, QPoint); protected: @@ -84,6 +85,7 @@ private: dashboardFrame::frameType m_type; QWidget* m_pParentWindow; TransparentMask* m_pTransparentMask; + QWidget* m_pDashboardHighlight; MessageDialog* m_pMessageDialog; CustomTabBar* m_pDashboardTabBar; diff --git a/source/dashboardFrame.cpp b/source/dashboardFrame.cpp index 775e556..1cb6e7c 100644 --- a/source/dashboardFrame.cpp +++ b/source/dashboardFrame.cpp @@ -21,6 +21,7 @@ DashboardFrame::DashboardFrame(const QString& strName, dashboardFrame::frameType , ui(new Ui::dashboardFrame) , m_pParentWindow(nullptr) , m_pTransparentMask(nullptr) + , m_pDashboardHighlight(nullptr) , m_pMessageDialog(nullptr) , m_pDashboardTabBar(nullptr) , m_pDashboardNamingDialog(nullptr) @@ -86,6 +87,7 @@ void DashboardFrame::dragEnterEvent(QDragEnterEvent* event) if( mimeData->hasFormat("dragData/customTab") ) { event->acceptProposedAction(); + setDashboardAreaHighlight(true); //qDebug() << "dragEnterEvent-frame"; } else @@ -93,11 +95,13 @@ void DashboardFrame::dragEnterEvent(QDragEnterEvent* event) } void DashboardFrame::dragLeaveEvent(QDragLeaveEvent* event) { + setDashboardAreaHighlight(false); //qDebug() << "dragLeaveEvent-frame"; } void DashboardFrame::dropEvent(QDropEvent* event) { //qDebug() << "dropEvent-frame"; + setDashboardAreaHighlight(false); event->setDropAction(Qt::MoveAction); event->accept(); @@ -344,6 +348,23 @@ void DashboardFrame::setCurrentDashboard(const QString& strName) } } +void DashboardFrame::setDashboardAreaHighlight(bool bVisible) +{ + if(m_pDashboardHighlight == nullptr) + { + m_pDashboardHighlight = new QWidget(this); + m_pDashboardHighlight->setStyleSheet("background-color: rgba(0, 141, 212, 85);"); + } + + if(bVisible) + { + m_pDashboardHighlight->setGeometry(ui->mainStack->geometry()); + m_pDashboardHighlight->show(); + } + else + m_pDashboardHighlight->hide(); +} + void DashboardFrame::moveDashboardToNewDVIEWindow(const QString& strDashboard, QPoint pos) { Dashboard* dashboard = takeDashboard(strDashboard);