pineapple-pictures/app/settings.h

61 lines
1.3 KiB
C
Raw Permalink Normal View History

// SPDX-FileCopyrightText: 2022 Gary Wang <wzc782970009@gmail.com>
//
// SPDX-License-Identifier: MIT
2020-07-28 21:14:38 +08:00
#pragma once
#include <QObject>
#include <QSettings>
class Settings : public QObject
{
Q_OBJECT
public:
2022-03-12 10:35:23 +08:00
enum DoubleClickBehavior {
Ignore,
Close,
Maximize,
};
Q_ENUM(DoubleClickBehavior)
2022-03-12 10:35:23 +08:00
enum MouseWheelBehavior {
Zoom,
Switch,
};
Q_ENUM(MouseWheelBehavior)
2022-03-12 10:35:23 +08:00
enum WindowSizeBehavior {
Auto,
Maximized,
};
Q_ENUM(WindowSizeBehavior)
2022-03-12 10:35:23 +08:00
2020-07-28 21:14:38 +08:00
static Settings *instance();
2020-07-29 00:57:43 +08:00
bool stayOnTop();
bool useLightCheckerboard();
DoubleClickBehavior doubleClickBehavior() const;
MouseWheelBehavior mouseWheelBehavior() const;
WindowSizeBehavior initWindowSizeBehavior() const;
Qt::HighDpiScaleFactorRoundingPolicy hiDpiScaleFactorBehavior() const;
2020-07-28 21:14:38 +08:00
2020-07-29 00:57:43 +08:00
void setStayOnTop(bool on);
void setUseLightCheckerboard(bool light);
2020-07-29 00:57:43 +08:00
void setDoubleClickBehavior(DoubleClickBehavior dcb);
void setMouseWheelBehavior(MouseWheelBehavior mwb);
void setInitWindowSizeBehavior(WindowSizeBehavior wsb);
void setHiDpiScaleFactorBehavior(Qt::HighDpiScaleFactorRoundingPolicy hidpi);
2020-07-29 00:57:43 +08:00
2020-07-28 21:14:38 +08:00
private:
Settings();
static Settings *m_settings_instance;
QSettings *m_qsettings;
signals:
public slots:
};