Skip to content

Commit

Permalink
鼠标移到消息通知上时,关闭消息通知
Browse files Browse the repository at this point in the history
  • Loading branch information
zhanlangsir committed Apr 6, 2013
1 parent 92c4546 commit 28b9617
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/plugins/notifier/notifywidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include <QTimer>
#include <QScrollBar>
#include <Qt>

#define ANIMATE_STEPS 17
#define ANIMATE_TIME 700
Expand Down Expand Up @@ -220,3 +221,8 @@ void NotifyWidget::appendMessage(const QString &sender_name, const QString &msg)
layoutWidgets();
close_timer_.start(ms_timeout_);
}

void NotifyWidget::enterEvent(QEvent *e)
{
hide();
}
5 changes: 5 additions & 0 deletions src/plugins/notifier/notifywidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,21 @@ class NotifyWidget :
protected:
virtual void resizeEvent(QResizeEvent *AEvent);
virtual void mouseReleaseEvent(QMouseEvent *AEvent);
virtual void enterEvent(QEvent *e);

protected slots:
void onAnimateStep();
void adjustHeight();
void updateElidedText();

private:
Ui::NotifyWidgetClass ui;

private:
int FYPos;
int ms_timeout_;
int FAnimateStep;
double window_opacity_;

NotificationType type_;
QString id_;
Expand Down

0 comments on commit 28b9617

Please sign in to comment.