AppUI: 修改为平面化风格

参考: <<漫画设计配色方>>
https://wenku.baidu.com/view/b762760fcaaedd3382c4d357.html
选取 "大胆" 的配色。

修改使用 MOBILE_APP_UI 宏控制,目前未启用。
This commit is contained in:
CalciteM Team 2019-08-26 22:33:27 +08:00
parent b3de6783ac
commit 984ea751ea
4 changed files with 33 additions and 0 deletions

View File

@ -25,6 +25,8 @@
#pragma execution_character_set("utf-8") #pragma execution_character_set("utf-8")
#endif #endif
//#define MOBILE_APP_UI
//#define DEBUG_MODE //#define DEBUG_MODE
//#define DEBUG_MODE_A //#define DEBUG_MODE_A

View File

@ -92,14 +92,26 @@ void BoardItem::paint(QPainter *painter,
Q_UNUSED(widget) Q_UNUSED(widget)
// 填充阴影 // 填充阴影
#ifndef MOBILE_APP_UI
painter->fillRect(boundingRect(), QBrush(QColor(64, 64, 64))); painter->fillRect(boundingRect(), QBrush(QColor(64, 64, 64)));
#endif /* ! MOBILE_APP_UI */
// 填充图片 // 填充图片
#ifdef MOBILE_APP_UI
painter->setPen(Qt::NoPen);
painter->setBrush(QColor(239, 239, 239));
painter->drawRect(-size / 2, -size / 2, size, size);
#else
painter->drawPixmap(-size / 2, -size / 2, size, size, painter->drawPixmap(-size / 2, -size / 2, size, size,
QPixmap(":/image/resources/image/board.png")); QPixmap(":/image/resources/image/board.png"));
#endif /* MOBILE_APP_UI */
// 黑色实线画笔 // 黑色实线画笔
#ifdef MOBILE_APP_UI
QPen pen(QBrush(QColor(241, 156, 159)), LINE_WEIGHT, Qt::SolidLine, Qt::SquareCap, Qt::BevelJoin);
#else
QPen pen(QBrush(Qt::black), LINE_WEIGHT, Qt::SolidLine, Qt::SquareCap, Qt::BevelJoin); QPen pen(QBrush(Qt::black), LINE_WEIGHT, Qt::SolidLine, Qt::SquareCap, Qt::BevelJoin);
#endif
painter->setPen(pen); painter->setPen(pen);
// 空画刷 // 空画刷

View File

@ -58,6 +58,9 @@ GameController::GameController(GameScene & scene, QObject * parent) :
// 已在view的样式表中添加背景scene中不用添加背景 // 已在view的样式表中添加背景scene中不用添加背景
// 区别在于view中的背景不随视图变换而变换scene中的背景随视图变换而变换 // 区别在于view中的背景不随视图变换而变换scene中的背景随视图变换而变换
//scene.setBackgroundBrush(QPixmap(":/image/resources/image/background.png")); //scene.setBackgroundBrush(QPixmap(":/image/resources/image/background.png"));
#ifdef MOBILE_APP_UI
scene.setBackgroundBrush(QColor(239, 239, 239));
#endif /* MOBILE_APP_UI */
gameReset(); gameReset();

View File

@ -61,7 +61,11 @@ PieceItem::PieceItem(QGraphicsItem *parent) :
removeLineWeight = LINE_WEIGHT * 5; removeLineWeight = LINE_WEIGHT * 5;
// 选中线为黄色 // 选中线为黄色
#ifdef MOBILE_APP_UI
chooseLineColor = Qt::gray;
#else
chooseLineColor = Qt::darkYellow; chooseLineColor = Qt::darkYellow;
#endif /* MOBILE_APP_UI */
// 删除线为橘红色 // 删除线为橘红色
removeLineColor = QColor(0xff, 0x75, 0); removeLineColor = QColor(0xff, 0x75, 0);
@ -93,14 +97,26 @@ void PieceItem::paint(QPainter *painter,
switch (model_) { switch (model_) {
case blackPiece: case blackPiece:
// 如果模型为黑色,则画黑色棋子 // 如果模型为黑色,则画黑色棋子
#ifdef MOBILE_APP_UI
painter->setPen(Qt::NoPen);
painter->setBrush(QColor(0, 93, 172));
painter->drawEllipse(-size / 2, -size / 2, size, size);
#else
painter->drawPixmap(-size / 2, -size / 2, size, size, painter->drawPixmap(-size / 2, -size / 2, size, size,
QPixmap(":/image/resources/image/black_piece.png")); QPixmap(":/image/resources/image/black_piece.png"));
#endif /* MOBILE_APP_UI */
break; break;
case whitePiece: case whitePiece:
// 如果模型为白色,则画白色棋子 // 如果模型为白色,则画白色棋子
#ifdef MOBILE_APP_UI
painter->setPen(Qt::NoPen);
painter->setBrush(QColor(231, 36, 46));
painter->drawEllipse(-size / 2, -size / 2, size, size);
#else
painter->drawPixmap(-size / 2, -size / 2, size, size, painter->drawPixmap(-size / 2, -size / 2, size, size,
QPixmap(":/image/resources/image/white_piece.png")); QPixmap(":/image/resources/image/white_piece.png"));
#endif /* MOBILE_APP_UI */
break; break;
default: default:
break; break;