mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 15:24:05 +00:00
d46e4dc77b
* Small pop-up window at the bottom of the main winodw instead of traditional status bar, that consumes lots of space. * API, similar to standard Qt's status bar. * The status bar hides itself after specified amount of time. * Clicking on the status bar also hides it. * Properly behavies on resizes/moves/focus/etc. * Tested on Linux and Windows.
38 lines
734 B
C++
38 lines
734 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 QFrame
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit MainStatusBar(QWidget * parent);
|
|
QString currentMessage() const;
|
|
|
|
signals:
|
|
|
|
public slots:
|
|
void showMessage(const QString & text, int timeout = 0);
|
|
void clearMessage();
|
|
|
|
protected:
|
|
virtual void mousePressEvent(QMouseEvent * event);
|
|
|
|
private:
|
|
QLabel * label;
|
|
QTimer * timer;
|
|
QString message;
|
|
bool eventFilter(QObject *obj, QEvent * event);
|
|
void refresh();
|
|
};
|
|
|
|
#endif // MAINSTATUSBAR_HH
|