Bug fixes:

--Fix logic for showing context menu when the option for right click to toggle is true.
This commit is contained in:
Person
2017-07-22 18:30:25 -07:00
parent f9c1234291
commit 8f2218326a
2 changed files with 80 additions and 10 deletions

View File

@ -43,11 +43,13 @@ protected:
virtual void enterEvent(QEvent* e);
virtual void leaveEvent(QEvent* e);
bool m_DoubleClick;
shared_ptr<FractoriumSettings> m_Settings;
private:
void StartTimer();
void StopTimer();
bool m_DoubleClick;
double m_DoubleClickLowVal;
double m_DoubleClickNonZero;
double m_DoubleClickZero;
@ -55,10 +57,26 @@ private:
double m_SmallStep;
QPoint m_MouseDownPoint;
QPoint m_MouseMovePoint;
shared_ptr<FractoriumSettings> m_Settings;
static QTimer s_Timer;
};
/// <summary>
/// Thin derivation to implement the eventFilter() override which subsequently derived
/// classes will use to suppress showing the context menu when right clicking is used for toggling,
/// unless shift is pressed.
/// </summary>
class SpecialDoubleSpinBox : public DoubleSpinBox
{
Q_OBJECT
public:
explicit SpecialDoubleSpinBox(QWidget* p = nullptr, int h = 16, double step = 0.05);
virtual ~SpecialDoubleSpinBox() { }
protected:
virtual bool eventFilter(QObject* o, QEvent* e) override;
};
/// <summary>
/// VariationTreeWidgetItem and VariationTreeDoubleSpinBox need each other, but each can't include the other.
/// So VariationTreeWidgetItem includes this file, and use a forward declaration here.
@ -69,7 +87,7 @@ class VariationTreeWidgetItem;
/// Derivation for the double spin boxes that are in the
/// variations tree.
/// </summary>
class VariationTreeDoubleSpinBox : public DoubleSpinBox
class VariationTreeDoubleSpinBox : public SpecialDoubleSpinBox
{
Q_OBJECT
@ -105,7 +123,7 @@ private:
/// Derivation for the double spin boxes that are in the
/// affine controls.
/// </summary>
class AffineDoubleSpinBox : public DoubleSpinBox
class AffineDoubleSpinBox : public SpecialDoubleSpinBox
{
Q_OBJECT