mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 17:33:05 +00:00
support activate current preview window
Change-Id: I707eb139b06c6aa6c0d048806db25482c21c22d3
This commit is contained in:
parent
fd82c588c1
commit
7093e945d5
Notes:
Deepin Code Review
2017-05-23 09:10:09 +08:00
Code-Review+2: 石博文 <sbw@sbw.so> Verified+1: Anonymous Coward #1000004 Submitted-by: 石博文 <sbw@sbw.so> Submitted-at: Tue, 23 May 2017 09:10:07 +0800 Reviewed-on: https://cr.deepin.io/23332 Project: dde/dde-dock Branch: refs/heads/master
@ -74,6 +74,11 @@ void _PreviewContainer::appendSnapWidget(const WId wid)
|
||||
{
|
||||
AppSnapshot *snap = new AppSnapshot(wid);
|
||||
|
||||
connect(snap, &AppSnapshot::clicked, this, &_PreviewContainer::requestActivateWindow, Qt::QueuedConnection);
|
||||
connect(snap, &AppSnapshot::clicked, this, &_PreviewContainer::requestCancelPreview);
|
||||
connect(snap, &AppSnapshot::clicked, this, &_PreviewContainer::requestHidePreview);
|
||||
connect(snap, &AppSnapshot::entered, this, &_PreviewContainer::requestPreviewWindow);
|
||||
|
||||
m_windowListLayout->addWidget(snap);
|
||||
|
||||
m_snapshots.insert(wid, snap);
|
||||
|
@ -69,6 +69,13 @@ void AppSnapshot::fetchSnapshot()
|
||||
update();
|
||||
}
|
||||
|
||||
void AppSnapshot::enterEvent(QEvent *e)
|
||||
{
|
||||
QWidget::enterEvent(e);
|
||||
|
||||
emit entered(m_wid);
|
||||
}
|
||||
|
||||
void AppSnapshot::paintEvent(QPaintEvent *e)
|
||||
{
|
||||
QWidget::paintEvent(e);
|
||||
@ -96,3 +103,10 @@ void AppSnapshot::resizeEvent(QResizeEvent *e)
|
||||
|
||||
m_fetchSnapshotTimer->start();
|
||||
}
|
||||
|
||||
void AppSnapshot::mousePressEvent(QMouseEvent *e)
|
||||
{
|
||||
QWidget::mousePressEvent(e);
|
||||
|
||||
emit clicked(m_wid);
|
||||
}
|
||||
|
@ -12,12 +12,18 @@ class AppSnapshot : public QWidget
|
||||
public:
|
||||
explicit AppSnapshot(const WId wid, QWidget *parent = 0);
|
||||
|
||||
signals:
|
||||
void entered(const WId wid) const;
|
||||
void clicked(const WId wid) const;
|
||||
|
||||
private slots:
|
||||
void fetchSnapshot();
|
||||
|
||||
private:
|
||||
void enterEvent(QEvent *e);
|
||||
void paintEvent(QPaintEvent *e);
|
||||
void resizeEvent(QResizeEvent *e);
|
||||
void mousePressEvent(QMouseEvent *e);
|
||||
|
||||
private:
|
||||
const WId m_wid;
|
||||
|
Loading…
x
Reference in New Issue
Block a user