settings: Add Piece highlight color setting

Default value is Red.
This commit is contained in:
Calcitem 2021-09-14 23:41:12 +08:00
parent c37bd7cc74
commit 795a3f3271
No known key found for this signature in database
GPG Key ID: F2F7C29E054CFB80
49 changed files with 201 additions and 2 deletions

View File

@ -66,6 +66,7 @@ class Config {
static int boardBackgroundColor = AppTheme.boardBackgroundColor.value; static int boardBackgroundColor = AppTheme.boardBackgroundColor.value;
static int whitePieceColor = AppTheme.whitePieceColor.value; static int whitePieceColor = AppTheme.whitePieceColor.value;
static int blackPieceColor = AppTheme.blackPieceColor.value; static int blackPieceColor = AppTheme.blackPieceColor.value;
static int pieceHighlightColor = AppTheme.pieceHighlightColor.value;
static int messageColor = AppTheme.messageColor.value; static int messageColor = AppTheme.messageColor.value;
static int drawerColor = AppTheme.drawerColor.value; static int drawerColor = AppTheme.drawerColor.value;
static int drawerBackgroundColor = AppTheme.drawerBackgroundColor.value; static int drawerBackgroundColor = AppTheme.drawerBackgroundColor.value;
@ -150,6 +151,8 @@ class Config {
settings['WhitePieceColor'] ?? AppTheme.whitePieceColor.value; settings['WhitePieceColor'] ?? AppTheme.whitePieceColor.value;
Config.blackPieceColor = Config.blackPieceColor =
settings['BlackPieceColor'] ?? AppTheme.blackPieceColor.value; settings['BlackPieceColor'] ?? AppTheme.blackPieceColor.value;
Config.pieceHighlightColor =
settings['PieceHighlightColor'] ?? AppTheme.pieceHighlightColor.value;
Config.messageColor = Config.messageColor =
settings['MessageColor'] ?? AppTheme.messageColor.value; settings['MessageColor'] ?? AppTheme.messageColor.value;
Config.drawerColor = settings['DrawerColor'] ?? AppTheme.drawerColor.value; Config.drawerColor = settings['DrawerColor'] ?? AppTheme.drawerColor.value;
@ -247,6 +250,7 @@ class Config {
settings['BoardBackgroundColor'] = Config.boardBackgroundColor; settings['BoardBackgroundColor'] = Config.boardBackgroundColor;
settings['WhitePieceColor'] = Config.whitePieceColor; settings['WhitePieceColor'] = Config.whitePieceColor;
settings['BlackPieceColor'] = Config.blackPieceColor; settings['BlackPieceColor'] = Config.blackPieceColor;
settings['PieceHighlightColor'] = Config.pieceHighlightColor;
settings['MessageColor'] = Config.messageColor; settings['MessageColor'] = Config.messageColor;
settings['DrawerColor'] = Config.drawerColor; settings['DrawerColor'] = Config.drawerColor;
settings['DrawerBackgroundColor'] = Config.drawerBackgroundColor; settings['DrawerBackgroundColor'] = Config.drawerBackgroundColor;

View File

@ -1192,5 +1192,9 @@
"draw": "يرسم", "draw": "يرسم",
"@draw": { "@draw": {
"description": "Draw" "description": "Draw"
},
"pieceHighlightColor": "لون تسليط الضوء على قطعة",
"@pieceHighlightColor": {
"description": "Piece highlight color"
} }
} }

View File

@ -1192,5 +1192,9 @@
"draw": "Рисувам", "draw": "Рисувам",
"@draw": { "@draw": {
"description": "Draw" "description": "Draw"
},
"pieceHighlightColor": "Цвят за подчертаване на парче",
"@pieceHighlightColor": {
"description": "Piece highlight color"
} }
} }

View File

