qt-material-widgets/components/qtmaterialsnackbar.h

60 lines
1.2 KiB
C
Raw Normal View History

2017-09-29 13:58:00 +00:00
#ifndef QTMATERIALSNACKBAR_H
#define QTMATERIALSNACKBAR_H
2017-09-29 14:06:44 +00:00
#include "lib/qtmaterialoverlaywidget.h"
2022-02-17 02:57:43 +00:00
namespace md
{
2017-09-29 13:58:00 +00:00
2022-02-17 02:57:43 +00:00
class SnackBarPrivate;
2017-09-29 13:58:00 +00:00
2022-02-17 02:57:43 +00:00
class SnackBar : public OverlayWidget
2017-09-29 13:58:00 +00:00
{
Q_OBJECT
public:
2022-02-17 02:57:43 +00:00
explicit SnackBar(QWidget *parent = 0);
~SnackBar();
2017-09-29 13:58:00 +00:00
void setAutoHideDuration(int duration);
int autoHideDuration() const;
void setUseThemeColors(bool value);
bool useThemeColors() const;
void setBackgroundColor(const QColor &color);
QColor backgroundColor() const;
void setBackgroundOpacity(qreal opacity);
qreal backgroundOpacity() const;
void setTextColor(const QColor &color);
QColor textColor() const;
void setFontSize(qreal size);
qreal fontSize() const;
void setBoxWidth(int width);
int boxWidth() const;
void setClickToDismissMode(bool value);
bool clickToDismissMode() const;
public slots:
void addMessage(const QString &message);
void addInstantMessage(const QString &message);
protected slots:
void dequeue();
protected:
void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
2022-02-17 02:57:43 +00:00
const QScopedPointer<SnackBarPrivate> d_ptr;
2017-09-29 13:58:00 +00:00
private:
2022-02-17 02:57:43 +00:00
Q_DISABLE_COPY(SnackBar)
Q_DECLARE_PRIVATE(SnackBar)
2017-09-29 13:58:00 +00:00
};
2022-02-17 02:57:43 +00:00
}
2017-09-29 13:58:00 +00:00
#endif // QTMATERIALSNACKBAR_H