Showing Knob value on mouse over (#6835)

* Showing Knob value on mouse over

* Correcting minors source code issues

* Correcting double QTimer include

* Removing blank lines

* Removing space and add one

* Update src/gui/widgets/SimpleTextFloat.cpp

Co-authored-by: saker <sakertooth@gmail.com>

* Correcting QTimer

* Remove a parameter that has the default value

---------

Co-authored-by: saker <sakertooth@gmail.com>
This commit is contained in:
MrTopom
2023-08-29 21:32:11 +02:00
committed by GitHub
parent 1e6a66f4ac
commit fcdf4c0568
4 changed files with 62 additions and 7 deletions

View File

@@ -144,6 +144,9 @@ protected:
void wheelEvent( QWheelEvent * _me ) override;
void changeEvent(QEvent * ev) override;
void enterEvent(QEvent *event) override;
void leaveEvent(QEvent *event) override;
virtual float getValue( const QPoint & _p );
private slots:
@@ -160,6 +163,7 @@ private:
float _innerRadius = 1) const;
void drawKnob( QPainter * _p );
void showTextFloat(int msecBeforeDisplay, int msecDisplayTime);
void setPosition( const QPoint & _p );
bool updateAngle();

View File

@@ -31,6 +31,7 @@
#include "lmms_export.h"
class QLabel;
class QTimer;
namespace lmms::gui
{
@@ -44,6 +45,8 @@ public:
void setText(const QString & text);
void showWithDelay(int msecBeforeDisplay, int msecDisplayTime);
void setVisibilityTimeOut(int msecs);
void moveGlobal(QWidget * w, const QPoint & offset)
@@ -51,11 +54,14 @@ public:
move(w->mapToGlobal(QPoint(0, 0)) + offset);
}
void hide();
private:
QLabel * m_textLabel;
QTimer * m_showTimer;
QTimer * m_hideTimer;
};
} // namespace lmms::gui
#endif