Add scroll-down button
This commit is contained in:
parent
8e15a5080d
commit
845228ac6a
8 changed files with 152 additions and 0 deletions
26
include/ui/FloatingButton.h
Normal file
26
include/ui/FloatingButton.h
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
#pragma once
|
||||
|
||||
#include "RaisedButton.h"
|
||||
|
||||
constexpr int DIAMETER = 40;
|
||||
constexpr int ICON_SIZE = 18;
|
||||
|
||||
constexpr int OFFSET_X = 30;
|
||||
constexpr int OFFSET_Y = 20;
|
||||
|
||||
class FloatingButton : public RaisedButton
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
FloatingButton(const QIcon &icon, QWidget *parent = nullptr);
|
||||
|
||||
QSize sizeHint() const override { return QSize(DIAMETER, DIAMETER); };
|
||||
QRect buttonGeometry() const;
|
||||
|
||||
protected:
|
||||
bool event(QEvent *event) override;
|
||||
bool eventFilter(QObject *obj, QEvent *event) override;
|
||||
|
||||
void paintEvent(QPaintEvent *event) override;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue