mirror of
https://gitlab.com/manzerbredes/ochess.git
synced 2025-04-06 01:56:28 +02:00
Improve UI
This commit is contained in:
parent
109a1bd697
commit
eec973bc05
2 changed files with 10 additions and 8 deletions
|
@ -258,13 +258,15 @@ void BoardCanvas::DrawBoard(wxDC &dc) {
|
|||
|
||||
// Draw captures (+player names) first for white then for black
|
||||
std::uint32_t captures_size = t_captures->GetPiecesSizes();
|
||||
std::uint8_t padding = numbers_size.y+10;
|
||||
std::uint8_t padding = 10;
|
||||
std::uint32_t offsetX = 0;
|
||||
std::uint32_t offsetY = -(captures_size + padding);
|
||||
std::uint32_t offsetYPlayerName=offsetY-captures_size;
|
||||
// White
|
||||
std::uint32_t offsetYPlayerName=offsetY-captures_size-padding; // For top player name we
|
||||
// add -padding at the end (ortherwise bottom of the letters
|
||||
// are to close to captured pieces)
|
||||
// White (black's captures):
|
||||
if (black_side) {
|
||||
offsetY = 8 * square_width + padding;
|
||||
offsetY = 8 * square_width + padding + numbers_size.y;
|
||||
offsetYPlayerName = offsetY+captures_size;
|
||||
}
|
||||
for (char p : {'P', 'N', 'B', 'R', 'Q'}) {
|
||||
|
@ -277,13 +279,13 @@ void BoardCanvas::DrawBoard(wxDC &dc) {
|
|||
}
|
||||
}
|
||||
dc.DrawText(wxString(black_player),boardX,boardY + offsetYPlayerName);
|
||||
// Black
|
||||
// Black (white's captures):
|
||||
offsetX = 0;
|
||||
if (black_side) {
|
||||
offsetY = -(captures_size + padding);
|
||||
offsetYPlayerName = offsetY-captures_size;
|
||||
offsetYPlayerName = offsetY-captures_size-padding; // Same for -padding (cf. for black's captures)
|
||||
} else {
|
||||
offsetY = 8 * square_width + padding;
|
||||
offsetY = 8 * square_width + padding + numbers_size.y;
|
||||
offsetYPlayerName = offsetY+captures_size;
|
||||
}
|
||||
for (char p : {'p', 'n', 'b', 'r', 'q'}) {
|
||||
|
|
|
@ -36,7 +36,7 @@ wxDECLARE_EVENT(NEXT_MOVE_EVENT, wxCommandEvent);
|
|||
(mouseX >= (x) && mouseX <= ((x) + (width)) && mouseY >= (y) && \
|
||||
mouseY <= ((y) + (height)))
|
||||
|
||||
#define CAPTURE_FACTOR 0.5
|
||||
#define CAPTURE_FACTOR 0.35
|
||||
#define SQUARE_NUM_PADDING 5
|
||||
typedef std::tuple<short, short, short> ClockTime;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue