qskinny/src/common/QskBoxHints.cpp

61 lines
1.8 KiB
C++
Raw Normal View History

2022-01-04 12:44:53 +00:00
/******************************************************************************
* QSkinny - Copyright (C) 2016 Uwe Rathmann
* This file may be used under the terms of the QSkinny License, Version 1.0
*****************************************************************************/
#include "QskBoxHints.h"
2022-06-13 15:01:15 +00:00
#include "QskRgbValue.h"
2022-01-04 12:44:53 +00:00
QskBoxHints::QskBoxHints()
{
}
QskBoxHints::QskBoxHints(
const QskBoxShapeMetrics& shape, const QskBoxBorderMetrics& borderMetrics,
2022-06-13 15:01:15 +00:00
const QskBoxBorderColors& borderColors, const QskGradient& gradient,
const QskShadowMetrics& shadowMetrics, const QColor& shadowColor )
2022-01-04 12:44:53 +00:00
: shape( shape )
, borderMetrics( borderMetrics )
, borderColors( borderColors )
, gradient( gradient )
2022-06-13 15:01:15 +00:00
, shadowMetrics( shadowMetrics )
, shadowColor( shadowColor )
2022-01-04 12:44:53 +00:00
{
}
QskBoxHints QskBoxHints::toAbsolute( const QSizeF& size ) const noexcept
{
return QskBoxHints( shape.toAbsolute( size ),
2022-06-13 15:01:15 +00:00
borderMetrics.toAbsolute( size ), borderColors, gradient,
shadowMetrics.toAbsolute( size ), shadowColor );
2022-01-04 12:44:53 +00:00
}
QskBoxHints QskBoxHints::interpolated(
const QskBoxHints& to, qreal value ) const noexcept
{
return QskBoxHints(
shape.interpolated( to.shape, value ),
borderMetrics.interpolated( to.borderMetrics, value ),
borderColors.interpolated( to.borderColors, value ),
2022-06-13 15:01:15 +00:00
gradient.interpolated( to.gradient, value ),
shadowMetrics.interpolated( to.shadowMetrics, value ),
QskRgb::interpolated( shadowColor, to.shadowColor, value ) );
2022-01-04 12:44:53 +00:00
}
#ifndef QT_NO_DEBUG_STREAM
2022-03-23 10:54:34 +00:00
2022-01-04 12:44:53 +00:00
#include <qdebug.h>
QDebug operator<<( QDebug debug, const QskBoxHints& hints )
2022-03-23 10:54:34 +00:00
{
2022-01-04 12:44:53 +00:00
debug << hints.shape << hints.borderMetrics
2022-06-13 15:01:15 +00:00
<< hints.borderColors << hints.gradient << hints.shadowMetrics
<< hints.shadowColor;
2022-01-04 12:44:53 +00:00
return debug;
}
2022-03-23 10:54:34 +00:00
2022-01-04 12:44:53 +00:00
#endif
#include "moc_QskBoxHints.cpp"