From kde-commits Mon Aug 31 21:47:33 2015 From: Bruno Coudoin Date: Mon, 31 Aug 2015 21:47:33 +0000 To: kde-commits Subject: [gcompris] src/activities/chess: chess, some minor layout adjustments Message-Id: X-MARC-Message: https://marc.info/?l=kde-commits&m=144105766204784 Git commit 2673e24fbdf02218b6983de1ffca6ffd995c38bc by Bruno Coudoin. Committed on 31/08/2015 at 21:42. Pushed by bcoudoin into branch 'master'. chess, some minor layout adjustments M +11 -3 src/activities/chess/Chess.qml http://commits.kde.org/gcompris/2673e24fbdf02218b6983de1ffca6ffd995c38bc diff --git a/src/activities/chess/Chess.qml b/src/activities/chess/Chess.qml index 062a4ae..cba75ec 100644 --- a/src/activities/chess/Chess.qml +++ b/src/activities/chess/Chess.qml @@ -64,7 +64,7 @@ ActivityBase { property alias background: background property alias bar: bar property alias bonus: bonus - property int cellSize: Math.min(background.width / (8 + 1), + property int cellSize: Math.min(background.width / (8 + 2), background.height / (8 + 3)) property variant fen: activity.fen property bool twoPlayer: activity.twoPlayers @@ -89,6 +89,7 @@ ActivityBase { top: parent.top topMargin: items.cellSize / 2 leftMargin: 10 * ApplicationInfo.ratio + rightMargin: 10 * ApplicationInfo.ratio } columns: 3 rows: 1 @@ -100,12 +101,19 @@ ActivityBase { Column { id: controls spacing: 10 - width: undo.width + (background.width * 0.9 - undo.width -= chessboard.width) / 2 + anchors { + leftMargin: 10 + rightMargin: 10 + } + width: Math.max(undo.width * 1.2, + Math.min( + (background.width * 0.9 - undo.width -= chessboard.width), + (background.width - chessboard.width) = / 2)) = GCText { color: "black" anchors.horizontalCenter: parent.horizontalCenter - width: undo.width * 1.2 + width: parent.width fontSize: smallSize text: items.message horizontalAlignment: Text.AlignHCenter