summaryrefslogtreecommitdiff
path: root/tizen/src/ui/skinpainter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tizen/src/ui/skinpainter.cpp')
-rw-r--r--tizen/src/ui/skinpainter.cpp75
1 files changed, 3 insertions, 72 deletions
diff --git a/tizen/src/ui/skinpainter.cpp b/tizen/src/ui/skinpainter.cpp
index 3ee51ed84d..5428c170db 100644
--- a/tizen/src/ui/skinpainter.cpp
+++ b/tizen/src/ui/skinpainter.cpp
@@ -33,22 +33,12 @@
#include "skinpainter.h"
#include "resource/ui_strings.h"
-#define COLOR_TAG_SIZE (4)
-
-SkinPainter::SkinPainter(const QString &patchPath,
- QSize centerPatch, int degree, QPoint tagLeftTop, QColor tagColor)
-{
- QString path = ":/images/" + patchPath + "/";
-
- drawSkin(path, centerPatch, degree, tagLeftTop, tagColor);
-}
-
-SkinPainter::SkinPainter(QSize centerPatch, int degree, QList<Separator *> separators)
+SkinPainter::SkinPainter(QSize centerPatch, int degree)
{
- drawSkin(centerPatch, degree, separators);
+ drawSkin(centerPatch, degree);
}
-void SkinPainter::drawSkin(QSize center, int degree, QList<Separator *> separators) {
+void SkinPainter::drawSkin(QSize center, int degree) {
qDebug() << "draw skin surface";
QRect centeralRect(0, 0, center.width(), center.height());
@@ -58,13 +48,6 @@ void SkinPainter::drawSkin(QSize center, int degree, QList<Separator *> separato
QPainter painter(&image);
painter.fillRect(centeralRect, QBrush(QColor(244, 244, 244)));
- // add separators
- for (int i = 0; i < separators.count(); i++) {
- Separator *s = separators.at(i);
- painter.setPen(s->pen);
- painter.drawLine(0, s->hOffset, center.width(), s->hOffset);
- }
-
/* rotate */
QTransform transform;
skin = new QPixmap(image.transformed(transform.rotate(degree)));
@@ -73,58 +56,6 @@ void SkinPainter::drawSkin(QSize center, int degree, QList<Separator *> separato
transform.mapRect(centeralRect).size());
}
-void SkinPainter::drawSkin(QString patchPath, QSize center, int degree,
- QPoint tagLeftTop, QColor tagColor)
-{
- qDebug() << "load skin patches from:" << patchPath;
-
- QImage LT(patchPath + GENERAL_SKIN_LEFTTOP_FILE);
- QImage LC(patchPath + GENERAL_SKIN_LEFTCENTER_FILE);
- QImage LB(patchPath + GENERAL_SKIN_LEFTBOTTOM_FILE);
- QImage TC(patchPath + GENERAL_SKIN_TOPCENTER_FILE);
- QImage BC(patchPath + GENERAL_SKIN_BOTTOMCENTER_FILE);
- QImage RT(patchPath + GENERAL_SKIN_RIGHTTOP_FILE);
- QImage RC(patchPath + GENERAL_SKIN_RIGHTCENTER_FILE);
- QImage RB(patchPath + GENERAL_SKIN_RIGHTBOTTOM_FILE);
-
- QRect centeralRect0(LT.width(), LT.height(), center.width(), center.height());
-
- QPixmap image(center.width() + (LT.width() * 2),
- center.height() + (LT.height() * 2));
- image.fill(Qt::transparent);
-
- QPainter painter(&image);
-
- /* top side */
- painter.drawImage(0, 0, LT);
- painter.drawImage(QRect(LT.width(), 0, center.width(), LT.height()), TC);
- painter.drawImage(center.width() + LT.width(), 0, RT);
-
- /* middle side */
- painter.drawImage(QRect(0, LT.height(), LT.width(), center.height()), LC);
- painter.fillRect(centeralRect0, QBrush(QColor(38, 38, 38)));
- painter.drawImage(QRect(
- center.width() + LT.width(), LT.height(), RT.width(), center.height()), RC);
-
- /* bottom side */
- painter.drawImage(0, center.height() + LT.height(), LB);
- painter.drawImage(QRect(
- LT.width(), center.height() + LT.height(), center.width(), LB.height()), BC);
- painter.drawImage(center.width() + LT.width(), center.height() + LT.height(), RB);
-
- /* color tag */
- painter.setPen(tagColor);
- painter.setBrush(QBrush(tagColor));
- painter.drawEllipse(tagLeftTop, COLOR_TAG_SIZE, COLOR_TAG_SIZE);
-
- /* rotate */
- QTransform transform;
- skin = new QPixmap(image.transformed(transform.rotate(degree)));
-
- centeralRect = QRect(
- centeralRect0.topLeft(), transform.mapRect(centeralRect0).size());
-}
-
QImage SkinPainter::getSkinImage() const
{
return skin->toImage();