diff src/gui/dialog/licenses.cc @ 370:ea3a74ed2ef9

*: hm, last commit wasn't quite finished?
author Paper <paper@tflc.us>
date Fri, 25 Jul 2025 10:22:04 -0400
parents 6d37a998cf91
children
line wrap: on
line diff
--- a/src/gui/dialog/licenses.cc	Fri Jul 25 10:16:02 2025 -0400
+++ b/src/gui/dialog/licenses.cc	Fri Jul 25 10:22:04 2025 -0400
@@ -7,28 +7,30 @@
 #include <fmt/core.h>
 
 #include <QCoreApplication>
+#include <QFile>
 #include <QFont>
 #include <QHBoxLayout>
 #include <QTabWidget>
 #include <QTextBrowser>
 #include <QTextCharFormat>
 #include <QTextCursor>
-#include <QFile>
 
 #include <curl/curl.h>
 #ifdef WIN32
-#	include "sys/win32/dark_theme.h"
+# include "sys/win32/dark_theme.h"
 #endif
 
-static QWidget *create_license_widget(QWidget *parent, const QString& license) {
-	QTextBrowser* paragraph = new QTextBrowser(parent);
+static QWidget *create_license_widget(QWidget *parent, const QString &license)
+{
+	QTextBrowser *paragraph = new QTextBrowser(parent);
 	paragraph->setFrameShape(QFrame::NoFrame);
 	paragraph->setPlainText(license);
 	paragraph->setFont(QFont("monospace"));
 	return paragraph;
 }
 
-static void create_basic_license(QTabWidget *tab_widget, const QString& filename, const QString& title) {
+static void create_basic_license(QTabWidget *tab_widget, const QString &filename, const QString &title)
+{
 	QFile f(filename);
 	if (!f.exists())
 		return;
@@ -37,7 +39,9 @@
 	tab_widget->addTab(create_license_widget(tab_widget, f.readAll()), title);
 }
 
-static void create_dual_license(QTabWidget *tab_widget, const QString& filename1, const QString& title1, const QString& filename2, const QString& title2) {
+static void create_dual_license(QTabWidget *tab_widget, const QString &filename1, const QString &title1,
+                                const QString &filename2, const QString &title2)
+{
 	QString l1, l2;
 	{
 		QFile f1(filename1), f2(filename2);
@@ -54,7 +58,11 @@
 	QWidget *dual = new QWidget(tab_widget);
 	QVBoxLayout *dual_layout = new QVBoxLayout(dual);
 
-	QLabel *dual_notice = new QLabel(QCoreApplication::tr("%1 was originally forked from %2, where any changes divergent from %2 are now under a different license. Both the licenses for %1 and %2 are provided below, respectfully:").arg(title1, title2), dual);
+	QLabel *dual_notice = new QLabel(
+	    QCoreApplication::tr("%1 was originally forked from %2, where any changes divergent from %2 are now under a "
+	                         "different license. Both the licenses for %1 and %2 are provided below, respectfully:")
+	        .arg(title1, title2),
+	    dual);
 	dual_notice->setWordWrap(true);
 	dual_layout->addWidget(dual_notice);
 	dual_layout->addWidget(create_license_widget(dual, l1));
@@ -63,13 +71,14 @@
 	tab_widget->addTab(dual, title1);
 }
 
-LicensesWindow::LicensesWindow(QWidget* parent) : Dialog(parent) {
+LicensesWindow::LicensesWindow(QWidget *parent) : Dialog(parent)
+{
 	resize(641, 500);
 	setWindowTitle(tr("About Minori"));
 	setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint);
 	setAutoFillBackground(true);
 
-	QHBoxLayout* layout = new QHBoxLayout(this);
+	QHBoxLayout *layout = new QHBoxLayout(this);
 
 	setBackgroundRole(QPalette::Base);
 
@@ -79,7 +88,8 @@
 
 	create_basic_license(tab_widget, ":/licenses/LICENSE.minori", tr("Minori"));
 
-	create_dual_license(tab_widget, ":/licenses/LICENSE.MIT.animone", tr("Animone"), ":/licenses/LICENSE.BSD.animone", tr("Anisthesia"));
+	create_dual_license(tab_widget, ":/licenses/LICENSE.MIT.animone", tr("Animone"), ":/licenses/LICENSE.BSD.animone",
+	                    tr("Anisthesia"));
 
 	create_basic_license(tab_widget, ":/licenses/LICENSE.anitomy", tr("Anitomy"));
 	create_basic_license(tab_widget, ":/licenses/LICENSE.fmt", tr("fmt"));