From 4847f46840845b5959f4422217472c3193573a68 Mon Sep 17 00:00:00 2001 From: Gaute Lindkvist Date: Tue, 29 Oct 2019 10:50:45 +0100 Subject: [PATCH] Fix Stylesheets after review --- ApplicationCode/UserInterface/RiuQwtPlotWidget.cpp | 11 +++++------ ApplicationCode/UserInterface/RiuWidgetStyleSheet.cpp | 4 ++-- ApplicationCode/UserInterface/RiuWidgetStyleSheet.h | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/ApplicationCode/UserInterface/RiuQwtPlotWidget.cpp b/ApplicationCode/UserInterface/RiuQwtPlotWidget.cpp index c9c808fa4b..17615ace7c 100644 --- a/ApplicationCode/UserInterface/RiuQwtPlotWidget.cpp +++ b/ApplicationCode/UserInterface/RiuQwtPlotWidget.cpp @@ -494,10 +494,9 @@ bool RiuQwtPlotWidget::eventFilter( QObject* watched, QEvent* event ) int dragLength = ( mouseEvent->pos() - m_clickPosition ).manhattanLength(); if ( dragLength >= QApplication::startDragDistance() ) { - QPoint dragPositionOffset = this->geometry().topLeft() - mouseEvent->pos(); - QPixmap pixmap = this->grab(); - QDrag* drag = new QDrag( this ); - QMimeData* mimeData = new QMimeData; + QPixmap pixmap = this->grab(); + QDrag* drag = new QDrag( this ); + QMimeData* mimeData = new QMimeData; mimeData->setImageData( pixmap ); drag->setMimeData( mimeData ); drag->setPixmap( pixmap ); @@ -634,8 +633,8 @@ RiuWidgetStyleSheet RiuQwtPlotWidget::createPlotStyleSheet() const styleSheet.state( RiuWidgetStyleSheet::HOVER ).set( "background", backgroundGradient ); } - styleSheet.state( RiuWidgetStyleSheet::DRAG_TARGET_BEFORE ).set( "border-left", "1px solid red" ); - styleSheet.state( RiuWidgetStyleSheet::DRAG_TARGET_AFTER ).set( "border-right", "1px solid red" ); + styleSheet.state( RiuWidgetStyleSheet::DRAG_TARGET_BEFORE ).set( "border-left", "1px solid lime" ); + styleSheet.state( RiuWidgetStyleSheet::DRAG_TARGET_AFTER ).set( "border-right", "1px solid lime" ); return styleSheet; } diff --git a/ApplicationCode/UserInterface/RiuWidgetStyleSheet.cpp b/ApplicationCode/UserInterface/RiuWidgetStyleSheet.cpp index e9dd2ea488..fe47ad3620 100644 --- a/ApplicationCode/UserInterface/RiuWidgetStyleSheet.cpp +++ b/ApplicationCode/UserInterface/RiuWidgetStyleSheet.cpp @@ -193,9 +193,9 @@ QString RiuWidgetStyleSheet::fullText( const QString& className, const QString& QString RiuWidgetStyleSheet::buildStateString( StateTag state ) { QString stateString; - if ( state == HOVER ) + if ( state > PSEUDO_STATE_LIMIT ) { - stateString += ":hover"; + stateString += ":" + StateTagEnum::uiText( state ); } else { diff --git a/ApplicationCode/UserInterface/RiuWidgetStyleSheet.h b/ApplicationCode/UserInterface/RiuWidgetStyleSheet.h index 8b686b9764..bad90f8ad0 100644 --- a/ApplicationCode/UserInterface/RiuWidgetStyleSheet.h +++ b/ApplicationCode/UserInterface/RiuWidgetStyleSheet.h @@ -82,5 +82,5 @@ private: static QString buildStateString( StateTag stateTag ); private: - std::map m_states; + std::map m_states; };