@ -1192,5 +1192,9 @@
"draw": "আঁকা", "draw": "আঁকা",
"@draw": { "@draw": {
"description": "Draw" "description": "Draw"
},
"pieceHighlightColor": "পিস হাইলাইট কালার",
"@pieceHighlightColor": {
"description": "Piece highlight color"
} }
} }

View File

@ -1192,5 +1192,9 @@
"draw": "Kreslit", "draw": "Kreslit",
"@draw": { "@draw": {
"description": "Draw" "description": "Draw"
},
"pieceHighlightColor": "Barva zvýraznění kusu",
"@pieceHighlightColor": {
"description": "Piece highlight color"
} }
} }

View File

@ -1192,5 +1192,9 @@
"draw": "Tegne", "draw": "Tegne",
"@draw": { "@draw": {
"description": "Draw" "description": "Draw"
},
"pieceHighlightColor": "Stykke fremhæve farve",
"@pieceHighlightColor": {
"description": "Piece highlight color"
} }
} }

View File

@ -1192,5 +1192,9 @@
"draw": "Zeichnen", "draw": "Zeichnen",
"@draw": { "@draw": {
"description": "Draw" "description": "Draw"
},
"pieceHighlightColor": "Farbe des Stein-Highlights",
"@pieceHighlightColor": {
"description": "Piece highlight color"
} }
} }

View File

@ -1192,5 +1192,9 @@
"draw": "Zeichnen", "draw": "Zeichnen",
"@draw": { "@draw": {
"description": "Draw" "description": "Draw"
},
"pieceHighlightColor": "Farbe des Stein-Highlights",
"@pieceHighlightColor": {
"description": "Piece highlight color"
} }
} }

View File

@ -1192,5 +1192,9 @@
"draw": "Σχεδιάζω", "draw": "Σχεδιάζω",
"@draw": { "@draw": {
"description": "Draw" "description": "Draw"
},
"pieceHighlightColor": "Χρώμα φωτισμού κομμάτι",
"@pieceHighlightColor": {
"description": "Piece highlight color"
} }
} }

View File

@ -1192,5 +1192,9 @@
"draw": "Draw", "draw": "Draw",
"@draw": { "@draw": {
"description": "Draw" "description": "Draw"
},
"pieceHighlightColor": "Piece highlight color",
"@pieceHighlightColor": {
"description": "Piece highlight color"
} }
} }

View File

@ -1192,5 +1192,9 @@
"draw": "Dibujar", "draw": "Dibujar",
"@draw": { "@draw": {
"description": "Draw" "description": "Draw"
},
"pieceHighlightColor": "Color de resaltado de la pieza",
"@pieceHighlightColor": {
"description": "Piece highlight color"
} }
} }

View File

@ -1192,5 +1192,9 @@
"draw": "Joonista", "draw": "Joonista",
"@draw": { "@draw": {
"description": "Draw" "description": "Draw"
},
"pieceHighlightColor": "Tükk esiletõstetud värv",
"@pieceHighlightColor": {
"description": "Piece highlight color"
} }
} }

View File

@ -1192,5 +1192,9 @@
"draw": "قرعه کشی", "draw": "قرعه کشی",
"@draw": { "@draw": {
"description": "Draw" "description": "Draw"
},
"pieceHighlightColor": "رنگ برجسته آجیل",
"@pieceHighlightColor": {
"description": "Piece highlight color"
} }
} }

View File

@ -1192,5 +1192,9 @@
"draw": "Tasapeli", "draw": "Tasapeli",
"@draw": { "@draw": {
"description": "Draw" "description": "Draw"
},
"pieceHighlightColor": "Kappaleen korostusväri",
"@pieceHighlightColor": {
"description": "Piece highlight color"
} }
} }

View File

@ -1192,5 +1192,9 @@
"draw": "Dessiner", "draw": "Dessiner",
"@draw": { "@draw": {
"description": "Draw" "description": "Draw"
},
"pieceHighlightColor": "Couleur de surbrillance de la pièce",
"@pieceHighlightColor": {
"description": "Piece highlight color"
} }
} }

