diff --git a/src/activities/calendar/Calendar.qml b/src/activities/calendar/Calendar.qml --- a/src/activities/calendar/Calendar.qml +++ b/src/activities/calendar/Calendar.qml @@ -82,12 +82,15 @@ Rectangle { id: calendarBox - width: items.horizontalLayout ? parent.width * 0.45 : (answerChoices.visible ? parent.width * 0.50 : parent.width * 0.70) - height: items.horizontalLayout ? parent.height * 0.70 : (answerChoices.visible ? parent.width * 0.50: parent.height * 0.40) + width: items.horizontalLayout ? (answerChoices.visible ? parent.width * 0.75 : parent.width * 0.80) : + (answerChoices.visible ? parent.width * 0.65 : parent.width * 0.85) + height: items.horizontalLayout ? parent.height * 0.75 : (answerChoices.visible ? parent.height * 0.17 : parent.height * 0.15) anchors.top: parent.top - anchors.topMargin: 100 + anchors.topMargin: 60 anchors.bottom: bar.top - anchors.bottomMargin: 50 + anchors.bottomMargin: items.horizontalLayout ? 50 : 70 + anchors.rightMargin: answerChoices.visible ? 100 : undefined + anchors.horizontalCenterOffset: answerChoices.visible ? 80 : 0 anchors.horizontalCenter: parent.horizontalCenter color: "black" opacity: 0.3 @@ -96,15 +99,15 @@ Calendar { id: calendar weekNumbersVisible: false - width: calendarBox.width * 0.85 - height: calendarBox.height * 0.85 + width: calendarBox.width * 0.90 + height: calendarBox.height * 0.90 anchors.centerIn: calendarBox frameVisible: true focus: !answerChoices.visible __locale: Qt.locale(ApplicationSettings.locale) style: CalendarStyle { navigationBar: Rectangle { - height: Math.round(TextSingleton.implicitHeight * 2.73) + height: calendar.height * 0.12 color: "lightBlue" Rectangle { color: Qt.rgba(1, 1, 1, 0.6) @@ -269,26 +272,27 @@ ListElement { text: qsTr("Saturday"); dayIndex: 6 } } + // Creates a table consisting of days of weeks. GridView { id: answerChoices model: daysOfTheWeekModel - anchors.top: calendarBox.top + anchors.top: parent.top anchors.left: questionItem.left - anchors.right: calendarBox.left + anchors.topMargin: 80 interactive: false property bool keyNavigation: false - width: calendar.width * 0.5 + width: items.horizontalLayout ? calendarBox.width * 0.22 : calendarBox.width * 0.4 height: (calendar.height / 6.5) * 7 cellWidth: calendar.width * 0.5 cellHeight: calendar.height / 6.5 keyNavigationWraps: true anchors.rightMargin: 10 * ApplicationInfo.ratio delegate: ChoiceTable { - width: calendar.width * 0.5 - height: calendar.height / 6.5 + width: answerChoices.width + height: answerChoices.height / 7 choices.text: text anchors.rightMargin: 2 } @@ -349,7 +353,7 @@ horizontalCenter: parent.horizontalCenter bottomMargin: 10 } - width: items.horizontalLayout ? calendarBox.width * 2 : parent.width - 20 + width: parent.width - 20 height: calendarBox.height * 0.125 gradient: Gradient { GradientStop { position: 0.0; color: "#000" } @@ -375,16 +379,14 @@ BarButton { id: okButton source: "qrc:/gcompris/src/core/resource/bar_ok.svg" - width: 50 * ApplicationInfo.ratio - height: width + height: items.horizontalLayout ? 50 * ApplicationInfo.ratio : 35 * ApplicationInfo.ratio + width: height sourceSize.width: width sourceSize.height: height - y: parent.height * 0.8 z: 10 - anchors { - horizontalCenter: score.horizontalCenter - bottom: calendarBox.bottom - } + anchors.top: calendarBox.bottom + anchors.right: calendarBox.right + anchors.margins: items.horizontalLayout ? 30 : 6 ParticleSystemStarLoader { id: okButtonParticles clip: false @@ -422,11 +424,11 @@ Score { id: score fontSize: items.horizontalLayout ? internalTextComponent.mediumSize : (answerChoices.visible ? internalTextComponent.smallSize : internalTextComponent.tinySize) - anchors.top: questionItemBackground.bottom + anchors.top: calendarBox.bottom anchors.bottom: undefined - anchors.left: calendarBox.right - anchors.right: undefined - anchors.margins: items.horizontalLayout ? 30 : 10 + anchors.left: undefined + anchors.right: answerChoices.visible ? calendarBox.right : okButton.left + anchors.margins: items.horizontalLayout ? 30 : 8 } } }