Removed cafUiStyleSheet and all references to it.

This commit is contained in:
Ruben Manuel Thoms authored and Magne Sjaastad committed 2020-09-20 15:26:46 +02:00
1 parent 9391453c2c
commit 85f2b3faf0
10 files changed
-477

No files matched your search

@@ -18,8 +18,6 @@
#pragma once
#include "cafUiStyleSheet.h"
#include <QMainWindow>
class QMdiArea;
@@ -327,11 +327,6 @@ void RiuMultiPlotBook::scheduleReplotOfAllPlots()
//--------------------------------------------------------------------------------------------------
void RiuMultiPlotBook::renderTo( QPaintDevice* paintDevice )
{
for ( auto page : m_pages )
{
page->stashWidgetStates();
}
int resolution = paintDevice->logicalDpiX();
double scaling = resolution / static_cast<double>( RiaGuiApplication::applicationResolution() );
@@ -350,11 +345,6 @@ void RiuMultiPlotBook::renderTo( QPaintDevice* paintDevice )
page->renderTo( &painter, scaling );
firstPage = false;
}
for ( auto page : m_pages )
{
page->restoreWidgetStates();
}
}
//--------------------------------------------------------------------------------------------------
@@ -19,7 +19,6 @@
#include "RiuInterfaceToViewWindow.h"
#include "RiuMultiPlotPage.h"
#include "cafUiStyleSheet.h"
#include "cafPdmPointer.h"
#include "cafSelectionChangedReceiver.h"
@@ -352,7 +352,6 @@ void RiuMultiPlotPage::renderTo( QPaintDevice* paintDevice )
//--------------------------------------------------------------------------------------------------
void RiuMultiPlotPage::renderTo( QPainter* painter, double scalingFactor )
{
stashWidgetStates();
painter->fillRect( painter->viewport(), Qt::white );
m_plotTitle->render( painter );
@@ -386,8 +385,6 @@ void RiuMultiPlotPage::renderTo( QPainter* painter, double scalingFactor )
plotWidget->renderTo( painter, plotWidgetGeometry, scalingFactor );
}
restoreWidgetStates();
}
//--------------------------------------------------------------------------------------------------
@@ -531,14 +528,6 @@ void RiuMultiPlotPage::onSelectionManagerSelectionChanged( const std::set<int>&
{
isSelected = isSelected || caf::SelectionManager::instance()->isSelected( plot, changedLevel );
}
if ( isSelected )
{
plotWidget->setWidgetState( "selected" );
}
else
{
caf::UiStyleSheet::clearWidgetStates( plotWidget );
}
}
}
@@ -819,28 +808,6 @@ std::pair<int, int>
return std::make_pair( availableRow, availableColumn );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuMultiPlotPage::stashWidgetStates()
{
for ( RiuQwtPlotWidget* plotWidget : m_plotWidgets )
{
plotWidget->stashWidgetStates();
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuMultiPlotPage::restoreWidgetStates()
{
for ( RiuQwtPlotWidget* plotWidget : m_plotWidgets )
{
plotWidget->restoreWidgetStates();
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -21,7 +21,6 @@
#include "cafPdmPointer.h"
#include "cafSelectionChangedReceiver.h"
#include "cafUiStyleSheet.h"
#include <QFrame>
#include <QGridLayout>
@@ -124,8 +123,6 @@ protected:
std::pair<int, int> findAvailableRowAndColumn( int startRow, int startColumn, int columnSpan, int columnCount ) const;
void stashWidgetStates();
void restoreWidgetStates();
void applyLook();
private slots:
virtual void performUpdate();
@@ -546,31 +546,6 @@ void RiuQwtPlotWidget::scheduleReplot()
RiaPlotWindowRedrawScheduler::instance()->schedulePlotWidgetReplot( this );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuQwtPlotWidget::stashWidgetStates()
{
m_plotStyleSheet.stashWidgetStates();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuQwtPlotWidget::restoreWidgetStates()
{
m_plotStyleSheet.restoreWidgetStates();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuQwtPlotWidget::setWidgetState( const QString& widgetState )
{
caf::UiStyleSheet::clearWidgetStates( this );
m_plotStyleSheet.setWidgetState( this, widgetState );
}
//--------------------------------------------------------------------------------------------------
/// Adds an overlay frame. The overlay frame becomes the responsibility of the plot widget
//--------------------------------------------------------------------------------------------------
@@ -685,12 +660,6 @@ void RiuQwtPlotWidget::hideEvent( QHideEvent* event )
//--------------------------------------------------------------------------------------------------
void RiuQwtPlotWidget::showEvent( QShowEvent* event )
{
m_plotStyleSheet = createPlotStyleSheet();
m_plotStyleSheet.applyToWidget( this );
m_canvasStyleSheet = createCanvasStyleSheet();
m_canvasStyleSheet.applyToWidget( canvas() );
QwtPlot::showEvent( event );
}
@@ -878,34 +847,6 @@ void RiuQwtPlotWidget::recalculateAxisExtents( QwtPlot::Axis axis )
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
caf::UiStyleSheet RiuQwtPlotWidget::createPlotStyleSheet() const
{
QColor backgroundColor = QColor( "white" );
QColor highlightColor = QApplication::palette().highlight().color();
caf::UiStyleSheet styleSheet;
styleSheet.set( "background-color", backgroundColor.name() );
styleSheet.set( "border", "1 px solid transparent" );
styleSheet.property( "selected" ).set( "border", QString( "1px solid %1" ).arg( highlightColor.name() ) );
return styleSheet;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
caf::UiStyleSheet RiuQwtPlotWidget::createCanvasStyleSheet() const
{
caf::UiStyleSheet styleSheet;
styleSheet.set( "background-color", "#FAFAFA" );
styleSheet.set( "border", "1px solid LightGray" );
return styleSheet;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -23,7 +23,6 @@
#include "cafPdmObject.h"
#include "cafPdmPointer.h"
#include "cafUiStyleSheet.h"
#include "qwt_plot.h"
@@ -123,9 +122,6 @@ public:
QPoint dragStartPosition() const;
void scheduleReplot();
void stashWidgetStates();
void restoreWidgetStates();
void setWidgetState( const QString& widgetState );
void addOverlayFrame( RiuDraggableOverlayFrame* overlayWidget );
void removeOverlayFrame( RiuDraggableOverlayFrame* overlayWidget );
@@ -176,9 +172,6 @@ private:
void onAxisSelected( QwtScaleWidget* scale, bool toggleItemInSelection );
void recalculateAxisExtents( QwtPlot::Axis axis );
caf::UiStyleSheet createPlotStyleSheet() const;
caf::UiStyleSheet createCanvasStyleSheet() const;
void updateOverlayFrameLayout();
private:
@@ -203,8 +196,5 @@ private:
std::map<QwtPlotCurve*, CurveColors> m_originalCurveColors;
std::map<QwtPlotCurve*, double> m_originalZValues;
caf::UiStyleSheet m_plotStyleSheet;
caf::UiStyleSheet m_canvasStyleSheet;
friend class RiaPlotWindowRedrawScheduler;
};