fix: avoid create menu actions everytime when trigger context menu.
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.
This commit is contained in:
@ -8,8 +8,16 @@ enum DoubleClickBehavior {
|
||||
ActionCloseWindow,
|
||||
ActionMaximizeWindow,
|
||||
|
||||
ActionStart = ActionDoNothing,
|
||||
ActionEnd = ActionMaximizeWindow
|
||||
DCActionStart = ActionDoNothing,
|
||||
DCActionEnd = ActionMaximizeWindow
|
||||
};
|
||||
|
||||
enum MouseWheelBehavior {
|
||||
ActionZoomImage,
|
||||
ActionPrevNextImage,
|
||||
|
||||
MWActionStart = ActionZoomImage,
|
||||
MWActionEnd = ActionPrevNextImage
|
||||
};
|
||||
|
||||
class Settings : public QObject
|
||||
@ -20,12 +28,16 @@ public:
|
||||
|
||||
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();
|
||||
|
Reference in New Issue
Block a user