Skip to content

Commit e26ce45

Browse files
committed
feat(ui): add application about dialog
- Add an overflow action for About CodecDeck - Show the application icon, version, project link, and MIT license - Keep the displayed version sourced from Qt application metadata
1 parent c304624 commit e26ce45

3 files changed

Lines changed: 75 additions & 0 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ qt_add_qml_module(codecdeck
3939
VERSION 1.0
4040
NO_IMPORT_SCAN
4141
QML_FILES
42+
qml/AboutDialog.qml
4243
qml/Main.qml
4344
)
4445

qml/AboutDialog.qml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
import QtQuick
2+
import QtQuick.Controls
3+
import QtQuick.Layouts
4+
import org.kde.kirigami as Kirigami
5+
6+
Kirigami.Dialog {
7+
title: "About CodecDeck"
8+
preferredWidth: Kirigami.Units.gridUnit * 24
9+
standardButtons: Kirigami.Dialog.Close
10+
11+
Item {
12+
implicitWidth: Kirigami.Units.gridUnit * 22
13+
implicitHeight: aboutLayout.implicitHeight + Kirigami.Units.largeSpacing * 2
14+
15+
ColumnLayout {
16+
id: aboutLayout
17+
anchors.fill: parent
18+
anchors.margins: Kirigami.Units.largeSpacing
19+
spacing: Kirigami.Units.smallSpacing
20+
21+
Kirigami.Icon {
22+
source: "qrc:/icons/io.github.mizuikki.CodecDeck.png"
23+
Layout.alignment: Qt.AlignHCenter
24+
Layout.preferredWidth: Kirigami.Units.iconSizes.huge
25+
Layout.preferredHeight: Kirigami.Units.iconSizes.huge
26+
}
27+
28+
Kirigami.Heading {
29+
text: "CodecDeck"
30+
level: 2
31+
Layout.alignment: Qt.AlignHCenter
32+
}
33+
34+
Label {
35+
text: "Version " + Qt.application.version
36+
color: Kirigami.Theme.disabledTextColor
37+
Layout.alignment: Qt.AlignHCenter
38+
}
39+
40+
Label {
41+
text: "Control Bluetooth audio codecs on PipeWire and WirePlumber."
42+
horizontalAlignment: Text.AlignHCenter
43+
wrapMode: Text.WordWrap
44+
Layout.fillWidth: true
45+
Layout.topMargin: Kirigami.Units.smallSpacing
46+
}
47+
48+
Label {
49+
text: '<a href="https://github.com/mizuikki/codecdeck">github.com/mizuikki/codecdeck</a>'
50+
textFormat: Text.RichText
51+
Layout.alignment: Qt.AlignHCenter
52+
Layout.topMargin: Kirigami.Units.smallSpacing
53+
onLinkActivated: function(link) { Qt.openUrlExternally(link) }
54+
}
55+
56+
Label {
57+
text: '<a href="https://github.com/mizuikki/codecdeck/blob/main/LICENSE">MIT License</a>'
58+
textFormat: Text.RichText
59+
Layout.alignment: Qt.AlignHCenter
60+
onLinkActivated: function(link) { Qt.openUrlExternally(link) }
61+
}
62+
}
63+
}
64+
}

qml/Main.qml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ Kirigami.ApplicationWindow {
4747
return profiles.length > 0 ? 0 : -1
4848
}
4949

50+
AboutDialog {
51+
id: aboutDialog
52+
}
53+
5054
pageStack.initialPage: Kirigami.Page {
5155
title: "CodecDeck"
5256
padding: 0
@@ -62,6 +66,12 @@ Kirigami.ApplicationWindow {
6266
icon.name: "network-bluetooth"
6367
enabled: !!root.currentDevice.bluezPath && !Backend.busy
6468
onTriggered: Backend.refreshCapabilities()
69+
},
70+
Kirigami.Action {
71+
text: "About CodecDeck"
72+
icon.name: "help-about"
73+
displayHint: Kirigami.DisplayHint.AlwaysHide
74+
onTriggered: aboutDialog.open()
6575
}
6676
]
6777

0 commit comments

Comments
 (0)