2012-02-20 21:47:14 +00:00
|
|
|
/* This file is (c) 2012 Tvangeste <i.4m.l33t@yandex.ru>
|
2011-06-27 18:54:15 +00:00
|
|
|
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
|
|
|
|
|
|
|
|
#ifndef MAINSTATUSBAR_HH
|
|
|
|
#define MAINSTATUSBAR_HH
|
|
|
|
|
|
|
|
#include <QWidget>
|
|
|
|
#include <QLabel>
|
|
|
|
#include <QString>
|
|
|
|
#include <QTimer>
|
|
|
|
|
2011-07-09 11:55:44 +00:00
|
|
|
class MainStatusBar: public QWidget
|
2011-06-27 18:54:15 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit MainStatusBar( QWidget * parent );
|
|
|
|
QString currentMessage() const;
|
|
|
|
|
|
|
|
signals:
|
|
|
|
|
|
|
|
public slots:
|
2011-07-09 11:55:44 +00:00
|
|
|
void showMessage( const QString & text, int timeout = 0, const QPixmap & pixmap = QPixmap() );
|
2011-06-27 18:54:15 +00:00
|
|
|
void clearMessage();
|
2015-11-01 12:22:18 +00:00
|
|
|
void setBackgroundMessage( QString const & message );
|
2011-06-27 18:54:15 +00:00
|
|
|
|
|
|
|
protected:
|
2024-07-06 05:23:22 +00:00
|
|
|
void mousePressEvent( QMouseEvent * event ) override;
|
2011-06-27 18:54:15 +00:00
|
|
|
|
|
|
|
private:
|
2011-07-09 11:55:44 +00:00
|
|
|
// component to display a small picture
|
|
|
|
QLabel * picWidget;
|
|
|
|
|
|
|
|
// component to display text
|
|
|
|
QLabel * textWidget;
|
|
|
|
|
2011-06-27 18:54:15 +00:00
|
|
|
QTimer * timer;
|
2024-07-06 05:23:22 +00:00
|
|
|
QString backgroundMessage;
|
2015-11-01 12:22:18 +00:00
|
|
|
QString message;
|
|
|
|
|
2024-07-06 05:23:22 +00:00
|
|
|
bool eventFilter( QObject * obj, QEvent * event ) override;
|
2011-06-27 18:54:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // MAINSTATUSBAR_HH
|