mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-06-05 21:59:17 +02:00
Issue #200: Icons under dark theme on Arch/KDE is broken
This commit is contained in:
@ -18,6 +18,7 @@
|
||||
#include "pdfviewermainwindow.h"
|
||||
#include "pdfconstants.h"
|
||||
#include "pdfsecurityhandler.h"
|
||||
#include "pdfwidgetutils.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QCommandLineParser>
|
||||
@ -33,10 +34,14 @@ int main(int argc, char *argv[])
|
||||
QApplication::setApplicationDisplayName(QApplication::translate("Application", "PDF4QT Viewer"));
|
||||
|
||||
QCommandLineOption noDrm("no-drm", "Disable DRM settings of documents.");
|
||||
QCommandLineOption lightGui("theme-light", "Use a light theme for the GUI.");
|
||||
QCommandLineOption darkGui("theme-dark", "Use a dark theme for the GUI.");
|
||||
|
||||
QCommandLineParser parser;
|
||||
parser.setApplicationDescription(QCoreApplication::applicationName());
|
||||
parser.addOption(noDrm);
|
||||
parser.addOption(lightGui);
|
||||
parser.addOption(darkGui);
|
||||
parser.addHelpOption();
|
||||
parser.addVersionOption();
|
||||
parser.addPositionalArgument("file", "The PDF file to open.");
|
||||
@ -47,6 +52,16 @@ int main(int argc, char *argv[])
|
||||
pdf::PDFSecurityHandler::setNoDRMMode();
|
||||
}
|
||||
|
||||
if (parser.isSet(lightGui))
|
||||
{
|
||||
pdf::PDFWidgetUtils::setDarkTheme(false);
|
||||
}
|
||||
|
||||
if (parser.isSet(darkGui))
|
||||
{
|
||||
pdf::PDFWidgetUtils::setDarkTheme(true);
|
||||
}
|
||||
|
||||
QIcon appIcon(":/app-icon.svg");
|
||||
QApplication::setWindowIcon(appIcon);
|
||||
|
||||
|
Reference in New Issue
Block a user