View File

@ -1192,5 +1192,9 @@
"draw": "દોરો", "draw": "દોરો",
"@draw": { "@draw": {
"description": "Draw" "description": "Draw"
},
"pieceHighlightColor": "પીસ હાઇલાઇટ કલર",
"@pieceHighlightColor": {
"description": "Piece highlight color"
} }
} }

View File

@ -1192,5 +1192,9 @@
"draw": "खींचना", "draw": "खींचना",
"@draw": { "@draw": {
"description": "Draw" "description": "Draw"
},
"pieceHighlightColor": "टुकड़ा हाइलाइट रंग",
"@pieceHighlightColor": {
"description": "Piece highlight color"
} }
} }

View File

@ -1192,5 +1192,9 @@
"draw": "crtati", "draw": "crtati",
"@draw": { "@draw": {
"description": "Draw" "description": "Draw"
},
"pieceHighlightColor": "Boja isticanja komada",
"@pieceHighlightColor": {
"description": "Piece highlight color"
} }
} }

View File

@ -1192,5 +1192,9 @@
"draw": "Húz", "draw": "Húz",
"@draw": { "@draw": {
"description": "Draw" "description": "Draw"
},
"pieceHighlightColor": "A lemez kiemelésének színe",
"@pieceHighlightColor": {
"description": "Piece highlight color"
} }
} }

View File

@ -1192,5 +1192,9 @@
"draw": "Seri", "draw": "Seri",
"@draw": { "@draw": {
"description": "Draw" "description": "Draw"
},
"pieceHighlightColor": "Warna sorot potongan",
"@pieceHighlightColor": {
"description": "Piece highlight color"
} }
} }

View File

@ -1192,5 +1192,9 @@
"draw": "Disegno", "draw": "Disegno",
"@draw": { "@draw": {
"description": "Draw" "description": "Draw"
},
"pieceHighlightColor": "Colore evidenziazione pezzo",
"@pieceHighlightColor": {
"description": "Piece highlight color"
} }
} }

View File

@ -1192,5 +1192,9 @@
"draw": "描く", "draw": "描く",
"@draw": { "@draw": {
"description": "Draw" "description": "Draw"
},
"pieceHighlightColor": "チェッカーのハイライト色",
"@pieceHighlightColor": {
"description": "Piece highlight color"
} }
} }

View File

@ -1192,5 +1192,9 @@
"draw": "ಡ್ರಾ", "draw": "ಡ್ರಾ",
"@draw": { "@draw": {
"description": "Draw" "description": "Draw"
},
"pieceHighlightColor": "ಪೀಸ್ ಹೈಲೈಟ್ ಬಣ್ಣ",
"@pieceHighlightColor": {
"description": "Piece highlight color"
} }
} }

View File

@ -1192,5 +1192,9 @@
"draw": "그리다", "draw": "그리다",
"@draw": { "@draw": {
"description": "Draw" "description": "Draw"
},
"pieceHighlightColor": "체크 하이라이트 색상",
"@pieceHighlightColor": {
"description": "Piece highlight color"
} }
} }

View File

@ -1192,5 +1192,9 @@
"draw": "Lygiosios", "draw": "Lygiosios",
"@draw": { "@draw": {
"description": "Draw" "description": "Draw"
},
"pieceHighlightColor": "Kūrinio paryškinimo spalva",
"@pieceHighlightColor": {
"description": "Piece highlight color"
} }
} }

View File

@ -1192,5 +1192,9 @@
"draw": "Zīmēt", "draw": "Zīmēt",
"@draw": { "@draw": {
"description": "Draw" "description": "Draw"
},
"pieceHighlightColor": "Gabalu izceltā krāsa",
"@pieceHighlightColor": {
"description": "Piece highlight color"
} }
} }

View File

@ -1192,5 +1192,9 @@
"draw": "Нацртај", "draw": "Нацртај",
"@draw": { "@draw": {
"description": "Draw" "description": "Draw"
},
"pieceHighlightColor": "Боја за истакнување на парче",
"@pieceHighlightColor": {
"description": "Piece highlight color"
} }
} }

