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,7 +19,9 @@
|
|||||||
#include "pdfconstants.h"
|
#include "pdfconstants.h"
|
||||||
#include "pdfsecurityhandler.h"
|
#include "pdfsecurityhandler.h"
|
||||||
#include "pdfwidgetutils.h"
|
#include "pdfwidgetutils.h"
|
||||||
|
#include "pdfviewersettings.h"
|
||||||
|
|
||||||
|
#include <QSettings>
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QCommandLineParser>
|
#include <QCommandLineParser>
|
||||||
|
|
||||||
@ -58,7 +60,30 @@ int main(int argc, char *argv[])
|
|||||||
pdf::PDFSecurityHandler::setNoDRMMode();
|
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");
|
QIcon appIcon(":/app-icon.svg");
|
||||||
QApplication::setWindowIcon(appIcon);
|
QApplication::setWindowIcon(appIcon);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2019-2022 Jakub Melka
|
// Copyright (C) 2019-2025 Jakub Melka
|
||||||
//
|
//
|
||||||
// This file is part of PDF4QT.
|
// This file is part of PDF4QT.
|
||||||
//
|
//
|
||||||
@ -108,6 +108,10 @@ void PDFViewerSettings::readSettings(QSettings& settings, const pdf::PDFCMSSetti
|
|||||||
m_settings.m_autoGenerateBookmarks = settings.value("autoGenerateBookmarks", defaultSettings.m_autoGenerateBookmarks).toBool();
|
m_settings.m_autoGenerateBookmarks = settings.value("autoGenerateBookmarks", defaultSettings.m_autoGenerateBookmarks).toBool();
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
|
settings.beginGroup("ColorScheme");
|
||||||
|
m_settings.m_colorScheme = static_cast<ColorScheme>(settings.value("colorScheme", int(defaultSettings.m_colorScheme)).toInt());
|
||||||
|
settings.endGroup();
|
||||||
|
|
||||||
Q_EMIT settingsChanged();
|
Q_EMIT settingsChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -180,6 +184,10 @@ void PDFViewerSettings::writeSettings(QSettings& settings)
|
|||||||
settings.beginGroup("Bookmarks");
|
settings.beginGroup("Bookmarks");
|
||||||
settings.setValue("autoGenerateBookmarks", m_settings.m_autoGenerateBookmarks);
|
settings.setValue("autoGenerateBookmarks", m_settings.m_autoGenerateBookmarks);
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
|
settings.beginGroup("ColorScheme");
|
||||||
|
settings.setValue("colorScheme", int(m_settings.m_colorScheme));
|
||||||
|
settings.endGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString PDFViewerSettings::getDirectory() const
|
QString PDFViewerSettings::getDirectory() const
|
||||||
@ -251,6 +259,30 @@ void PDFViewerSettings::setColorTolerance(pdf::PDFReal colorTolerance)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PDFViewerSettings::setColorScheme(ColorScheme colorScheme)
|
||||||
|
{
|
||||||
|
if (m_settings.m_colorScheme != colorScheme)
|
||||||
|
{
|
||||||
|
m_settings.m_colorScheme = colorScheme;
|
||||||
|
Q_EMIT settingsChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
PDFViewerSettings::ColorScheme PDFViewerSettings::getColorSchemeStatic()
|
||||||
|
{
|
||||||
|
QSettings settings(QSettings::IniFormat, QSettings::UserScope, QCoreApplication::organizationName(), QCoreApplication::applicationName());
|
||||||
|
settings.beginGroup("ColorScheme");
|
||||||
|
const ColorScheme colorScheme = static_cast<ColorScheme>(settings.value("colorScheme", int(AutoScheme)).toInt());
|
||||||
|
settings.endGroup();
|
||||||
|
|
||||||
|
return colorScheme;
|
||||||
|
}
|
||||||
|
|
||||||
|
PDFViewerSettings::ColorScheme PDFViewerSettings::getColorScheme() const
|
||||||
|
{
|
||||||
|
return m_settings.m_colorScheme;
|
||||||
|
}
|
||||||
|
|
||||||
PDFViewerSettings::Settings::Settings() :
|
PDFViewerSettings::Settings::Settings() :
|
||||||
m_features(pdf::PDFRenderer::getDefaultFeatures()),
|
m_features(pdf::PDFRenderer::getDefaultFeatures()),
|
||||||
m_rendererEngine(pdf::RendererEngine::Blend2D_MultiThread),
|
m_rendererEngine(pdf::RendererEngine::Blend2D_MultiThread),
|
||||||
@ -278,7 +310,8 @@ PDFViewerSettings::Settings::Settings() :
|
|||||||
m_signatureTreatWarningsAsErrors(false),
|
m_signatureTreatWarningsAsErrors(false),
|
||||||
m_signatureIgnoreCertificateValidityTime(false),
|
m_signatureIgnoreCertificateValidityTime(false),
|
||||||
m_signatureUseSystemStore(true),
|
m_signatureUseSystemStore(true),
|
||||||
m_autoGenerateBookmarks(true)
|
m_autoGenerateBookmarks(true),
|
||||||
|
m_colorScheme(AutoScheme)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2019-2021 Jakub Melka
|
// Copyright (C) 2019-2025 Jakub Melka
|
||||||
//
|
//
|
||||||
// This file is part of PDF4QT.
|
// This file is part of PDF4QT.
|
||||||
//
|
//
|
||||||
@ -18,6 +18,7 @@
|
|||||||
#ifndef PDFVIEWERSETTINGS_H
|
#ifndef PDFVIEWERSETTINGS_H
|
||||||
#define PDFVIEWERSETTINGS_H
|
#define PDFVIEWERSETTINGS_H
|
||||||
|
|
||||||
|
#include "pdfviewerglobal.h"
|
||||||
#include "pdfglobal.h"
|
#include "pdfglobal.h"
|
||||||
#include "pdfrenderer.h"
|
#include "pdfrenderer.h"
|
||||||
#include "pdfcms.h"
|
#include "pdfcms.h"
|
||||||
@ -31,7 +32,7 @@ class QSettings;
|
|||||||
namespace pdfviewer
|
namespace pdfviewer
|
||||||
{
|
{
|
||||||
|
|
||||||
class PDFViewerSettings : public QObject
|
class PDF4QTLIBGUILIBSHARED_EXPORT PDFViewerSettings : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@ -42,6 +43,13 @@ public:
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum ColorScheme
|
||||||
|
{
|
||||||
|
AutoScheme,
|
||||||
|
LightScheme,
|
||||||
|
DarkScheme
|
||||||
|
};
|
||||||
|
|
||||||
struct Settings
|
struct Settings
|
||||||
{
|
{
|
||||||
Settings();
|
Settings();
|
||||||
@ -94,6 +102,9 @@ public:
|
|||||||
|
|
||||||
// Bookmarks settings
|
// Bookmarks settings
|
||||||
bool m_autoGenerateBookmarks;
|
bool m_autoGenerateBookmarks;
|
||||||
|
|
||||||
|
// UI Dark/Light mode settings
|
||||||
|
ColorScheme m_colorScheme;
|
||||||
};
|
};
|
||||||
|
|
||||||
const Settings& getSettings() const { return m_settings; }
|
const Settings& getSettings() const { return m_settings; }
|
||||||
@ -132,6 +143,11 @@ public:
|
|||||||
|
|
||||||
pdf::PDFExecutionPolicy::Strategy getMultithreadingStrategy() const { return m_settings.m_multithreadingStrategy; }
|
pdf::PDFExecutionPolicy::Strategy getMultithreadingStrategy() const { return m_settings.m_multithreadingStrategy; }
|
||||||
|
|
||||||
|
ColorScheme getColorScheme() const;
|
||||||
|
void setColorScheme(ColorScheme colorScheme);
|
||||||
|
|
||||||
|
static ColorScheme getColorSchemeStatic();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void settingsChanged();
|
void settingsChanged();
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2019-2022 Jakub Melka
|
// Copyright (C) 2019-2025 Jakub Melka
|
||||||
//
|
//
|
||||||
// This file is part of PDF4QT.
|
// This file is part of PDF4QT.
|
||||||
//
|
//
|
||||||
@ -133,6 +133,11 @@ PDFViewerSettingsDialog::PDFViewerSettingsDialog(const PDFViewerSettings::Settin
|
|||||||
ui->cmsColorAdaptationXYZComboBox->addItem(tr("CAT02 matrix"), int (pdf::PDFCMSSettings::ColorAdaptationXYZ::CAT02));
|
ui->cmsColorAdaptationXYZComboBox->addItem(tr("CAT02 matrix"), int (pdf::PDFCMSSettings::ColorAdaptationXYZ::CAT02));
|
||||||
ui->cmsColorAdaptationXYZComboBox->addItem(tr("Bradford method"), int (pdf::PDFCMSSettings::ColorAdaptationXYZ::Bradford));
|
ui->cmsColorAdaptationXYZComboBox->addItem(tr("Bradford method"), int (pdf::PDFCMSSettings::ColorAdaptationXYZ::Bradford));
|
||||||
|
|
||||||
|
// UI Color Schemes
|
||||||
|
ui->colorSchemeCombo->addItem(tr("Automatic (or via command line)"), static_cast<int>(PDFViewerSettings::AutoScheme));
|
||||||
|
ui->colorSchemeCombo->addItem(tr("Light scheme"), static_cast<int>(PDFViewerSettings::LightScheme));
|
||||||
|
ui->colorSchemeCombo->addItem(tr("Dark scheme"), static_cast<int>(PDFViewerSettings::DarkScheme));
|
||||||
|
|
||||||
auto fillColorProfileList = [](QComboBox* comboBox, const pdf::PDFColorProfileIdentifiers& identifiers)
|
auto fillColorProfileList = [](QComboBox* comboBox, const pdf::PDFColorProfileIdentifiers& identifiers)
|
||||||
{
|
{
|
||||||
for (const pdf::PDFColorProfileIdentifier& identifier : identifiers)
|
for (const pdf::PDFColorProfileIdentifier& identifier : identifiers)
|
||||||
@ -305,6 +310,7 @@ void PDFViewerSettingsDialog::loadData()
|
|||||||
ui->maximumRedoStepsEdit->setValue(m_settings.m_maximumRedoSteps);
|
ui->maximumRedoStepsEdit->setValue(m_settings.m_maximumRedoSteps);
|
||||||
ui->developerModeCheckBox->setChecked(m_settings.m_allowDeveloperMode);
|
ui->developerModeCheckBox->setChecked(m_settings.m_allowDeveloperMode);
|
||||||
ui->logicalPixelZoomCheckBox->setChecked(m_settings.m_features.testFlag(pdf::PDFRenderer::LogicalSizeZooming));
|
ui->logicalPixelZoomCheckBox->setChecked(m_settings.m_features.testFlag(pdf::PDFRenderer::LogicalSizeZooming));
|
||||||
|
ui->colorSchemeCombo->setCurrentIndex(ui->colorSchemeCombo->findData(static_cast<int>(m_settings.m_colorScheme)));
|
||||||
|
|
||||||
// CMS
|
// CMS
|
||||||
ui->cmsTypeComboBox->setCurrentIndex(ui->cmsTypeComboBox->findData(int(m_cmsSettings.system)));
|
ui->cmsTypeComboBox->setCurrentIndex(ui->cmsTypeComboBox->findData(int(m_cmsSettings.system)));
|
||||||
@ -396,7 +402,11 @@ void PDFViewerSettingsDialog::saveData()
|
|||||||
|
|
||||||
QObject* sender = this->sender();
|
QObject* sender = this->sender();
|
||||||
|
|
||||||
if (sender == ui->renderingEngineComboBox)
|
if (sender == ui->colorSchemeCombo)
|
||||||
|
{
|
||||||
|
m_settings.m_colorScheme = static_cast<PDFViewerSettings::ColorScheme>(ui->colorSchemeCombo->currentData().toInt());
|
||||||
|
}
|
||||||
|
else if (sender == ui->renderingEngineComboBox)
|
||||||
{
|
{
|
||||||
m_settings.m_rendererEngine = static_cast<pdf::RendererEngine>(ui->renderingEngineComboBox->currentData().toInt());
|
m_settings.m_rendererEngine = static_cast<pdf::RendererEngine>(ui->renderingEngineComboBox->currentData().toInt());
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2019-2021 Jakub Melka
|
// Copyright (C) 2019-2025 Jakub Melka
|
||||||
//
|
//
|
||||||
// This file is part of PDF4QT.
|
// This file is part of PDF4QT.
|
||||||
//
|
//
|
||||||
|
@ -25,10 +25,10 @@
|
|||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="selectionBehavior">
|
<property name="selectionBehavior">
|
||||||
<enum>QAbstractItemView::SelectRows</enum>
|
<enum>QAbstractItemView::SelectionBehavior::SelectRows</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="viewMode">
|
<property name="viewMode">
|
||||||
<enum>QListView::ListMode</enum>
|
<enum>QListView::ViewMode::ListMode</enum>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -308,7 +308,7 @@ li.checked::marker { content: "\2612"; }
|
|||||||
<item row="0" column="1">
|
<item row="0" column="1">
|
||||||
<widget class="QDoubleSpinBox" name="preferredMeshResolutionEdit">
|
<widget class="QDoubleSpinBox" name="preferredMeshResolutionEdit">
|
||||||
<property name="correctionMode">
|
<property name="correctionMode">
|
||||||
<enum>QAbstractSpinBox::CorrectToNearestValue</enum>
|
<enum>QAbstractSpinBox::CorrectionMode::CorrectToNearestValue</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="decimals">
|
<property name="decimals">
|
||||||
<number>3</number>
|
<number>3</number>
|
||||||
@ -327,7 +327,7 @@ li.checked::marker { content: "\2612"; }
|
|||||||
<item row="1" column="1">
|
<item row="1" column="1">
|
||||||
<widget class="QDoubleSpinBox" name="minimalMeshResolutionEdit">
|
<widget class="QDoubleSpinBox" name="minimalMeshResolutionEdit">
|
||||||
<property name="correctionMode">
|
<property name="correctionMode">
|
||||||
<enum>QAbstractSpinBox::CorrectToNearestValue</enum>
|
<enum>QAbstractSpinBox::CorrectionMode::CorrectToNearestValue</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="decimals">
|
<property name="decimals">
|
||||||
<number>3</number>
|
<number>3</number>
|
||||||
@ -346,7 +346,7 @@ li.checked::marker { content: "\2612"; }
|
|||||||
<item row="2" column="1">
|
<item row="2" column="1">
|
||||||
<widget class="QDoubleSpinBox" name="colorToleranceEdit">
|
<widget class="QDoubleSpinBox" name="colorToleranceEdit">
|
||||||
<property name="correctionMode">
|
<property name="correctionMode">
|
||||||
<enum>QAbstractSpinBox::CorrectToNearestValue</enum>
|
<enum>QAbstractSpinBox::CorrectionMode::CorrectToNearestValue</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="decimals">
|
<property name="decimals">
|
||||||
<number>3</number>
|
<number>3</number>
|
||||||
@ -425,7 +425,7 @@ li.checked::marker { content: "\2612"; }
|
|||||||
<item row="2" column="1">
|
<item row="2" column="1">
|
||||||
<widget class="QSpinBox" name="cachedFontLimitEdit">
|
<widget class="QSpinBox" name="cachedFontLimitEdit">
|
||||||
<property name="buttonSymbols">
|
<property name="buttonSymbols">
|
||||||
<enum>QAbstractSpinBox::PlusMinus</enum>
|
<enum>QAbstractSpinBox::ButtonSymbols::PlusMinus</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="minimum">
|
<property name="minimum">
|
||||||
<number>4</number>
|
<number>4</number>
|
||||||
@ -438,7 +438,7 @@ li.checked::marker { content: "\2612"; }
|
|||||||
<item row="0" column="1">
|
<item row="0" column="1">
|
||||||
<widget class="QSpinBox" name="compiledPageCacheSizeEdit">
|
<widget class="QSpinBox" name="compiledPageCacheSizeEdit">
|
||||||
<property name="buttonSymbols">
|
<property name="buttonSymbols">
|
||||||
<enum>QAbstractSpinBox::PlusMinus</enum>
|
<enum>QAbstractSpinBox::ButtonSymbols::PlusMinus</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="suffix">
|
<property name="suffix">
|
||||||
<string> kB</string>
|
<string> kB</string>
|
||||||
@ -540,7 +540,7 @@ li.checked::marker { content: "\2612"; }
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QTableWidget" name="shortcutsTableWidget">
|
<widget class="QTableWidget" name="shortcutsTableWidget">
|
||||||
<property name="editTriggers">
|
<property name="editTriggers">
|
||||||
<set>QAbstractItemView::AllEditTriggers</set>
|
<set>QAbstractItemView::EditTrigger::AllEditTriggers</set>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -928,76 +928,45 @@ li.checked::marker { content: "\2612"; }
|
|||||||
<layout class="QVBoxLayout" name="verticalLayout_4" stretch="0,1">
|
<layout class="QVBoxLayout" name="verticalLayout_4" stretch="0,1">
|
||||||
<item>
|
<item>
|
||||||
<layout class="QGridLayout" name="uiGroupBoxLayout">
|
<layout class="QGridLayout" name="uiGroupBoxLayout">
|
||||||
<item row="0" column="0">
|
<item row="1" column="1">
|
||||||
<widget class="QLabel" name="maximumRecentFileCountLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>Maximum count of recent files</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0">
|
|
||||||
<widget class="QLabel" name="magnifierSizeLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>Magnifier size</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1">
|
|
||||||
<widget class="QSpinBox" name="maximumRecentFileCountEdit"/>
|
<widget class="QSpinBox" name="maximumRecentFileCountEdit"/>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="1">
|
<item row="7" column="1">
|
||||||
<widget class="QSpinBox" name="maximumUndoStepsEdit">
|
|
||||||
<property name="maximum">
|
|
||||||
<number>20</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="0">
|
|
||||||
<widget class="QLabel" name="maximumUndoStepsLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>Maximum undo steps</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="4" column="1">
|
|
||||||
<widget class="QSpinBox" name="maximumRedoStepsEdit">
|
|
||||||
<property name="maximum">
|
|
||||||
<number>20</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="1">
|
|
||||||
<widget class="QDoubleSpinBox" name="magnifierZoomEdit">
|
|
||||||
<property name="minimum">
|
|
||||||
<double>1.000000000000000</double>
|
|
||||||
</property>
|
|
||||||
<property name="maximum">
|
|
||||||
<double>10.000000000000000</double>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="4" column="0">
|
|
||||||
<widget class="QLabel" name="maximumRedoStepsLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>Maximum redo steps</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="6" column="1">
|
|
||||||
<widget class="QCheckBox" name="developerModeCheckBox">
|
<widget class="QCheckBox" name="developerModeCheckBox">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Enable</string>
|
<string>Enable</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="6" column="0">
|
<item row="5" column="0">
|
||||||
<widget class="QLabel" name="developerModeLabel">
|
<widget class="QLabel" name="maximumRedoStepsLabel">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Developer mode</string>
|
<string>Maximum redo steps</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="1">
|
<item row="2" column="0">
|
||||||
|
<widget class="QLabel" name="magnifierSizeLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Magnifier size</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="6" column="0">
|
||||||
|
<widget class="QLabel" name="logicalPixelZoomLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Use logical pixels when zooming</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="6" column="1">
|
||||||
|
<widget class="QCheckBox" name="logicalPixelZoomCheckBox">
|
||||||
|
<property name="text">
|
||||||
|
<string>Enable</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="1">
|
||||||
<widget class="QSpinBox" name="magnifierSizeEdit">
|
<widget class="QSpinBox" name="magnifierSizeEdit">
|
||||||
<property name="suffix">
|
<property name="suffix">
|
||||||
<string>px</string>
|
<string>px</string>
|
||||||
@ -1010,7 +979,31 @@ li.checked::marker { content: "\2612"; }
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0">
|
<item row="3" column="1">
|
||||||
|
<widget class="QDoubleSpinBox" name="magnifierZoomEdit">
|
||||||
|
<property name="minimum">
|
||||||
|
<double>1.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<double>10.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="1">
|
||||||
|
<widget class="QSpinBox" name="maximumUndoStepsEdit">
|
||||||
|
<property name="maximum">
|
||||||
|
<number>20</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="0">
|
||||||
|
<widget class="QLabel" name="maximumUndoStepsLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Maximum undo steps</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="0">
|
||||||
<widget class="QLabel" name="magnifierZoomLabel">
|
<widget class="QLabel" name="magnifierZoomLabel">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Magnifier zoom</string>
|
<string>Magnifier zoom</string>
|
||||||
@ -1018,16 +1011,33 @@ li.checked::marker { content: "\2612"; }
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="1">
|
<item row="5" column="1">
|
||||||
<widget class="QCheckBox" name="logicalPixelZoomCheckBox">
|
<widget class="QSpinBox" name="maximumRedoStepsEdit">
|
||||||
<property name="text">
|
<property name="maximum">
|
||||||
<string>Enable</string>
|
<number>20</number>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QLabel" name="logicalPixelZoomLabel">
|
<widget class="QLabel" name="maximumRecentFileCountLabel">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Use logical pixels when zooming</string>
|
<string>Maximum count of recent files</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="7" column="0">
|
||||||
|
<widget class="QLabel" name="developerModeLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Developer mode</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QComboBox" name="colorSchemeCombo"/>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="colorSchemeLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Color Scheme (GUI)</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -1329,7 +1339,7 @@ li.checked::marker { content: "\2612"; }
|
|||||||
<item>
|
<item>
|
||||||
<widget class="Line" name="line">
|
<widget class="Line" name="line">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Orientation::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -1343,7 +1353,7 @@ li.checked::marker { content: "\2612"; }
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QTableWidget" name="trustedCertificateStoreTableWidget">
|
<widget class="QTableWidget" name="trustedCertificateStoreTableWidget">
|
||||||
<property name="selectionBehavior">
|
<property name="selectionBehavior">
|
||||||
<enum>QAbstractItemView::SelectRows</enum>
|
<enum>QAbstractItemView::SelectionBehavior::SelectRows</enum>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -1352,7 +1362,7 @@ li.checked::marker { content: "\2612"; }
|
|||||||
<item>
|
<item>
|
||||||
<spacer name="trustedCertificateStoreButtonsSpacer">
|
<spacer name="trustedCertificateStoreButtonsSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Orientation::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" stdset="0">
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
@ -1374,7 +1384,7 @@ li.checked::marker { content: "\2612"; }
|
|||||||
<item>
|
<item>
|
||||||
<widget class="Line" name="line_2">
|
<widget class="Line" name="line_2">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Orientation::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -1416,24 +1426,24 @@ li.checked::marker { content: "\2612"; }
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QTableWidget" name="pluginsTableWidget">
|
<widget class="QTableWidget" name="pluginsTableWidget">
|
||||||
<property name="selectionMode">
|
<property name="selectionMode">
|
||||||
<enum>QAbstractItemView::SingleSelection</enum>
|
<enum>QAbstractItemView::SelectionMode::SingleSelection</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="selectionBehavior">
|
<property name="selectionBehavior">
|
||||||
<enum>QAbstractItemView::SelectRows</enum>
|
<enum>QAbstractItemView::SelectionBehavior::SelectRows</enum>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="Line" name="line_3">
|
<widget class="Line" name="line_3">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Orientation::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="pluginDescriptionLabel">
|
<widget class="QLabel" name="pluginDescriptionLabel">
|
||||||
<property name="alignment">
|
<property name="alignment">
|
||||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
<set>Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignTop</set>
|
||||||
</property>
|
</property>
|
||||||
<property name="wordWrap">
|
<property name="wordWrap">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
@ -1452,10 +1462,10 @@ li.checked::marker { content: "\2612"; }
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QDialogButtonBox" name="buttonBox">
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Orientation::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="standardButtons">
|
<property name="standardButtons">
|
||||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
<set>QDialogButtonBox::StandardButton::Cancel|QDialogButtonBox::StandardButton::Ok</set>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
#include "pdfconstants.h"
|
#include "pdfconstants.h"
|
||||||
#include "pdfsecurityhandler.h"
|
#include "pdfsecurityhandler.h"
|
||||||
#include "pdfwidgetutils.h"
|
#include "pdfwidgetutils.h"
|
||||||
|
#include "pdfviewersettings.h"
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QCommandLineParser>
|
#include <QCommandLineParser>
|
||||||
@ -52,7 +53,30 @@ int main(int argc, char *argv[])
|
|||||||
pdf::PDFSecurityHandler::setNoDRMMode();
|
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");
|
QIcon appIcon(":/app-icon.svg");
|
||||||
QApplication::setWindowIcon(appIcon);
|
QApplication::setWindowIcon(appIcon);
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
CURRENT:
|
CURRENT:
|
||||||
|
- Issue #257: Force light mode (or dark mode)
|
||||||
- Issue #255: PDF4QT Page Master invert selection does not work
|
- Issue #255: PDF4QT Page Master invert selection does not work
|
||||||
- Issue #254: Unit Settings default window size too small
|
- Issue #254: Unit Settings default window size too small
|
||||||
- Issue #248: update version and year in Help > About page
|
- Issue #248: update version and year in Help > About page
|
||||||
|
Reference in New Issue
Block a user