Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
172 changes: 95 additions & 77 deletions qt6/src/qml/AboutDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
import QtQuick.Window
import org.deepin.dtk 1.0 as D
import org.deepin.dtk.style 1.0 as DS
Expand All @@ -12,6 +13,8 @@ DialogWindow {
id: control
width: DS.Style.aboutDialog.width
height: DS.Style.aboutDialog.height
topPadding: 0
rightPadding: 0

property alias windowTitle: control.title
property alias productName: productNameLabel.text
Expand All @@ -30,7 +33,7 @@ DialogWindow {
RowLayout {
id: contentView
width: parent.width
implicitHeight: contentLayout.implicitHeight
height: control.height - DS.Style.dialogWindow.titleBarHeight

D.LicenseInfoProvider {
id: licensePathChecker
Expand Down Expand Up @@ -79,94 +82,109 @@ DialogWindow {
visible: control.license !== ""
}
}
ColumnLayout {
Flickable {
id: rightContentView
ScrollBar.vertical: ScrollBar {}
Layout.alignment: Qt.AlignLeft | Qt.AlignTop
spacing: 10
Layout.fillWidth: true
Layout.fillHeight: true
Layout.rightMargin: 20
ColumnLayout {
spacing: 1
Label {
font: D.DTK.fontManager.t10
text: qsTr("Version")
}
Label {
id: versionLabel
font: D.DTK.fontManager.t8
wrapMode: Text.WordWrap
text: Qt.application.version
Layout.fillWidth: true
}
}
ColumnLayout {
spacing: 1
Label {
font: D.DTK.fontManager.t10
text: qsTr("Homepage")
}
Label {
id: websiteLabel
font: D.DTK.fontManager.t8
textFormat: Text.RichText
text: (control.websiteLink === "" || control.websiteName === "") ?
"" : control.__websiteLinkTemplate.arg(websiteLink).arg(control.websiteName)
wrapMode: Text.WordWrap
Layout.fillWidth: true

MouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
acceptedButtons: Qt.NoButton
clip: true
contentWidth: width
contentHeight: rightContentLayout.height
boundsBehavior: Flickable.StopAtBounds
flickableDirection: Flickable.VerticalFlick

Item {
ColumnLayout {
id: rightContentLayout
width: rightContentView.width
spacing: 10

ColumnLayout {
spacing: 1
Label {
font: D.DTK.fontManager.t10
text: qsTr("Version")
}
Label {
id: versionLabel
font: D.DTK.fontManager.t8
wrapMode: Text.WordWrap
text: Qt.application.version
Layout.fillWidth: true
}
}
}
}
ColumnLayout {
spacing: 1
Label {
font: D.DTK.fontManager.t10
text: qsTr("Description")
}
Label {
id: descriptionLabel
Layout.fillWidth: true
font: D.DTK.fontManager.t8
wrapMode: Text.WordWrap
elide: Text.ElideRight
}
}
ColumnLayout {
spacing: 1
Label {
font: D.DTK.fontManager.t10
text: qsTr("Homepage")
}
Label {
id: websiteLabel
font: D.DTK.fontManager.t8
textFormat: Text.RichText
text: (control.websiteLink === "" || control.websiteName === "") ?
"" : control.__websiteLinkTemplate.arg(websiteLink).arg(control.websiteName)
wrapMode: Text.WordWrap
Layout.fillWidth: true

ColumnLayout {
spacing: 1
Label {
font: D.DTK.fontManager.t10
text: qsTr("Acknowledgements")
}
Label {
id: acknowledgmentsLabel
text: {
var softwareText = qsTr("open-source software");
if (licensePathChecker.valid)
return qsTr("Sincerely appreciate the %1 used.").arg(control.__websiteLinkTemplate.arg("-").arg(softwareText));
else
return qsTr("Sincerely appreciate the %1 used.").arg(softwareText);
MouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
acceptedButtons: Qt.NoButton
}
}
}
textFormat: Text.RichText
Layout.fillWidth: true
font: D.DTK.fontManager.t8
wrapMode: Text.WordWrap
ColumnLayout {
spacing: 1
Label {
font: D.DTK.fontManager.t10
text: qsTr("Description")
}
Label {
id: descriptionLabel
Layout.fillWidth: true
font: D.DTK.fontManager.t8
wrapMode: Text.WordWrap
elide: Text.ElideRight

onLinkActivated: function(link) {
licenseDialogLoader.active = true
}
}

HoverHandler {
cursorShape: acknowledgmentsLabel.hoveredLink !== "" ? Qt.PointingHandCursor : Qt.ArrowCursor
ColumnLayout {
Layout.bottomMargin: 30
spacing: 1
Label {
font: D.DTK.fontManager.t10
text: qsTr("Acknowledgements")
}
Label {
id: acknowledgmentsLabel
text: {
var softwareText = qsTr("open-source software");
if (licensePathChecker.valid)
return qsTr("Sincerely appreciate the %1 used.").arg(control.__websiteLinkTemplate.arg("-").arg(softwareText));
else
return qsTr("Sincerely appreciate the %1 used.").arg(softwareText);
}
textFormat: Text.RichText
Layout.fillWidth: true
font: D.DTK.fontManager.t8
wrapMode: Text.WordWrap
elide: Text.ElideRight

onLinkActivated: function(link) {
licenseDialogLoader.active = true
}

HoverHandler {
cursorShape: acknowledgmentsLabel.hoveredLink !== "" ? Qt.PointingHandCursor : Qt.ArrowCursor
}
}
}
}
}
}
}

Component.onCompleted: {
websiteLabel.linkActivated.connect(D.ApplicationHelper.openUrl)
Expand Down
13 changes: 9 additions & 4 deletions qt6/src/qml/DialogWindow.qml
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,17 @@ Window {
}
}

D.Label {
text: control.title
Loader {
active: title !== ""
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
elide: Text.ElideRight
horizontalAlignment: Text.AlignHCenter
sourceComponent: Component {
D.Label {
text: control.title
elide: Text.ElideRight
horizontalAlignment: Text.AlignHCenter
}
}
}

Item {
Expand Down
Loading