mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-06-05 21:59:17 +02:00
Issue #257: Force light mode (or dark mode)
This commit is contained in:
@ -19,6 +19,7 @@
|
||||
#include "pdfconstants.h"
|
||||
#include "pdfsecurityhandler.h"
|
||||
#include "pdfwidgetutils.h"
|
||||
#include "pdfviewersettings.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QCommandLineParser>
|
||||
@ -52,7 +53,30 @@ int main(int argc, char *argv[])
|
||||
pdf::PDFSecurityHandler::setNoDRMMode();
|
||||
}
|
||||
|
||||
pdf::PDFWidgetUtils::setDarkTheme(parser.isSet(lightGui), parser.isSet(darkGui));
|
||||
bool isLightGui = false;
|
||||
bool isDarkGui = false;
|
||||
const pdfviewer::PDFViewerSettings::ColorScheme colorScheme = pdfviewer::PDFViewerSettings::getColorSchemeStatic();
|
||||
switch (colorScheme)
|
||||
{
|
||||
case pdfviewer::PDFViewerSettings::AutoScheme:
|
||||
isLightGui = parser.isSet(lightGui);
|
||||
isDarkGui = parser.isSet(darkGui);
|
||||
break;
|
||||
|
||||
case pdfviewer::PDFViewerSettings::LightScheme:
|
||||
isLightGui = true;
|
||||
break;
|
||||
|
||||
case pdfviewer::PDFViewerSettings::DarkScheme:
|
||||
isDarkGui = true;
|
||||
break;
|
||||
|
||||
default:
|
||||
Q_ASSERT(false);
|
||||
break;
|
||||
}
|
||||
|
||||
pdf::PDFWidgetUtils::setDarkTheme(isLightGui, isDarkGui);
|
||||
|
||||
QIcon appIcon(":/app-icon.svg");
|
||||
QApplication::setWindowIcon(appIcon);
|
||||
|
Reference in New Issue
Block a user