1449844fdd
fix the minor memory leak issue, also bring some possibility to implement custom keybinding. And oops I also did another feature in this commit.. Now we are able to set mouse wheel behavior in config dialog.
54 lines
1.2 KiB
C++
54 lines
1.2 KiB
C++
#pragma once
|
|
|
|
#include <QObject>
|
|
#include <QSettings>
|
|
|
|
enum DoubleClickBehavior {
|
|
ActionDoNothing,
|
|
ActionCloseWindow,
|
|
ActionMaximizeWindow,
|
|
|
|
DCActionStart = ActionDoNothing,
|
|
DCActionEnd = ActionMaximizeWindow
|
|
};
|
|
|
|
enum MouseWheelBehavior {
|
|
ActionZoomImage,
|
|
ActionPrevNextImage,
|
|
|
|
MWActionStart = ActionZoomImage,
|
|
MWActionEnd = ActionPrevNextImage
|
|
};
|
|
|
|
class Settings : public QObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
static Settings *instance();
|
|
|
|
bool stayOnTop();
|
|
DoubleClickBehavior doubleClickBehavior();
|
|
MouseWheelBehavior mouseWheelBehavior();
|
|
|
|
void setStayOnTop(bool on);
|
|
void setDoubleClickBehavior(DoubleClickBehavior dcb);
|
|
void setMouseWheelBehavior(MouseWheelBehavior mwb);
|
|
|
|
static QString doubleClickBehaviorToString(DoubleClickBehavior dcb);
|
|
static QString mouseWheelBehaviorToString(MouseWheelBehavior mwb);
|
|
static DoubleClickBehavior stringToDoubleClickBehavior(QString str);
|
|
static MouseWheelBehavior stringToMouseWheelBehavior(QString str);
|
|
|
|
private:
|
|
Settings();
|
|
|
|
static Settings *m_settings_instance;
|
|
|
|
QSettings *m_qsettings;
|
|
|
|
signals:
|
|
|
|
public slots:
|
|
};
|
|
|