QSkinny 0.8.0
C++/Qt UI toolkit
Loading...
Searching...
No Matches
QskBoxHints.cpp
1/******************************************************************************
2 * QSkinny - Copyright (C) The authors
3 * SPDX-License-Identifier: BSD-3-Clause
4 *****************************************************************************/
5
6#include "QskBoxHints.h"
7#include "QskRgbValue.h"
8
9QskBoxHints::QskBoxHints()
10{
11}
12
13QskBoxHints::QskBoxHints(
14 const QskBoxShapeMetrics& shape, const QskBoxBorderMetrics& borderMetrics,
15 const QskBoxBorderColors& borderColors, const QskGradient& gradient,
16 const QskShadowMetrics& shadowMetrics, const QColor& shadowColor )
17 : shape( shape )
18 , borderMetrics( borderMetrics )
19 , borderColors( borderColors )
20 , gradient( gradient )
21 , shadowMetrics( shadowMetrics )
22 , shadowColor( shadowColor )
23{
24}
25
26QskBoxHints QskBoxHints::toAbsolute( const QSizeF& size ) const noexcept
27{
28 return QskBoxHints( shape.toAbsolute( size ),
29 borderMetrics.toAbsolute( size ), borderColors, gradient,
30 shadowMetrics.toAbsolute( size ), shadowColor );
31}
32
33QskBoxHints QskBoxHints::interpolated(
34 const QskBoxHints& to, qreal value ) const noexcept
35{
36 return QskBoxHints(
37 shape.interpolated( to.shape, value ),
38 borderMetrics.interpolated( to.borderMetrics, value ),
39 borderColors.interpolated( to.borderColors, value ),
40 gradient.interpolated( to.gradient, value ),
41 shadowMetrics.interpolated( to.shadowMetrics, value ),
42 QskRgb::interpolated( shadowColor, to.shadowColor, value ) );
43}
44
45#ifndef QT_NO_DEBUG_STREAM
46
47#include <qdebug.h>
48
49QDebug operator<<( QDebug debug, const QskBoxHints& hints )
50{
51 debug << hints.shape << hints.borderMetrics
52 << hints.borderColors << hints.gradient << hints.shadowMetrics
53 << hints.shadowColor;
54
55 return debug;
56}
57
58#endif
59
60#include "moc_QskBoxHints.cpp"