diff src/gui/dialog/about.cc @ 339:eac06513db86

dialog/about: add licenses button otherwise we wouldn't be complying with most of the libraries and external software we use
author Paper <paper@paper.us.eu.org>
date Wed, 19 Jun 2024 14:02:11 -0400
parents 92f63cf29faa
children 8d45d892be88
line wrap: on
line diff
--- a/src/gui/dialog/about.cc	Wed Jun 19 13:06:10 2024 -0400
+++ b/src/gui/dialog/about.cc	Wed Jun 19 14:02:11 2024 -0400
@@ -1,4 +1,5 @@
 #include "gui/dialog/about.h"
+#include "gui/dialog/licenses.h"
 #include "core/json.h"
 #include "core/session.h"
 #include "core/strings.h"
@@ -16,6 +17,7 @@
 #include <QTextBrowser>
 #include <QTextCharFormat>
 #include <QTextCursor>
+#include <QPushButton>
 
 #include <curl/curl.h>
 #ifdef WIN32
@@ -70,7 +72,7 @@
 	setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint);
 	setAutoFillBackground(true);
 
-	QHBoxLayout* layout = new QHBoxLayout(this);
+	QVBoxLayout* layout = new QVBoxLayout(this);
 
 	std::string html = fmt::format(about_template, session.version.to_string(), get_curl_version(), fugue_icons_version.to_string(), json_version.to_string(), pugixml_version.to_string(), semver_version.to_string(), utf8proc_version(), fmt_version.to_string());
 
@@ -86,6 +88,15 @@
 
 		layout->addWidget(paragraph);
 	}
+
+	{
+		QPushButton *license = new QPushButton("&Licenses", this);
+		layout->addWidget(license, Qt::AlignRight);
+		connect(license, &QPushButton::clicked, this, []{
+			LicensesWindow dialog;
+			dialog.exec();
+		});
+	}
 }
 
 void AboutWindow::showEvent(QShowEvent* event) {