-
-
Notifications
You must be signed in to change notification settings - Fork 294
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
QskArcShadowNode introduced ( kudos to Rick )
- Loading branch information
Showing
32 changed files
with
1,310 additions
and
194 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
/****************************************************************************** | ||
* QSkinny - Copyright (C) 2016 Uwe Rathmann | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
*****************************************************************************/ | ||
|
||
#include "ArcPage.h" | ||
#include "ShadowedArc.h" | ||
#include "Slider.h" | ||
|
||
#include <QskGridBox.h> | ||
|
||
namespace | ||
{ | ||
class ControlPanel : public QskGridBox | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
ControlPanel( ShadowedArc* arc, QQuickItem* parent = nullptr ) | ||
: QskGridBox( parent ) | ||
{ | ||
setMargins( 5 ); | ||
setSpacing( 10 ); | ||
|
||
{ | ||
auto slider = new Slider( "Start", 0, 360, 10, arc->startAngle() ); | ||
connect( slider, &Slider::valueChanged, arc, &ShadowedArc::setStartAngle ); | ||
|
||
addItem( slider, 0, 0 ); | ||
} | ||
{ | ||
auto slider = new Slider( "Span", -360, 360, 10, arc->spanAngle() ); | ||
connect( slider, &Slider::valueChanged, arc, &ShadowedArc::setSpanAngle ); | ||
|
||
addItem( slider, 0, 1 ); | ||
} | ||
{ | ||
auto slider = new Slider( "Extent", 0, 100, 1, arc->thickness() ); | ||
connect( slider, &Slider::valueChanged, arc, &ShadowedArc::setThickness ); | ||
|
||
addItem( slider, 1, 0 ); | ||
} | ||
{ | ||
auto slider = new Slider( "Border", 0, 10, 1, arc->borderWidth() ); | ||
connect( slider, &Slider::valueChanged, arc, &ShadowedArc::setBorderWidth ); | ||
|
||
addItem( slider, 1, 1); | ||
} | ||
{ | ||
auto slider = new Slider( "Spread Radius", -10, 50, 1, arc->spreadRadius() ); | ||
connect( slider, &Slider::valueChanged, arc, &ShadowedArc::setSpreadRadius ); | ||
|
||
addItem( slider, 2, 0 ); | ||
} | ||
{ | ||
auto slider = new Slider( "Blur Radius", 0, 50, 1, arc->blurRadius() ); | ||
connect( slider, &Slider::valueChanged, arc, &ShadowedArc::setBlurRadius ); | ||
|
||
addItem( slider, 2, 1 ); | ||
} | ||
{ | ||
auto slider = new Slider( "Offset X", -50, 50, 1, arc->offsetX() ); | ||
connect( slider, &Slider::valueChanged, arc, &ShadowedArc::setOffsetX ); | ||
|
||
addItem( slider, 3, 0 ); | ||
|
||
} | ||
{ | ||
auto slider = new Slider( "Offset Y", -50, 50, 1, arc->offsetY() ); | ||
connect( slider, &Slider::valueChanged, arc, &ShadowedArc::setOffsetY ); | ||
|
||
addItem( slider, 3, 1 ); | ||
} | ||
} | ||
}; | ||
} | ||
|
||
ArcPage::ArcPage( QQuickItem* parent ) | ||
: QskLinearBox( Qt::Vertical, parent ) | ||
{ | ||
auto arc = new ShadowedArc(); | ||
arc->setMargins( 40 ); // some extra space for testing the offsets | ||
|
||
{ | ||
// initial settings | ||
arc->setStartAngle( 45.0 ); | ||
arc->setSpanAngle( 270.0 ); | ||
arc->setThickness( 10.0 ); | ||
|
||
arc->setFillColor( Qt::darkRed ); | ||
|
||
arc->setBorderWidth( 0 ); | ||
arc->setBorderColor( Qt::darkYellow ); | ||
|
||
arc->setShadowColor( Qt::black ); | ||
arc->setSpreadRadius( 0.0 ); | ||
arc->setBlurRadius( 4.0 ); | ||
arc->setOffsetX( 2.0 ); | ||
arc->setOffsetY( 2.0 ); | ||
} | ||
|
||
auto panel = new ControlPanel( arc ); | ||
panel->setSizePolicy( Qt::Vertical, QskSizePolicy::Fixed ); | ||
|
||
addItem( panel ); | ||
addItem( arc ); | ||
} | ||
|
||
#include "ArcPage.moc" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/****************************************************************************** | ||
* QSkinny - Copyright (C) 2016 Uwe Rathmann | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
*****************************************************************************/ | ||
|
||
#pragma once | ||
|
||
#include <QskLinearBox.h> | ||
|
||
class ArcPage : public QskLinearBox | ||
{ | ||
public: | ||
ArcPage( QQuickItem* parent = nullptr ); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
/****************************************************************************** | ||
* QSkinny - Copyright (C) 2016 Uwe Rathmann | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
*****************************************************************************/ | ||
|
||
#include "BoxPage.h" | ||
#include "ShadowedBox.h" | ||
#include "Slider.h" | ||
|
||
#include <QskRgbValue.h> | ||
#include <QFontMetrics> | ||
|
||
namespace | ||
{ | ||
class ControlPanel : public QskLinearBox | ||
{ | ||
public: | ||
ControlPanel( ShadowedBox* box, QQuickItem* parent = nullptr ) | ||
: QskLinearBox( Qt::Vertical, parent ) | ||
{ | ||
{ | ||
auto slider = new Slider( "Offset X", -50, 50, 1, box->offsetX() ); | ||
connect( slider, &Slider::valueChanged, box, &ShadowedBox::setOffsetX ); | ||
|
||
addItem( slider ); | ||
} | ||
{ | ||
auto slider = new Slider( "Offset Y", -50, 50, 1, box->offsetY() ); | ||
connect( slider, &Slider::valueChanged, box, &ShadowedBox::setOffsetY ); | ||
|
||
addItem( slider ); | ||
} | ||
{ | ||
auto slider = new Slider( "Spread Radius", -10, 50, 1, box->spreadRadius() ); | ||
connect( slider, &Slider::valueChanged, box, &ShadowedBox::setSpreadRadius ); | ||
|
||
addItem( slider ); | ||
} | ||
{ | ||
auto slider = new Slider( "Blur Radius", 0, 50, 1, box->blurRadius() ); | ||
connect( slider, &Slider::valueChanged, box, &ShadowedBox::setBlurRadius ); | ||
|
||
addItem( slider ); | ||
} | ||
{ | ||
auto slider = new Slider( "Opacity", 0, 1, 0.01, box->opacity() ); | ||
connect( slider, &Slider::valueChanged, box, &ShadowedBox::setOpacity ); | ||
|
||
addItem( slider ); | ||
} | ||
} | ||
}; | ||
} | ||
|
||
BoxPage::BoxPage( QQuickItem* parent ) | ||
: QskLinearBox( Qt::Vertical, parent ) | ||
{ | ||
auto box = new ShadowedBox(); | ||
box->setMargins( 40 ); // some extra space for testing the offsets | ||
|
||
{ | ||
box->setOffsetX( 10 ); | ||
box->setOffsetY( 10 ); | ||
box->setSpreadRadius( 0 ); | ||
box->setBlurRadius( 5 ); | ||
} | ||
|
||
auto panel = new ControlPanel( box ); | ||
panel->setSizePolicy( Qt::Vertical, QskSizePolicy::Fixed ); | ||
|
||
addItem( panel ); | ||
addItem( box ); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/****************************************************************************** | ||
* QSkinny - Copyright (C) 2016 Uwe Rathmann | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
*****************************************************************************/ | ||
|
||
#pragma once | ||
|
||
#include <QskLinearBox.h> | ||
|
||
class QskSlider; | ||
|
||
class BoxPage : public QskLinearBox | ||
{ | ||
public: | ||
BoxPage( QQuickItem* parent = nullptr ); | ||
|
||
private: | ||
void addSlider( int row, const QString&, QskSlider* ); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.