View File

@ -1192,5 +1192,9 @@
"draw": "Lukis", "draw": "Lukis",
"@draw": { "@draw": {
"description": "Draw" "description": "Draw"
},
"pieceHighlightColor": "Warna kemuncak kepingan",
"@pieceHighlightColor": {
"description": "Piece highlight color"
} }
} }

View File

@ -1192,5 +1192,9 @@
"draw": "Tekenen", "draw": "Tekenen",
"@draw": { "@draw": {
"description": "Draw" "description": "Draw"
},
"pieceHighlightColor": "Stuk markeerkleur",
"@pieceHighlightColor": {
"description": "Piece highlight color"
} }
} }

View File

@ -1192,5 +1192,9 @@
"draw": "Tegne", "draw": "Tegne",
"@draw": { "@draw": {
"description": "Draw" "description": "Draw"
},
"pieceHighlightColor": "Farge på høydepunktet",
"@pieceHighlightColor": {
"description": "Piece highlight color"
} }
} }

View File

@ -1192,5 +1192,9 @@
"draw": "Remis", "draw": "Remis",
"@draw": { "@draw": {
"description": "Draw" "description": "Draw"
},
"pieceHighlightColor": "Kolor podświetlenia kawałka",
"@pieceHighlightColor": {
"description": "Piece highlight color"
} }
} }

View File

@ -1192,5 +1192,9 @@
"draw": "Empate", "draw": "Empate",
"@draw": { "@draw": {
"description": "Draw" "description": "Draw"
},
"pieceHighlightColor": "Cor de destaque da peça",
"@pieceHighlightColor": {
"description": "Piece highlight color"
} }
} }

View File

@ -1192,5 +1192,9 @@
"draw": "A desena", "draw": "A desena",
"@draw": { "@draw": {
"description": "Draw" "description": "Draw"
},
"pieceHighlightColor": "Culoarea de evidențiere a piesei",
"@pieceHighlightColor": {
"description": "Piece highlight color"
} }
} }

View File

@ -1192,5 +1192,9 @@
"draw": "Рисовать", "draw": "Рисовать",
"@draw": { "@draw": {
"description": "Draw" "description": "Draw"
},
"pieceHighlightColor": "Цвет выделения детали",
"@pieceHighlightColor": {
"description": "Piece highlight color"
} }
} }

View File

@ -1192,5 +1192,9 @@
"draw": "Nakreslite", "draw": "Nakreslite",
"@draw": { "@draw": {
"description": "Draw" "description": "Draw"
},
"pieceHighlightColor": "Farba zvýraznenia kusu",
"@pieceHighlightColor": {
"description": "Piece highlight color"
} }
} }

View File

@ -1192,5 +1192,9 @@
"draw": "Žrebanje", "draw": "Žrebanje",
"@draw": { "@draw": {
"description": "Draw" "description": "Draw"
},
"pieceHighlightColor": "Barva poudarka kosa",
"@pieceHighlightColor": {
"description": "Piece highlight color"
} }
} }

View File

@ -1192,5 +1192,9 @@
"draw": "Barazim", "draw": "Barazim",
"@draw": { "@draw": {
"description": "Draw" "description": "Draw"
},
"pieceHighlightColor": "Ngjyra e theksimit të copës",
"@pieceHighlightColor": {
"description": "Piece highlight color"
} }
} }

View File

@ -1192,5 +1192,9 @@
"draw": "Нерешено", "draw": "Нерешено",
"@draw": { "@draw": {
"description": "Draw" "description": "Draw"
},
"pieceHighlightColor": "Боја за истакнување на парче",
"@pieceHighlightColor": {
"description": "Piece highlight color"
} }
} }

View File

