mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Release 2023.06
This commit is contained in:
@@ -18,20 +18,14 @@
|
||||
|
||||
#include "RimTimeAxisAnnotation.h"
|
||||
|
||||
#include "RiaColorTools.h"
|
||||
#include "RiaPreferences.h"
|
||||
#include "RiaQDateTimeTools.h"
|
||||
#include "RiaTimeTTools.h"
|
||||
|
||||
#include "RigEclipseCaseData.h"
|
||||
#include "RigEquil.h"
|
||||
#include "RimProject.h"
|
||||
|
||||
#include "RiuGuiTheme.h"
|
||||
#include "RiuQwtPlotCurve.h"
|
||||
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimPlot.h"
|
||||
#include "RimTools.h"
|
||||
#include "RimViewWindow.h"
|
||||
|
||||
#include <QDateTime>
|
||||
|
||||
@@ -48,6 +42,8 @@ RimTimeAxisAnnotation::RimTimeAxisAnnotation()
|
||||
CAF_PDM_InitObject( "Time Axis Annotation", ":/LeftAxis16x16.png" );
|
||||
|
||||
m_value.uiCapability()->setUiHidden( true );
|
||||
|
||||
CAF_PDM_InitField( &m_color, "Color", RiaColorTools::fromQColorTo3f( defaultColor( AnnotationType::LINE ) ), "Color" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -96,19 +92,43 @@ void RimTimeAxisAnnotation::setTimeRange( time_t startTime, time_t endTime )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QColor RimTimeAxisAnnotation::color() const
|
||||
QColor RimTimeAxisAnnotation::defaultColor( AnnotationType annotationType )
|
||||
{
|
||||
if ( annotationType() == AnnotationType::LINE )
|
||||
if ( annotationType == AnnotationType::LINE )
|
||||
{
|
||||
return RiuGuiTheme::getColorByVariableName( "secondaryColor" ); // QColor(255, 0, 0);
|
||||
}
|
||||
else if ( annotationType() == RimPlotAxisAnnotation::AnnotationType::RANGE )
|
||||
else if ( annotationType == RimPlotAxisAnnotation::AnnotationType::RANGE )
|
||||
{
|
||||
return RiuGuiTheme::getColorByVariableName( "primaryColor" ); // QColor( 0, 0, 255 );
|
||||
}
|
||||
return RiuGuiTheme::getColorByVariableName( "textColor" ); // QColor(0, 0, 100);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimTimeAxisAnnotation::setDefaultColor()
|
||||
{
|
||||
m_color = RiaColorTools::fromQColorTo3f( defaultColor( annotationType() ) );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimTimeAxisAnnotation::setColor( const cvf::Color3f& color )
|
||||
{
|
||||
m_color = color;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QColor RimTimeAxisAnnotation::color() const
|
||||
{
|
||||
return RiaColorTools::toQColor( m_color );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -121,3 +141,14 @@ void RimTimeAxisAnnotation::defineUiOrdering( QString uiConfigName, caf::PdmUiOr
|
||||
|
||||
uiOrdering.skipRemainingFields();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimTimeAxisAnnotation::initAfterRead()
|
||||
{
|
||||
if ( RimProject::current()->isProjectFileVersionEqualOrOlderThan( "2023.03" ) )
|
||||
{
|
||||
setDefaultColor();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user