diff --git a/interface/resources/qml/UpdateDialog.qml b/interface/resources/qml/UpdateDialog.qml index e5216ff619..5d901002f7 100644 --- a/interface/resources/qml/UpdateDialog.qml +++ b/interface/resources/qml/UpdateDialog.qml @@ -1,5 +1,6 @@ import Hifi 1.0 import QtQuick 2.3 +import QtQuick.Controls 1.3 import QtQuick.Controls.Styles 1.3 import QtGraphicalEffects 1.0 import "controls" @@ -85,33 +86,31 @@ DialogContainer { } } - Flickable { + ScrollView { id: scrollArea anchors { top: dialogTitle.bottom + topMargin: updateDialog.closeMargin + left: dialogTitle.left } - contentWidth: updateDialog.inputWidth - contentHeight: backgroundRectangle.height - (dialogTitle.height * 2.5) width: updateDialog.inputWidth - height: backgroundRectangle.height - (dialogTitle.height * 2.5) - flickableDirection: Flickable.VerticalFlick - clip: true - - TextEdit { + height: backgroundRectangle.height - (dialogTitle.height * 2.5) - updateDialog.closeMargin + horizontalScrollBarPolicy: Qt.ScrollBarAlwaysOff + verticalScrollBarPolicy: Qt.ScrollBarAsNeeded + + Text { id: releaseNotes - wrapMode: TextEdit.Wrap - width: parent.width - readOnly: true + wrapMode: Text.Wrap + width: parent.width - updateDialog.closeMargin text: updateDialog.releaseNotes font.pixelSize: 14 - color: hifi.colors.text + color: "#000000" anchors { left: parent.left - leftMargin: updateDialog.borderWidth } } } - + Rectangle { id: downloadButton width: updateDialog.buttonWidth @@ -122,7 +121,7 @@ DialogContainer { top: scrollArea.bottom topMargin: 10 right: backgroundRectangle.right - rightMargin: 15 + rightMargin: updateDialog.borderWidth } Text { text: "Upgrade" @@ -169,4 +168,4 @@ DialogContainer { } } } -} \ No newline at end of file +} diff --git a/interface/src/ui/UpdateDialog.cpp b/interface/src/ui/UpdateDialog.cpp index 69dfc343d9..12ac6dfd6c 100644 --- a/interface/src/ui/UpdateDialog.cpp +++ b/interface/src/ui/UpdateDialog.cpp @@ -24,9 +24,21 @@ UpdateDialog::UpdateDialog(QQuickItem* parent) : int currentVersion = QCoreApplication::applicationVersion().toInt(); int latestVersion = applicationUpdater.data()->getBuildData().lastKey(); int versionsBehind = latestVersion - currentVersion; - _updateAvailableDetails = "v" + QString::number(latestVersion) + " released on " + applicationUpdater.data()->getBuildData()[latestVersion]["releaseTime"]; - _updateAvailableDetails += "\nYou are " + QString::number(versionsBehind) + " versions behind"; - _releaseNotes = applicationUpdater.data()->getBuildData()[latestVersion]["releaseNotes"]; + _updateAvailableDetails = "v" + QString::number(latestVersion) + " released on " + + applicationUpdater.data()->getBuildData()[latestVersion]["releaseTime"]; + _updateAvailableDetails += "\nYou are " + QString::number(versionsBehind) + " version" + + (versionsBehind > 1 ? "s" : "") + " behind"; + + _releaseNotes = ""; + for (int i = latestVersion; i > currentVersion; i--) { + QString releaseNotes = applicationUpdater.data()->getBuildData()[i]["releaseNotes"]; + releaseNotes.remove("
"); + releaseNotes.remove(QRegExp("^\n")); + _releaseNotes += releaseNotes; + if (i > currentVersion + 1) { + _releaseNotes += "\n\n"; + } + } } const QString& UpdateDialog::updateAvailableDetails() const {