mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-04-25 07:57:19 +00:00
rename ring to circle
This commit is contained in:
parent
e7714042bb
commit
9eedaf246f
@ -22,7 +22,7 @@
|
|||||||
#include <QGraphicsEllipseItem>
|
#include <QGraphicsEllipseItem>
|
||||||
#include <QGraphicsScene>
|
#include <QGraphicsScene>
|
||||||
#include <QGraphicsView>
|
#include <QGraphicsView>
|
||||||
#include <QPainterPath>
|
|
||||||
|
|
||||||
#include <pdebug/pdebug.h>
|
#include <pdebug/pdebug.h>
|
||||||
|
|
||||||
@ -62,7 +62,6 @@ QString GraphicalItem::getImage(const float value)
|
|||||||
view->resize(width + 5.0, height + 5.0);
|
view->resize(width + 5.0, height + 5.0);
|
||||||
|
|
||||||
// paint
|
// paint
|
||||||
QPainterPath ppath;
|
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case Vertical:
|
case Vertical:
|
||||||
pen.setWidth(width);
|
pen.setWidth(width);
|
||||||
@ -75,26 +74,19 @@ QString GraphicalItem::getImage(const float value)
|
|||||||
// scale
|
// scale
|
||||||
scale[1] = (int)direction;
|
scale[1] = (int)direction;
|
||||||
break;
|
break;
|
||||||
case Ring:
|
case Circle:
|
||||||
QGraphicsEllipseItem *circle;
|
QGraphicsEllipseItem *circle;
|
||||||
pen.setWidth(1.0);
|
pen.setWidth(1.0);
|
||||||
// inactive
|
// inactive
|
||||||
pen.setColor(inactiveColor);
|
pen.setColor(inactiveColor);
|
||||||
circle = scene->addEllipse(0.0, 0.0, width, height, pen, QBrush(inactiveColor, Qt::SolidPattern));
|
circle = scene->addEllipse(0.0, 0.0, width, height, pen, QBrush(inactiveColor, Qt::SolidPattern));
|
||||||
|
circle->setSpanAngle((1.0 - percent) * 360.0 * 16.0);
|
||||||
|
circle->setStartAngle(180.0 * 16.0 - (1.0 - percent) * 360.0 * 16.0);
|
||||||
// active
|
// active
|
||||||
pen.setColor(activeColor);
|
pen.setColor(activeColor);
|
||||||
circle = scene->addEllipse(0.0, 0.0, width, height, pen, QBrush(activeColor, Qt::SolidPattern));
|
circle = scene->addEllipse(0.0, 0.0, width, height, pen, QBrush(activeColor, Qt::SolidPattern));
|
||||||
circle->setSpanAngle(percent * 360.0 * 16.0);
|
circle->setSpanAngle(percent * 360.0 * 16.0);
|
||||||
circle->setStartAngle(180.0 * 16.0);
|
circle->setStartAngle(180.0 * 16.0);
|
||||||
// null
|
|
||||||
pen.setColor(QColor(255, 255, 255, 0));
|
|
||||||
ppath.addEllipse(0.16 * width, 0.16 * height, 0.66 * width, 0.66 * height);
|
|
||||||
scene->setSelectionArea(ppath);
|
|
||||||
scene->clearSelection();
|
|
||||||
// scene->addPath(ppath, pen, QBrush(QColor(255,255,255,0), Qt::SolidPattern));
|
|
||||||
// pen.setColor(QColor(255, 255, 255, 0));
|
|
||||||
// scene->addEllipse(0.16 * width, 0.16 * height, 0.66 * width, 0.66 * height, pen, QBrush(QColor(255,255,255,255), Qt::SolidPattern));
|
|
||||||
// scene->addEllipse(0.16 * width, 0.16 * height, 0.66 * width, 0.66 * height, pen, QBrush(QColor(255,255,255,0), Qt::SolidPattern));
|
|
||||||
// scale
|
// scale
|
||||||
scale[0] = (int)direction;
|
scale[0] = (int)direction;
|
||||||
break;
|
break;
|
||||||
@ -231,8 +223,8 @@ void GraphicalItem::parseTag(const QString tag)
|
|||||||
case Vertical:
|
case Vertical:
|
||||||
type = Vertical;
|
type = Vertical;
|
||||||
break;
|
break;
|
||||||
case Ring:
|
case Circle:
|
||||||
type = Ring;
|
type = Circle;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
type = Horizontal;
|
type = Horizontal;
|
||||||
|
@ -34,7 +34,7 @@ public:
|
|||||||
enum Type {
|
enum Type {
|
||||||
Horizontal = 0,
|
Horizontal = 0,
|
||||||
Vertical,
|
Vertical,
|
||||||
Ring
|
Circle
|
||||||
};
|
};
|
||||||
|
|
||||||
GraphicalItem(QObject *wid, const QString assignName, const QString tag, const bool debugCmd = false);
|
GraphicalItem(QObject *wid, const QString assignName, const QString tag, const bool debugCmd = false);
|
||||||
|
Loading…
Reference in New Issue
Block a user