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
|
2011-07-14 20:11:57 +00:00
|
|
|
Q_PROPERTY(bool hasImage READ hasImage)
|
2011-06-27 18:54:15 +00:00
|
|
|
|
|
|
|
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();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void mousePressEvent(QMouseEvent * event);
|
|
|
|
|
|
|
|
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;
|
2011-07-09 17:05:14 +00:00
|
|
|
bool eventFilter(QObject *obj, QEvent * event);
|
2011-07-09 11:55:44 +00:00
|
|
|
void refresh();
|
2011-07-14 20:11:57 +00:00
|
|
|
bool hasImage() const;
|
2011-06-27 18:54:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // MAINSTATUSBAR_HH
|