@ -1192,5 +1192,9 @@
"draw": "Dra", "draw": "Dra",
"@draw": { "@draw": {
"description": "Draw" "description": "Draw"
},
"pieceHighlightColor": "Del markera färg",
"@pieceHighlightColor": {
"description": "Piece highlight color"
} }
} }

View File

@ -1192,5 +1192,9 @@
"draw": "గీయండి", "draw": "గీయండి",
"@draw": { "@draw": {
"description": "Draw" "description": "Draw"
},
"pieceHighlightColor": "పీస్ హైలైట్ రంగు",
"@pieceHighlightColor": {
"description": "Piece highlight color"
} }
} }

View File

@ -1192,5 +1192,9 @@
"draw": "วาด", "draw": "วาด",
"@draw": { "@draw": {
"description": "Draw" "description": "Draw"
},
"pieceHighlightColor": "ชิ้นไฮไลท์สี",
"@pieceHighlightColor": {
"description": "Piece highlight color"
} }
} }

View File

@ -1192,5 +1192,9 @@
"draw": "Çizmek", "draw": "Çizmek",
"@draw": { "@draw": {
"description": "Draw" "description": "Draw"
},
"pieceHighlightColor": "Parça vurgu rengi",
"@pieceHighlightColor": {
"description": "Piece highlight color"
} }
} }

View File

@ -1192,5 +1192,9 @@
"draw": "Chizma", "draw": "Chizma",
"@draw": { "@draw": {
"description": "Draw" "description": "Draw"
},
"pieceHighlightColor": "Rangni ajratib ko'rsatish",
"@pieceHighlightColor": {
"description": "Piece highlight color"
} }
} }

View File

@ -1192,5 +1192,9 @@
"draw": "Vẽ", "draw": "Vẽ",
"@draw": { "@draw": {
"description": "Draw" "description": "Draw"
},
"pieceHighlightColor": "Màu nổi bật mảnh",
"@pieceHighlightColor": {
"description": "Piece highlight color"
} }
} }

View File

@ -1192,5 +1192,9 @@
"draw": "和棋", "draw": "和棋",
"@draw": { "@draw": {
"description": "Draw" "description": "Draw"
},
"pieceHighlightColor": "棋子高亮颜色",
"@pieceHighlightColor": {
"description": "Piece highlight color"
} }
} }

View File

@ -1192,5 +1192,9 @@
"draw": "Draw", "draw": "Draw",
"@draw": { "@draw": {
"description": "Draw" "description": "Draw"
},
"pieceHighlightColor": "棋子高亮顏色",
"@pieceHighlightColor": {
"description": "Piece highlight color"
} }
} }

View File

