diff options
author | jihye <jihye424.kim@samsung.com> | 2017-02-15 18:45:22 +0900 |
---|---|---|
committer | SeokYeon Hwang <syeon.hwang@samsung.com> | 2017-03-02 11:27:32 +0900 |
commit | 3c39fa821b55bf11430944b10ca4f91635282d7a (patch) | |
tree | ed624a5e582040a2bca12aebc17df2ddb46793ba /tizen | |
parent | b28c23a98b05eb3d678068aa963ca385c7b23aa6 (diff) | |
download | qemu-3c39fa821b55bf11430944b10ca4f91635282d7a.tar.gz qemu-3c39fa821b55bf11430944b10ca4f91635282d7a.tar.bz2 qemu-3c39fa821b55bf11430944b10ca4f91635282d7a.zip |
skin: add color bar and border to controller
- change default position from center to top
Change-Id: Ia3f431f8be5416f4bc543251102a43c808d79c70
Signed-off-by: jihye <jihye424.kim@samsung.com>
Diffstat (limited to 'tizen')
-rw-r--r-- | tizen/src/ui/controller/dockingconview.cpp | 2 | ||||
-rw-r--r-- | tizen/src/ui/controller/floatingcontroller.cpp | 1 | ||||
-rw-r--r-- | tizen/src/ui/controller/floatingconview.cpp | 2 | ||||
-rw-r--r-- | tizen/src/ui/controller/generalpurposecon.cpp | 23 | ||||
-rw-r--r-- | tizen/src/ui/controller/generalpurposecon.h | 6 | ||||
-rw-r--r-- | tizen/src/ui/generalskinview.cpp | 2 | ||||
-rw-r--r-- | tizen/src/ui/qt5_supplement.cpp | 2 | ||||
-rw-r--r-- | tizen/src/ui/uiinformation.cpp | 23 | ||||
-rw-r--r-- | tizen/src/ui/xmllayoutparser.cpp | 4 |
9 files changed, 48 insertions, 17 deletions
diff --git a/tizen/src/ui/controller/dockingconview.cpp b/tizen/src/ui/controller/dockingconview.cpp index 217108c634..d1e336c1fe 100644 --- a/tizen/src/ui/controller/dockingconview.cpp +++ b/tizen/src/ui/controller/dockingconview.cpp @@ -67,6 +67,8 @@ void DockingConView::createItems(ControllerForm *conForm) } } else { GeneralPurposeCon *generalCon = new GeneralPurposeCon(); + + generalCon->createHeaderBarAndBorder(scene(), parent->getMainWindow()->getUiInfo(), false); QList<HWKeyButton *> buttons = generalCon->createButtons(parentWidget(), conForm); diff --git a/tizen/src/ui/controller/floatingcontroller.cpp b/tizen/src/ui/controller/floatingcontroller.cpp index 238517faea..4e90ecd58e 100644 --- a/tizen/src/ui/controller/floatingcontroller.cpp +++ b/tizen/src/ui/controller/floatingcontroller.cpp @@ -45,6 +45,7 @@ FloatingController::FloatingController(ControllerForm *conForm, conScene->setBackgroundBrush(Qt::transparent); conView = new FloatingConView(this, conForm, conScene); + resize(conForm->skinImg[LayoutForm::normal].size()); conView->resize(conForm->skinImg[LayoutForm::normal].size()); } diff --git a/tizen/src/ui/controller/floatingconview.cpp b/tizen/src/ui/controller/floatingconview.cpp index e4b9f80d66..277e3f1b49 100644 --- a/tizen/src/ui/controller/floatingconview.cpp +++ b/tizen/src/ui/controller/floatingconview.cpp @@ -67,6 +67,8 @@ void FloatingConView::createItems(ControllerForm *conForm) } } else { GeneralPurposeCon *generalCon = new GeneralPurposeCon(); + + generalCon->createHeaderBarAndBorder(scene(), parent->getMainWindow()->getUiInfo(), true); QList<HWKeyButton *> buttons = generalCon->createButtons(parentWidget(), conForm); diff --git a/tizen/src/ui/controller/generalpurposecon.cpp b/tizen/src/ui/controller/generalpurposecon.cpp index e4925e22dd..9a5c31e4cf 100644 --- a/tizen/src/ui/controller/generalpurposecon.cpp +++ b/tizen/src/ui/controller/generalpurposecon.cpp @@ -37,10 +37,31 @@ GeneralPurposeCon::GeneralPurposeCon() qDebug("create general purpose controller"); } +void GeneralPurposeCon::createHeaderBarAndBorder(QGraphicsScene *scene, UiInformation *uiInfo, bool isFloating) +{ + QSize size = uiInfo->getConSize(); + + // draw color bar + scene->addRect(0, 0, size.width(), GPC_HEAD_BAR_HEIGHT, QPen(Qt::NoPen), + QBrush(uiInfo->getVMColor())); + + if (GPC_BORDER_SIZE > 0) { + float bsize = GPC_BORDER_SIZE / 2; + QPen borderPen(QColor(153, 153, 153), GPC_BORDER_SIZE, Qt::SolidLine); + if (isFloating) { // draw left border + scene->addLine(bsize, GPC_HEAD_BAR_HEIGHT + bsize, bsize, size.height(), borderPen); + } + // draw bottom border + scene->addLine(bsize, size.height() - bsize, size.width(), size.height() - bsize, borderPen); + // draw right border + scene->addLine(size.width() - bsize, GPC_HEAD_BAR_HEIGHT + bsize, size.width() - bsize, size.height(), borderPen); + } +} + QList<HWKeyButton *> GeneralPurposeCon::createButtons(QWidget *parent, ControllerForm *form) { QPoint topLeft = form->getCenteralRect().topLeft(); - topLeft.setX(topLeft.x() + GPC_LEFT_SPACING); + topLeft.setX(topLeft.x() + GPC_LEFT_SPACING + GPC_BORDER_SIZE); topLeft.setY(topLeft.y() + GPC_HEAD_SPACING); QList<HWKeyButton *> buttonList; diff --git a/tizen/src/ui/controller/generalpurposecon.h b/tizen/src/ui/controller/generalpurposecon.h index 44b263dd8b..8dfb18dd0e 100644 --- a/tizen/src/ui/controller/generalpurposecon.h +++ b/tizen/src/ui/controller/generalpurposecon.h @@ -33,8 +33,11 @@ #include "layout/hardwarekey.h" #include "controller/hwkeybutton.h" #include "layout/controllerform.h" +#include "uiinformation.h" -#define GPC_HEAD_SPACING (8) +#define GPC_HEAD_BAR_HEIGHT (5) +#define GPC_BORDER_SIZE (1.0) +#define GPC_HEAD_SPACING (8) + GPC_HEAD_BAR_HEIGHT #define GPC_LEFT_SPACING (8) #define GPC_TAIL_SPACING (8) #define GPC_KEYBUTTON_WIDTH (35) @@ -48,6 +51,7 @@ class GeneralPurposeCon public: GeneralPurposeCon(); ~GeneralPurposeCon(); + void createHeaderBarAndBorder(QGraphicsScene *scene, UiInformation *uiInfo, bool isFloating); QList<HWKeyButton *> createButtons(QWidget *parent, ControllerForm *form); private: diff --git a/tizen/src/ui/generalskinview.cpp b/tizen/src/ui/generalskinview.cpp index 1a8afad351..8817588563 100644 --- a/tizen/src/ui/generalskinview.cpp +++ b/tizen/src/ui/generalskinview.cpp @@ -90,7 +90,7 @@ void GeneralSkinView::createItems() scene()->addLine(BORDER_SIZE, HEADER_HEIGHT + BORDER_SIZE, size.width() - BORDER_SIZE, HEADER_HEIGHT + BORDER_SIZE, linePen); if (BORDER_SIZE > 0) { - QPen boaderPen(QColor(0, 138, 248), BORDER_SIZE * 2, Qt::SolidLine); + QPen boaderPen(win->getUiInfo()->getVMColor(), BORDER_SIZE * 2, Qt::SolidLine); scene()->addRect(0, 0, size.width(), size.height(), boaderPen); } diff --git a/tizen/src/ui/qt5_supplement.cpp b/tizen/src/ui/qt5_supplement.cpp index a4678662d7..d546ea8065 100644 --- a/tizen/src/ui/qt5_supplement.cpp +++ b/tizen/src/ui/qt5_supplement.cpp @@ -362,7 +362,7 @@ static void qt5_gui_init(void) } /* controller */ - const int defaultDockPos = Qt::AlignRight | Qt::AlignCenter; + const int defaultDockPos = Qt::AlignRight | Qt::AlignTop; mainwindow->getUiState()->getConState()->setRecentlyDockPos(defaultDockPos); int conIndex = mruInfo.value(SKIN_PROPERTY_CONTROLLER_INDEX).toInt(); diff --git a/tizen/src/ui/uiinformation.cpp b/tizen/src/ui/uiinformation.cpp index 894f86fac0..f8927624b3 100644 --- a/tizen/src/ui/uiinformation.cpp +++ b/tizen/src/ui/uiinformation.cpp @@ -88,28 +88,29 @@ QColor UiInformation::getVMColor() switch((basePort / 10) % 10) { case 0: - break; + return QColor(0, 150, 221); //#0096DD case 1: - return QColor(246, 226, 0); + return QColor(32, 212, 204); //#20D4CC case 2: - return QColor(0, 246, 12); + return QColor(229, 100, 172); //#E564AC case 3: - return QColor(168, 43, 255); + return QColor(255,138, 23); //#FF8A17 case 4: - return QColor(246, 110, 0); + return QColor(169, 125, 252); //#A97DFC case 5: - return QColor(245, 48, 233); + return QColor(226, 71, 94); //#E2475E case 6: - return QColor(94, 73, 255); + return QColor(255, 198, 0); //#FFC600 case 7: - return QColor(179, 246, 0); + return QColor(0, 166, 81); //#B8A288 case 8: - return QColor(245, 48, 48); + return QColor(29, 223, 221); //#00A651 case 9: - return QColor(29, 223, 221); + return QColor(141, 198, 64); //#8DC63F } - return QColor(0, 174, 239); + qWarning() << "invalid base port:" << basePort; + return QColor(0, 255, 0); } /* form */ diff --git a/tizen/src/ui/xmllayoutparser.cpp b/tizen/src/ui/xmllayoutparser.cpp index 4d0ba95a76..e65876e43d 100644 --- a/tizen/src/ui/xmllayoutparser.cpp +++ b/tizen/src/ui/xmllayoutparser.cpp @@ -802,8 +802,8 @@ void XmlLayoutParser::makeGeneralCon(ControllerForm *form) { int keyCount = form->getKeyList().count(); - int width = GPC_KEYBUTTON_WIDTH + GPC_KEYBUTTON_HSPACING; - int height = GPC_HEAD_SPACING; + int width = GPC_KEYBUTTON_WIDTH + GPC_KEYBUTTON_HSPACING + GPC_BORDER_SIZE * 2; + int height = GPC_HEAD_SPACING + GPC_BORDER_SIZE; height += (GPC_KEYBUTTON_HEIGHT * keyCount) + (GPC_KEYBUTTON_VSPACING * (keyCount - 1)); |