75 lines
1.8 KiB
C++
Raw Normal View History

2020-10-06 15:49:46 +02:00
/******************************************************************************
* QSkinny - Copyright (C) 2016 Uwe Rathmann
* This file may be used under the terms of the 3-clause BSD License
*****************************************************************************/
#include "ShadowedBox.h"
2021-09-18 14:48:25 +02:00
#include <SkinnyShortcut.h>
2020-10-06 15:49:46 +02:00
#include <QGuiApplication>
#include <QskObjectCounter.h>
#include <QskWindow.h>
#include <QskLinearBox.h>
#include <QskBoxShapeMetrics.h>
#include <QskRgbValue.h>
class Box : public ShadowedBox
{
public:
Box( QQuickItem* parent = nullptr )
: ShadowedBox( parent )
{
2021-09-18 14:48:25 +02:00
const qreal w = 10;
QskShadowMetrics shadow;
//shadow.setOffset( 20.0, 20.0 );
shadow.setSpreadRadius( w );
shadow.setBlurRadius( w );
2020-10-06 15:49:46 +02:00
setShadow( shadow );
setShadowColor( Qt::black );
2021-09-18 14:48:25 +02:00
QColor c( Qt::darkRed );
#if 0
c.setAlpha( 100 );
#endif
setGradient( c );
setShape( QskBoxShapeMetrics( 40, 10, 15, 5 ) );
setBorderWidth( w );
setBorderColor( Qt::blue );
2020-10-06 15:49:46 +02:00
}
};
int main( int argc, char* argv[] )
{
#ifdef ITEM_STATISTICS
QskObjectCounter counter( true );
#endif
QGuiApplication app( argc, argv );
2021-09-18 14:48:25 +02:00
SkinnyShortcut::enable( SkinnyShortcut::AllShortcuts );
2020-10-06 15:49:46 +02:00
auto layout = new QskLinearBox();
layout->setPanel( true );
#if 1
layout->setGradientHint( QskBox::Panel,
QskGradient( Qt::Vertical, QskRgb::WhiteSmoke, QskRgb::MistyRose ) );
#else
layout->setGradientHint( QskBox::Panel, Qt::white );
#endif
layout->setPadding( 60 );
(void ) new Box( layout );
QskWindow window;
window.setColor( QskRgb::PapayaWhip );
window.addItem( layout );
window.resize( 600, 600 );
window.show();
return app.exec();
}