mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 17:33:05 +00:00
change window close icon
Change-Id: I51cebbc1b13868dad46d7929a27eb90a0c8878c7
This commit is contained in:
parent
6944c54610
commit
127af263d9
Notes:
Deepin Code Review
2017-05-04 18:23:53 +08:00
Code-Review+2: 石博文 <sbw@sbw.so> Verified+1: Anonymous Coward #1000004 Submitted-by: 石博文 <sbw@sbw.so> Submitted-at: Thu, 04 May 2017 18:23:45 +0800 Reviewed-on: https://cr.deepin.io/22841 Project: dde/dde-dock Branch: refs/heads/master
@ -11,7 +11,7 @@
|
||||
|
||||
#define PREVIEW_W 200
|
||||
#define PREVIEW_H 130
|
||||
#define PREVIEW_M 8
|
||||
#define PREVIEW_M 12
|
||||
|
||||
PreviewWidget::PreviewWidget(const WId wid, QWidget *parent)
|
||||
: QWidget(parent),
|
||||
@ -21,10 +21,12 @@ PreviewWidget::PreviewWidget(const WId wid, QWidget *parent)
|
||||
|
||||
m_hovered(false)
|
||||
{
|
||||
m_closeButton = new QPushButton;
|
||||
m_closeButton->setFixedSize(16, 16);
|
||||
m_closeButton->setText("x");
|
||||
m_closeButton = new DImageButton;
|
||||
m_closeButton->setFixedSize(24, 24);
|
||||
m_closeButton->setVisible(false);
|
||||
m_closeButton->setNormalPic(":/icons/resources/close_round_normal.png");
|
||||
m_closeButton->setHoverPic(":/icons/resources/close_round_hover.png");
|
||||
m_closeButton->setPressPic(":/icons/resources/close_round_press.png");
|
||||
|
||||
m_droppedDelay = new QTimer(this);
|
||||
m_droppedDelay->setSingleShot(true);
|
||||
@ -43,7 +45,7 @@ PreviewWidget::PreviewWidget(const WId wid, QWidget *parent)
|
||||
setLayout(centralLayout);
|
||||
setAcceptDrops(true);
|
||||
|
||||
connect(m_closeButton, &QPushButton::clicked, this, &PreviewWidget::closeWindow);
|
||||
connect(m_closeButton, &DImageButton::clicked, this, &PreviewWidget::closeWindow);
|
||||
connect(m_mouseEnterTimer, &QTimer::timeout, this, &PreviewWidget::showPreview, Qt::QueuedConnection);
|
||||
|
||||
QTimer::singleShot(1, this, &PreviewWidget::refreshImage);
|
||||
|
@ -3,10 +3,13 @@
|
||||
|
||||
#include <QWidget>
|
||||
#include <QDebug>
|
||||
#include <QPushButton>
|
||||
#include <QDragEnterEvent>
|
||||
#include <QTimer>
|
||||
|
||||
#include <dimagebutton.h>
|
||||
|
||||
DWIDGET_USE_NAMESPACE
|
||||
|
||||
class PreviewWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
@ -40,7 +43,7 @@ private:
|
||||
QImage m_image;
|
||||
QString m_title;
|
||||
|
||||
QPushButton *m_closeButton;
|
||||
DImageButton *m_closeButton;
|
||||
|
||||
QTimer *m_droppedDelay;
|
||||
QTimer *m_mouseEnterTimer;
|
||||
|
@ -11,5 +11,8 @@
|
||||
<file>resources/arrow-left.svg</file>
|
||||
<file>resources/arrow-down.svg</file>
|
||||
<file>resources/application-x-desktop.svg</file>
|
||||
<file>resources/close_round_press.png</file>
|
||||
<file>resources/close_round_normal.png</file>
|
||||
<file>resources/close_round_hover.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
BIN
frame/item/resources/close_round_hover.png
Executable file
BIN
frame/item/resources/close_round_hover.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 587 B |
BIN
frame/item/resources/close_round_normal.png
Executable file
BIN
frame/item/resources/close_round_normal.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 567 B |
BIN
frame/item/resources/close_round_press.png
Executable file
BIN
frame/item/resources/close_round_press.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 587 B |
Loading…
x
Reference in New Issue
Block a user