Files
sarasacw-picture/app/settings.h
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

51 lines
1.1 KiB
C++
Raw Normal View History

// SPDX-FileCopyrightText: 2022 Gary Wang <wzc782970009@gmail.com>
//
// SPDX-License-Identifier: MIT
2025-07-23 21:20:34 +08:00
2020-07-28 21:14:38 +08:00
#pragma once
2025-07-23 21:20:34 +08:00
2020-07-28 21:14:38 +08:00
#include <QObject>
#include <QSettings>
2025-07-23 21:20:34 +08:00
2020-07-28 21:14:38 +08:00
class Settings : public QObject
{
Q_OBJECT
public:
2022-03-12 10:35:23 +08:00
enum MouseWheelBehavior {
Zoom,
Switch,
};
Q_ENUM(MouseWheelBehavior)
2025-07-23 21:20:34 +08:00
2022-03-12 10:35:23 +08:00
enum WindowSizeBehavior {
Maximized,
Windowed,
2022-03-12 10:35:23 +08:00
};
Q_ENUM(WindowSizeBehavior)
2025-07-23 21:20:34 +08:00
2020-07-28 21:14:38 +08:00
static Settings *instance();
2025-07-23 21:20:34 +08:00
bool useLightCheckerboard() const;
2025-06-25 20:55:42 +08:00
bool loopGallery() const;
bool svgTiny12Only() const;
2022-03-11 16:21:56 +08:00
MouseWheelBehavior mouseWheelBehavior() const;
WindowSizeBehavior initWindowSizeBehavior() const;
Qt::HighDpiScaleFactorRoundingPolicy hiDpiScaleFactorBehavior() const;
2025-07-23 21:20:34 +08:00
void setUseLightCheckerboard(bool light);
2025-06-25 20:55:42 +08:00
void setLoopGallery(bool on);
void setSvgTiny12Only(bool on);
void setMouseWheelBehavior(MouseWheelBehavior mwb);
2022-03-11 16:21:56 +08:00
void setInitWindowSizeBehavior(WindowSizeBehavior wsb);
void setHiDpiScaleFactorBehavior(Qt::HighDpiScaleFactorRoundingPolicy hidpi);
2025-07-23 21:20:34 +08:00
2020-07-28 21:14:38 +08:00
private:
Settings(QObject *parent = nullptr);
2025-07-23 21:20:34 +08:00
2020-07-28 21:14:38 +08:00
QSettings *m_qsettings;
2025-07-23 21:20:34 +08:00
2020-07-28 21:14:38 +08:00
signals:
2025-07-23 21:20:34 +08:00
2020-07-28 21:14:38 +08:00
public slots:
};