Issue #257: Force light mode (or dark mode)

This commit is contained in:
Jakub Melka
2025-03-30 14:48:37 +02:00
parent 11dae337d9
commit 0970dd8054
8 changed files with 211 additions and 92 deletions

View File

@@ -1,4 +1,4 @@
// Copyright (C) 2019-2021 Jakub Melka
// Copyright (C) 2019-2025 Jakub Melka
//
// This file is part of PDF4QT.
//
@@ -18,6 +18,7 @@
#ifndef PDFVIEWERSETTINGS_H
#define PDFVIEWERSETTINGS_H
#include "pdfviewerglobal.h"
#include "pdfglobal.h"
#include "pdfrenderer.h"
#include "pdfcms.h"
@@ -31,7 +32,7 @@ class QSettings;
namespace pdfviewer
{
class PDFViewerSettings : public QObject
class PDF4QTLIBGUILIBSHARED_EXPORT PDFViewerSettings : public QObject
{
Q_OBJECT
@@ -42,6 +43,13 @@ public:
}
enum ColorScheme
{
AutoScheme,
LightScheme,
DarkScheme
};
struct Settings
{
Settings();
@@ -94,6 +102,9 @@ public:
// Bookmarks settings
bool m_autoGenerateBookmarks;
// UI Dark/Light mode settings
ColorScheme m_colorScheme;
};
const Settings& getSettings() const { return m_settings; }
@@ -132,6 +143,11 @@ public:
pdf::PDFExecutionPolicy::Strategy getMultithreadingStrategy() const { return m_settings.m_multithreadingStrategy; }
ColorScheme getColorScheme() const;
void setColorScheme(ColorScheme colorScheme);
static ColorScheme getColorSchemeStatic();
signals:
void settingsChanged();