@ -184,6 +184,7 @@ class PiecesPainter extends PiecesBasePainter {
if (focusIndex != invalidIndex) { if (focusIndex != invalidIndex) {
final int row = focusIndex! ~/ 7, column = focusIndex % 7; final int row = focusIndex! ~/ 7, column = focusIndex % 7;
/*
focusPositionColor = Color.fromARGB( focusPositionColor = Color.fromARGB(
(Color(Config.whitePieceColor).alpha + (Color(Config.whitePieceColor).alpha +
Color(Config.blackPieceColor).alpha) ~/ Color(Config.blackPieceColor).alpha) ~/
@ -198,6 +199,9 @@ class PiecesPainter extends PiecesBasePainter {
Color(Config.blackPieceColor).blue) ~/ Color(Config.blackPieceColor).blue) ~/
2) 2)
.withOpacity(0.5); .withOpacity(0.5);
*/
focusPositionColor = Color(Config.pieceHighlightColor);
paint.color = focusPositionColor; paint.color = focusPositionColor;
paint.style = PaintingStyle.stroke; paint.style = PaintingStyle.stroke;

View File

@ -26,10 +26,11 @@ class AppTheme {
static var mainToolbarBackgroundColor = UIColors.burlyWood; static var mainToolbarBackgroundColor = UIColors.burlyWood;
static var navigationToolbarBackgroundColor = UIColors.burlyWood; static var navigationToolbarBackgroundColor = UIColors.burlyWood;
static var boardLineColor = Color(0x996D000D); static var boardLineColor = Color(0x996D000D);
static var blackPieceColor = Color.fromARGB(0xFF, 0x00, 0x00, 0x00);
static var blackPieceBorderColor = Color.fromARGB(0xFF, 0x22, 0x22, 0x22);
static var whitePieceColor = Color.fromARGB(0xFF, 0xFF, 0xFF, 0xFF); static var whitePieceColor = Color.fromARGB(0xFF, 0xFF, 0xFF, 0xFF);
static var whitePieceBorderColor = Color.fromARGB(0xFF, 0x66, 0x00, 0x00); static var whitePieceBorderColor = Color.fromARGB(0xFF, 0x66, 0x00, 0x00);
static var blackPieceColor = Color.fromARGB(0xFF, 0x00, 0x00, 0x00);
static var blackPieceBorderColor = Color.fromARGB(0xFF, 0x22, 0x22, 0x22);
static var pieceHighlightColor = Colors.red;
static var messageColor = Colors.white; static var messageColor = Colors.white;
static var banColor = Color.fromARGB(0xFF, 0xFF, 0x00, 0x00); // unused static var banColor = Color.fromARGB(0xFF, 0xFF, 0x00, 0x00); // unused
static var banBorderColor = Color.fromARGB(0x80, 0xFF, 0x00, 0x00); // unused static var banBorderColor = Color.fromARGB(0x80, 0xFF, 0x00, 0x00); // unused

View File

@ -58,6 +58,7 @@ class _PersonalizationSettingsPageState
S.of(context).lineColor: Config.boardLineColor, S.of(context).lineColor: Config.boardLineColor,
S.of(context).whitePieceColor: Config.whitePieceColor, S.of(context).whitePieceColor: Config.whitePieceColor,
S.of(context).blackPieceColor: Config.blackPieceColor, S.of(context).blackPieceColor: Config.blackPieceColor,
S.of(context).pieceHighlightColor: Config.pieceHighlightColor,
S.of(context).messageColor: Config.messageColor, S.of(context).messageColor: Config.messageColor,
S.of(context).drawerColor: Config.drawerColor, S.of(context).drawerColor: Config.drawerColor,
S.of(context).drawerBackgroundColor: Config.drawerBackgroundColor, S.of(context).drawerBackgroundColor: Config.drawerBackgroundColor,
@ -109,6 +110,8 @@ class _PersonalizationSettingsPageState
Config.whitePieceColor = pickerColor.value; Config.whitePieceColor = pickerColor.value;
} else if (colorString == S.of(context).blackPieceColor) { } else if (colorString == S.of(context).blackPieceColor) {
Config.blackPieceColor = pickerColor.value; Config.blackPieceColor = pickerColor.value;
} else if (colorString == S.of(context).pieceHighlightColor) {
Config.pieceHighlightColor = pickerColor.value;
} else if (colorString == S.of(context).messageColor) { } else if (colorString == S.of(context).messageColor) {
Config.messageColor = pickerColor.value; Config.messageColor = pickerColor.value;
} else if (colorString == S.of(context).drawerColor) { } else if (colorString == S.of(context).drawerColor) {
@ -517,6 +520,13 @@ class _PersonalizationSettingsPageState
onTap: () => showColorDialog(S.of(context).blackPieceColor), onTap: () => showColorDialog(S.of(context).blackPieceColor),
), ),
ListItemDivider(), ListItemDivider(),
SettingsListTile(
context: context,
titleString: S.of(context).pieceHighlightColor,
trailingColor: Config.pieceHighlightColor,
onTap: () => showColorDialog(S.of(context).pieceHighlightColor),
),
ListItemDivider(),
SettingsListTile( SettingsListTile(
context: context, context: context,
titleString: S.of(context).messageColor, titleString: S.of(context).messageColor,