2020-07-28 21:14:38 +08:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <QSettings>
|
|
|
|
|
|
|
|
enum DoubleClickBehavior {
|
|
|
|
ActionDoNothing,
|
|
|
|
ActionCloseWindow,
|
2020-07-29 00:57:43 +08:00
|
|
|
ActionMaximizeWindow,
|
|
|
|
|
|
|
|
ActionStart = ActionDoNothing,
|
|
|
|
ActionEnd = ActionMaximizeWindow
|
2020-07-28 21:14:38 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class Settings : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
static Settings *instance();
|
|
|
|
|
2020-07-29 00:57:43 +08:00
|
|
|
bool stayOnTop();
|
2020-07-28 21:14:38 +08:00
|
|
|
DoubleClickBehavior doubleClickBehavior();
|
|
|
|
|
2020-07-29 00:57:43 +08:00
|
|
|
void setStayOnTop(bool on);
|
|
|
|
void setDoubleClickBehavior(DoubleClickBehavior dcb);
|
|
|
|
|
2020-07-28 21:14:38 +08:00
|
|
|
static QString doubleClickBehaviorToString(DoubleClickBehavior dcb);
|
|
|
|
static DoubleClickBehavior stringToDoubleClickBehavior(QString str);
|
|
|
|
|
|
|
|
private:
|
|
|
|
Settings();
|
|
|
|
|
|
|
|
static Settings *m_settings_instance;
|
|
|
|
|
|
|
|
QSettings *m_qsettings;
|
|
|
|
|
|
|
|
signals:
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
};
|
|
|
|
|