mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 15:24:05 +00:00
4163bce8a2
* Status Bar now available for Scan Popup window as well. * Fixed #13: Eliminated modal box when sound is not available: Instead of modal dialog box we now show the status bar message, with error icon, thus making it visible but not disruptive. * Proper handling of status bar images. * Styling of the status bar in both modes (in Mani Window and in Popup Window).
44 lines
921 B
C++
44 lines
921 B
C++
/* This file is (c) 2011 Tvangeste <i.4m.l33t@yandex.ru>
|
|
* 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>
|
|
|
|
class MainStatusBar : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
Q_PROPERTY(bool hasImage READ hasImage)
|
|
|
|
public:
|
|
explicit MainStatusBar(QWidget * parent);
|
|
QString currentMessage() const;
|
|
|
|
signals:
|
|
|
|
public slots:
|
|
void showMessage(const QString & text, int timeout = 0, const QPixmap & pixmap = QPixmap());
|
|
void clearMessage();
|
|
|
|
protected:
|
|
virtual void mousePressEvent(QMouseEvent * event);
|
|
|
|
private:
|
|
// component to display a small picture
|
|
QLabel * picWidget;
|
|
|
|
// component to display text
|
|
QLabel * textWidget;
|
|
|
|
QTimer * timer;
|
|
bool eventFilter(QObject *obj, QEvent * event);
|
|
void refresh();
|
|
bool hasImage() const;
|
|
};
|
|
|
|
#endif // MAINSTATUSBAR_HH
|