using QskBoxHints
This commit is contained in:
parent
5f85d7299b
commit
da1691eaa0
|
@ -5,9 +5,7 @@
|
|||
|
||||
#include "QskMaterial3ProgressBarSkinlet.h"
|
||||
#include <QskProgressBar.h>
|
||||
#include <QskBoxShapeMetrics.h>
|
||||
#include <QskBoxBorderMetrics.h>
|
||||
#include <QskBoxBorderColors.h>
|
||||
#include <QskBoxHints.h>
|
||||
#include <QskMargins.h>
|
||||
#include <QskClipNode.h>
|
||||
#include <QskSGNode.h>
|
||||
|
@ -65,11 +63,11 @@ QSGNode* QskMaterial3ProgressBarSkinlet::updateStopIndicatorNode(
|
|||
else
|
||||
rect.setBottom( rect.top() + rect.width() );
|
||||
|
||||
const auto color = progressBar->gradientHint( Q::Fill ).endColor();
|
||||
const auto shape = progressBar->boxShapeHint( Q::Fill );
|
||||
QskBoxHints hints;
|
||||
hints.shape = progressBar->boxShapeHint( Q::Fill );
|
||||
hints.gradient = progressBar->gradientHint( Q::Fill ).endColor();
|
||||
|
||||
return updateBoxNode( progressBar, node, rect, shape,
|
||||
QskBoxBorderMetrics(), QskBoxBorderColors(), color );
|
||||
return updateBoxNode( progressBar, node, rect, hints );
|
||||
}
|
||||
|
||||
QSGNode* QskMaterial3ProgressBarSkinlet::updateGrooveClipNode(
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include "QskGraphic.h"
|
||||
#include "QskColorFilter.h"
|
||||
#include "QskTextOptions.h"
|
||||
#include "QskBoxHints.h"
|
||||
#include "QskFunctions.h"
|
||||
#include "QskMargins.h"
|
||||
#include "QskFunctions.h"
|
||||
|
@ -572,11 +573,13 @@ QSGNode* QskMenuSkinlet::updateSampleNode( const QskSkinnable* skinnable,
|
|||
|
||||
if ( subControl == Q::Separator )
|
||||
{
|
||||
auto gradient = menu->gradientHint( subControl );
|
||||
auto hints = skinnable->boxHints( subControl );
|
||||
|
||||
auto& gradient = hints.gradient;
|
||||
if ( ( gradient.type() == QskGradient::Stops ) && !gradient.isMonochrome() )
|
||||
gradient.setLinearDirection( Qt::Vertical );
|
||||
|
||||
return updateBoxNode( menu, node, rect, gradient, subControl );
|
||||
return updateBoxNode( menu, node, rect, hints );
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
#include "QskPopupSkinlet.h"
|
||||
#include "QskPopup.h"
|
||||
#include "QskRgbValue.h"
|
||||
#include "QskBoxHints.h"
|
||||
|
||||
static inline QRgb qskInterpolatedRgb( QRgb rgb, qreal factor )
|
||||
{
|
||||
|
@ -58,7 +59,9 @@ QSGNode* QskPopupSkinlet::updateOverlayNode(
|
|||
if ( rect.isEmpty() )
|
||||
return nullptr;
|
||||
|
||||
auto gradient = popup->gradientHint( Q::Overlay );
|
||||
auto hints = popup->boxHints( Q::Overlay );
|
||||
|
||||
auto& gradient = hints.gradient;
|
||||
|
||||
if ( gradient.isVisible() && factor != 1.0 )
|
||||
{
|
||||
|
@ -70,7 +73,7 @@ QSGNode* QskPopupSkinlet::updateOverlayNode(
|
|||
gradient.setStops( stops );
|
||||
}
|
||||
|
||||
return updateBoxNode( popup, node, rect, gradient, QskPopup::Overlay );
|
||||
return updateBoxNode( popup, node, rect, hints );
|
||||
}
|
||||
|
||||
#include "moc_QskPopupSkinlet.cpp"
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
#include "QskSeparatorSkinlet.h"
|
||||
#include "QskSeparator.h"
|
||||
|
||||
#include "QskBoxHints.h"
|
||||
#include "QskGradientDirection.h"
|
||||
#include "QskAspect.h"
|
||||
|
||||
|
@ -42,8 +43,12 @@ QSGNode* QskSeparatorSkinlet::updateSubNode(
|
|||
using Q = QskSeparator;
|
||||
|
||||
const auto rect = separator->subControlRect( Q::Panel );
|
||||
if ( rect.isEmpty() )
|
||||
return nullptr;
|
||||
|
||||
auto gradient = separator->gradientHint( Q::Panel );
|
||||
auto hints = separator->boxHints( Q::Panel );
|
||||
|
||||
auto& gradient = hints.gradient;
|
||||
if ( ( gradient.type() == QskGradient::Stops ) && !gradient.isMonochrome() )
|
||||
{
|
||||
// gradient in opposite orientation
|
||||
|
@ -53,7 +58,7 @@ QSGNode* QskSeparatorSkinlet::updateSubNode(
|
|||
gradient.setLinearDirection( orientation );
|
||||
}
|
||||
|
||||
return updateBoxNode( separator, node, rect, gradient, Q::Panel );
|
||||
return updateBoxNode( separator, node, rect, hints );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue