From 03ddbf6d631a923183e7c534530de69858204725 Mon Sep 17 00:00:00 2001 From: deepin-ci-robot Date: Mon, 5 Aug 2024 08:22:21 +0000 Subject: [PATCH] sync: from linuxdeepin/dtkwidget Synchronize source files from linuxdeepin/dtkwidget. Source-pull-request: https://github.com/linuxdeepin/dtkwidget/pull/592 --- examples/collections/progressbarexample.cpp | 31 ++++ examples/collections/progressbarexample.h | 12 ++ include/DWidget/DIndeterminateProgressbar | 1 + include/widgets/dfloatingmessage.h | 3 +- include/widgets/dindeterminateprogressbar.h | 26 ++++ include/widgets/dmessagemanager.h | 6 +- src/widgets/dfloatingmessage.cpp | 21 ++- src/widgets/dindeterminateprogressbar.cpp | 133 ++++++++++++++++++ src/widgets/dmessagemanager.cpp | 127 ++++++++++++++--- src/widgets/dtitlebar.cpp | 2 +- .../private/dindeterminateprogressbar_p.h | 29 ++++ src/widgets/private/dmessagemanager_p.h | 33 +++++ 12 files changed, 401 insertions(+), 23 deletions(-) create mode 100644 include/DWidget/DIndeterminateProgressbar create mode 100644 include/widgets/dindeterminateprogressbar.h create mode 100644 src/widgets/dindeterminateprogressbar.cpp create mode 100644 src/widgets/private/dindeterminateprogressbar_p.h create mode 100644 src/widgets/private/dmessagemanager_p.h diff --git a/examples/collections/progressbarexample.cpp b/examples/collections/progressbarexample.cpp index 8c7010c9e..a79dfe507 100644 --- a/examples/collections/progressbarexample.cpp +++ b/examples/collections/progressbarexample.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include "progressbarexample.h" DWIDGET_USE_NAMESPACE @@ -28,6 +29,7 @@ ProgressBarExampleWindow::ProgressBarExampleWindow(QWidget *parent) addExampleWindow(new DProgressBarExample(this)); addExampleWindow(new DWaterProgressExample(this)); addExampleWindow(new DColoredProgressBarExample(this)); + addExampleWindow(new DIndeterminateProgressBarExample(this)); } DProgressBarExample::DProgressBarExample(QWidget *parent) @@ -181,3 +183,32 @@ int DColoredProgressBarExample::getFixedHeight() const { return 200; } + +DIndeterminateProgressBarExample::DIndeterminateProgressBarExample(QWidget *parent) + : ExampleWindowInterface(parent) +{ + auto mainLayout = new QVBoxLayout(this); + auto indeterBar = new DIndeterminateProgressbar(); + indeterBar->setFixedSize(500, 35); + mainLayout->addWidget(indeterBar, 0, Qt::AlignCenter); + setLayout(mainLayout); +} + +QString DIndeterminateProgressBarExample::getTitleName() const +{ + return "DIndeterminateProgressbar"; +} + +QString DIndeterminateProgressBarExample::getDescriptionInfo() const +{ + return QString("一个模糊进度条,不展示具体进度值,\n" + "用于等待时间不确定的情况。主要用\n" + "在小工具主窗口内部,作为一个中间状态\n" + "展示给用户,最终的结果往往会跟随成功\n" + "或者失败的图标。"); +} + +int DIndeterminateProgressBarExample::getFixedHeight() const +{ + return 200; +} diff --git a/examples/collections/progressbarexample.h b/examples/collections/progressbarexample.h index fb71257c5..c22ee1319 100644 --- a/examples/collections/progressbarexample.h +++ b/examples/collections/progressbarexample.h @@ -53,4 +53,16 @@ class DColoredProgressBarExample : public ExampleWindowInterface int getFixedHeight() const override; }; +class DIndeterminateProgressBarExample : public ExampleWindowInterface +{ + Q_OBJECT + +public: + explicit DIndeterminateProgressBarExample(QWidget *parent = nullptr); + + QString getTitleName() const override; + QString getDescriptionInfo() const override; + int getFixedHeight() const override; +}; + #endif // PROGRESSBAREXAMPLE_H diff --git a/include/DWidget/DIndeterminateProgressbar b/include/DWidget/DIndeterminateProgressbar new file mode 100644 index 000000000..1d45e0b4a --- /dev/null +++ b/include/DWidget/DIndeterminateProgressbar @@ -0,0 +1 @@ +#include "dindeterminateprogressbar.h" diff --git a/include/widgets/dfloatingmessage.h b/include/widgets/dfloatingmessage.h index 382ee6b55..dea681929 100644 --- a/include/widgets/dfloatingmessage.h +++ b/include/widgets/dfloatingmessage.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2019 - 2023 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2019 - 2024 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later @@ -38,6 +38,7 @@ class DFloatingMessage : public DFloatingWidget Q_SIGNALS: void closeButtonClicked(); + void messageClosed(); protected: using DFloatingWidget::setWidget; diff --git a/include/widgets/dindeterminateprogressbar.h b/include/widgets/dindeterminateprogressbar.h new file mode 100644 index 000000000..7883b1bea --- /dev/null +++ b/include/widgets/dindeterminateprogressbar.h @@ -0,0 +1,26 @@ +// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DINDETERMINATEPROGRESSBAR_H +#define DINDETERMINATEPROGRESSBAR_H + +#include +#include + +class DIndeterminateProgressbarPrivate; +class DIndeterminateProgressbar : public QWidget, public DTK_CORE_NAMESPACE::DObject +{ + Q_OBJECT +public: + explicit DIndeterminateProgressbar(QWidget *parent = nullptr); + +protected: + void paintEvent(QPaintEvent *e) override; + void resizeEvent(QResizeEvent *e) override; + +private: + D_DECLARE_PRIVATE(DIndeterminateProgressbar) +}; + +#endif // DINDETERMINATEPROGRESSBAR_H diff --git a/include/widgets/dmessagemanager.h b/include/widgets/dmessagemanager.h index 198815368..542cfb943 100644 --- a/include/widgets/dmessagemanager.h +++ b/include/widgets/dmessagemanager.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2022 - 2024 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later @@ -16,9 +16,11 @@ DGUI_END_NAMESPACE DWIDGET_BEGIN_NAMESPACE class DFloatingMessage; -class DMessageManager: public QObject +class DMessageManagerPrivate; +class DMessageManager: public QObject, public DCORE_NAMESPACE::DObject { Q_OBJECT + D_DECLARE_PRIVATE(DMessageManager) private: DMessageManager(); //构造函数是私有的 diff --git a/src/widgets/dfloatingmessage.cpp b/src/widgets/dfloatingmessage.cpp index 2c5270909..c581f289e 100644 --- a/src/widgets/dfloatingmessage.cpp +++ b/src/widgets/dfloatingmessage.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2019 - 2023 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2019 - 2024 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later @@ -11,6 +11,7 @@ #include #include #include +#include class MessageLabel : public QLabel { @@ -54,13 +55,17 @@ void DFloatingMessagePrivate::init() iconButton->setIconSize(DSizeModeHelper::element(QSize(20, 20), QSize(30, 30))); hBoxLayout->addWidget(iconButton); + hBoxLayout->addSpacing(10); hBoxLayout->addWidget(labMessage); if (notifyType == DFloatingMessage::MessageType::TransientType) { //临时消息 timer = new QTimer(q); timer->setInterval(4000); timer->setSingleShot(true); - q->connect(timer, &QTimer::timeout, q, &DFloatingMessage::close); + q->connect(timer, &QTimer::timeout, q, [q]() { + q->close(); + Q_EMIT q->messageClosed(); + }); } else { //常驻消息 content = nullptr; closeButton = new DDialogCloseButton(q); @@ -69,8 +74,18 @@ void DFloatingMessagePrivate::init() hBoxLayout->addWidget(closeButton); q->connect(closeButton, &DIconButton::clicked, q, &DFloatingMessage::closeButtonClicked); - q->connect(closeButton, &DIconButton::clicked, q, &DFloatingMessage::close); + q->connect(closeButton, &DIconButton::clicked, q, [q]() { + q->close(); + Q_EMIT q->messageClosed(); + }); } + + auto effect = new QGraphicsDropShadowEffect(q); + effect->setColor(QColor(0, 0, 0, 0.1 * 255)); + effect->setBlurRadius(20); + effect->setXOffset(0); + effect->setYOffset(2); + q->setGraphicsEffect(effect); } /*! diff --git a/src/widgets/dindeterminateprogressbar.cpp b/src/widgets/dindeterminateprogressbar.cpp new file mode 100644 index 000000000..bb0713140 --- /dev/null +++ b/src/widgets/dindeterminateprogressbar.cpp @@ -0,0 +1,133 @@ +// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#include "private/dindeterminateprogressbar_p.h" + +#include + +#include +#include +#include +#include +#include + +const int SPOT_WIDGET_WIDTH = 200; + +DIndeterminateProgressbarPrivate::DIndeterminateProgressbarPrivate(DIndeterminateProgressbar *qq) + : DObjectPrivate(qq) + , m_sliderWidget(new QWidget(qq)) + , m_timer(new QTimer(qq)) + , m_leftToRight(true) + , m_spotWidget(new QWidget(qq)) + , m_animation(new QPropertyAnimation(m_spotWidget, "pos", qq)) +{ +} + +DIndeterminateProgressbar::DIndeterminateProgressbar(QWidget *parent) + : QWidget(parent) + , DObject(*new DIndeterminateProgressbarPrivate(this)) +{ + D_D(DIndeterminateProgressbar); + d->m_spotWidget->setFixedSize(SPOT_WIDGET_WIDTH, height()); + d->m_spotWidget->move(-SPOT_WIDGET_WIDTH, 0); + + d->m_sliderWidget->setFixedWidth(150); + d->m_sliderWidget->move(0, 0); + + d->m_timer->setInterval(10); + static int step = 0; + connect(d->m_timer, &QTimer::timeout, this, [this, d]() { + if (d->m_sliderWidget->geometry().right() >= rect().right()) { + d->m_leftToRight = false; + } + + if (d->m_sliderWidget->geometry().left() <= rect().left()) { + d->m_leftToRight = true; + } + + d->m_leftToRight ? step += 2 : step -= 2; + d->m_sliderWidget->move(step, 0); + }); + d->m_timer->start(); +} + +void DIndeterminateProgressbar::resizeEvent(QResizeEvent *e) +{ + D_D(DIndeterminateProgressbar); + d->m_sliderWidget->setFixedHeight(height()); + d->m_spotWidget->setFixedSize(SPOT_WIDGET_WIDTH, height()); + + d->m_animation->setStartValue(QPoint(-SPOT_WIDGET_WIDTH, 0)); + d->m_animation->setEndValue(QPoint(rect().right(), 0)); + d->m_animation->setDuration(3000); + d->m_animation->setEasingCurve(QEasingCurve::InQuad); + d->m_animation->start(); + connect(d->m_animation, &QPropertyAnimation::finished, this, [d]() { + d->m_animation->start(); + }); + QWidget::resizeEvent(e); +} + +void DIndeterminateProgressbar::paintEvent(QPaintEvent *e) +{ + D_D(DIndeterminateProgressbar); + QWidget::paintEvent(e); + QPainter p(this); + + p.setRenderHint(QPainter::Antialiasing); + int radius; + this->height() <= DTK_WIDGET_NAMESPACE::DStyle::pixelMetric(style(), DTK_WIDGET_NAMESPACE::DStyle::PM_FrameRadius) * 2 + ? radius = height() / 2 + : radius = DTK_WIDGET_NAMESPACE::DStyle::pixelMetric(style(), DTK_WIDGET_NAMESPACE::DStyle::PM_FrameRadius); + + p.setBrush(QColor(0, 0, 0, int(0.1 * 255))); + p.setPen(Qt::NoPen); + + p.drawRoundedRect(rect(), radius, radius); + + QPen pen; + pen.setWidth(1); + pen.setColor(QColor(0, 0, 0, int(0.2 * 255))); + p.setBrush(Qt::NoBrush); + p.setPen(pen); + p.drawRoundedRect(rect().marginsRemoved(QMargins(1, 1, 1, 1)), radius, radius); + + p.setPen(Qt::NoPen); + p.setBrush(palette().highlight().color()); + p.drawRoundedRect(d->m_sliderWidget->geometry(), radius, radius); + + pen.setColor(QColor(0, 0, 0, int(0.3 * 255))); + p.setBrush(Qt::NoBrush); + p.setPen(pen); + p.drawRoundedRect(d->m_sliderWidget->geometry().marginsRemoved(QMargins(1, 1, 1, 1)), radius, radius); + + if (d->m_sliderWidget->width() < d->m_spotWidget->width() / 2) + return; + + QPointF pointStart(d->m_spotWidget->geometry().left(), d->m_spotWidget->geometry().center().y()); + QPointF pointEnd(d->m_spotWidget->geometry().right(), d->m_spotWidget->geometry().center().y()); + + QColor shadowColor(0, 0, 0, int(0.15 * 255)); + QColor spotColor(255, 255, 255, int(0.5 * 255)); + QColor highLightColor(palette().highlight().color()); + + QLinearGradient linear(pointStart, pointEnd); + linear.setColorAt(0, highLightColor); + linear.setColorAt(0.35, shadowColor); + linear.setColorAt(0.5, spotColor); + linear.setColorAt(0.65, shadowColor); + linear.setColorAt(1, highLightColor); + linear.setSpread(QGradient::PadSpread); + linear.setInterpolationMode(QLinearGradient::InterpolationMode::ColorInterpolation); + + p.setBrush(linear); + p.setPen(Qt::NoPen); + + QPainterPath clipPath; + clipPath.addRoundedRect(d->m_sliderWidget->geometry(), radius, radius); + p.setClipPath(clipPath); + p.setClipping(true); + p.drawRoundedRect(d->m_spotWidget->geometry().marginsRemoved(QMargins(2, 2, 2, 2)), radius, radius); + p.setClipping(false); +} diff --git a/src/widgets/dmessagemanager.cpp b/src/widgets/dmessagemanager.cpp index 6e7a362b5..043731e81 100644 --- a/src/widgets/dmessagemanager.cpp +++ b/src/widgets/dmessagemanager.cpp @@ -1,19 +1,48 @@ -// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2022 - 2024 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later -#include "dmessagemanager.h" +#include "private/dmessagemanager_p.h" #include #include #include #include +#include #define D_MESSAGE_MANAGER_CONTENT "_d_message_manager_content" +const int MARGIN = 20; +const int MESSGAE_HEIGHT = 50; +const int ANIMATION_DURATION = 400; Q_DECLARE_METATYPE(QMargins) +class ImageLabel : public QLabel { + Q_OBJECT + Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity) +public: + explicit ImageLabel(QWidget *parent=nullptr) + : QLabel (parent) + , m_opacity(0) + { + }; + void setOpacity(qreal opac) { m_opacity = opac; } + qreal opacity() { return m_opacity ;} + +protected: + void paintEvent(QPaintEvent *e) override + { + Q_UNUSED(e) + QPainter p(this); + p.setRenderHint(QPainter::Antialiasing); + p.setOpacity(m_opacity); + p.drawPixmap(rect().marginsRemoved(contentsMargins()), *pixmap()); + }; +private: + qreal m_opacity; +}; + // 仅仅为了接口兼容, 符号不会减少, 如果使用了这个接口,实际调用走的有namespace的 class Q_DECL_EXPORT DMessageManager: public QObject { @@ -91,7 +120,30 @@ static void sendMessage_helper(DMessageManager *manager, QWidget *par, IconType manager->sendMessage(par, floMsg); } +DMessageManagerPrivate::DMessageManagerPrivate(DMessageManager *qq) + : DObjectPrivate(qq) + , m_aniGeometry(new QPropertyAnimation(qq)) + , m_aniOpacity(new QPropertyAnimation(qq)) + , m_aniGroup(new QParallelAnimationGroup(qq)) + , m_label(new ImageLabel) +{ + m_aniGeometry->setPropertyName("geometry"); + m_aniGeometry->setDuration(ANIMATION_DURATION); + m_aniGeometry->setEasingCurve(QEasingCurve::OutCubic); + + m_aniOpacity->setPropertyName("opacity"); + m_aniOpacity->setDuration(ANIMATION_DURATION); + m_aniOpacity->setEasingCurve(QEasingCurve::OutCubic); + m_aniOpacity->setTargetObject(m_label); + m_aniOpacity->setStartValue(0); + m_aniOpacity->setEndValue(1); + + m_aniGroup->addAnimation(m_aniGeometry); + m_aniGroup->addAnimation(m_aniOpacity); +} + DMessageManager::DMessageManager() //私有静态构造函数 + : DObject(*new DMessageManagerPrivate(this)) { } @@ -114,6 +166,7 @@ DMessageManager *DMessageManager::instance() //公有静态函数 */ void DMessageManager::sendMessage(QWidget *par, DFloatingMessage *floMsg) { + D_D(DMessageManager); QWidget *content = par->findChild(D_MESSAGE_MANAGER_CONTENT, Qt::FindDirectChildrenOnly); if (!content) { @@ -125,7 +178,7 @@ void DMessageManager::sendMessage(QWidget *par, DFloatingMessage *floMsg) if (par->property("_d_margins").isValid()) content->setContentsMargins(magins); else - content->setContentsMargins(QMargins(20, 0, 20, 0)); + content->setContentsMargins(QMargins(MARGIN, 0, MARGIN, 0)); content->installEventFilter(this); par->installEventFilter(this); @@ -133,10 +186,60 @@ void DMessageManager::sendMessage(QWidget *par, DFloatingMessage *floMsg) layout->setSpacing(0); layout->setContentsMargins(0, 0, 0, 0); layout->setDirection(QBoxLayout::BottomToTop); - content->show(); + } + + if (content->layout()->count() >= 1) { + content->layout()->itemAt(content->layout()->count() - 1)->widget()->hide(); + delete content->layout()->takeAt(content->layout()->count() - 1); } static_cast(content->layout())->addWidget(floMsg, 0, Qt::AlignHCenter); + + // 限制通知消息的最大宽度 + for (DFloatingMessage *message : content->findChildren(QString(), Qt::FindDirectChildrenOnly)) { + message->setMaximumWidth(par->rect().marginsRemoved(content->contentsMargins()).width()); + message->setMinimumHeight(message->sizeHint().height()); + } + + QRect geometry(QPoint(0, 0), floMsg->sizeHint() + QSize(MARGIN * 2, 0)); + geometry.moveCenter(par->rect().center()); + geometry.moveBottom(par->rect().bottom() - MESSGAE_HEIGHT); + + content->setGeometry(geometry); + content->hide(); + + if (d->m_aniGeometry->state() == QPropertyAnimation::State::Running) + return; + + d->m_label->setParent(par); + d->m_label->setAlignment(Qt::AlignCenter); + d->m_label->setContentsMargins(MARGIN, 0, MARGIN, 0); + d->m_label->setPixmap(floMsg->grab()); + d->m_label->setScaledContents(true); + d->m_label->show(); + d->m_aniGeometry->setTargetObject(d->m_label); + d->m_aniOpacity->setTargetObject(d->m_label); + d->m_aniGeometry->setStartValue(QRect(par->rect().center().x(), par->rect().bottom(), 0, 0)); + d->m_aniGeometry->setEndValue(content->geometry()); + d->m_aniGroup->start(); + connect(d->m_aniGroup, &QPropertyAnimation::finished, this, [d, content]() { + if (d->m_aniGroup->direction() == QAbstractAnimation::Backward) { + d->m_aniGroup->setDirection(QAbstractAnimation::Forward); + } else { + content->show(); + } + d->m_label->hide(); + }); + + connect(floMsg, &DFloatingMessage::messageClosed, [=, this]() { + d->m_aniGeometry->setStartValue(QRect(par->rect().center().x(), par->rect().bottom(), 0, 0)); + d->m_aniGeometry->setEndValue(content->geometry()); + d->m_label->setPixmap(floMsg->grab()); + + d->m_aniGroup->setDirection(QAbstractAnimation::Backward); + d->m_label->show(); + d->m_aniGroup->start(); + }); } /*! @@ -184,19 +287,11 @@ bool DMessageManager::setContentMargens(QWidget *par, const QMargins &margins) */ bool DMessageManager::eventFilter(QObject *watched, QEvent *event) { - if (event->type() == QEvent::LayoutRequest || event->type() == QEvent::Resize) { - if (QWidget *widget = qobject_cast(watched)) { - QWidget *content; - - if (widget->objectName() == D_MESSAGE_MANAGER_CONTENT) { - content = widget; - } else { - content = widget->findChild(D_MESSAGE_MANAGER_CONTENT, Qt::FindDirectChildrenOnly); - } + if (event->type() == QEvent::Resize) { + if (auto content = watched->findChild(D_MESSAGE_MANAGER_CONTENT, Qt::FindDirectChildrenOnly)) { - QWidget *par = content->parentWidget(); + auto par = qobject_cast(watched); - // 限制通知消息的最大宽度 for (DFloatingMessage *message : content->findChildren(QString(), Qt::FindDirectChildrenOnly)) { message->setMaximumWidth(par->rect().marginsRemoved(content->contentsMargins()).width()); message->setMinimumHeight(message->sizeHint().height()); @@ -204,7 +299,7 @@ bool DMessageManager::eventFilter(QObject *watched, QEvent *event) QRect geometry(QPoint(0, 0), content->sizeHint()); geometry.moveCenter(par->rect().center()); - geometry.moveBottom(par->rect().bottom()); + geometry.moveBottom(par->rect().bottom() - MESSGAE_HEIGHT); content->setGeometry(geometry); } } else if (event->type() == QEvent::ChildRemoved) { diff --git a/src/widgets/dtitlebar.cpp b/src/widgets/dtitlebar.cpp index 23d604ad0..6c32eeaf1 100644 --- a/src/widgets/dtitlebar.cpp +++ b/src/widgets/dtitlebar.cpp @@ -775,7 +775,7 @@ void DTitlebarPrivate::setIconVisible(bool visible) return; if (visible) { - if (auto spacerItem = dynamic_cast(leftLayout->takeAt(0))) + if (dynamic_cast(leftLayout->itemAt(0))) delete leftLayout->takeAt(0); leftLayout->insertSpacing(0, 10); diff --git a/src/widgets/private/dindeterminateprogressbar_p.h b/src/widgets/private/dindeterminateprogressbar_p.h new file mode 100644 index 000000000..330504358 --- /dev/null +++ b/src/widgets/private/dindeterminateprogressbar_p.h @@ -0,0 +1,29 @@ +// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DINDETERMINATEPROGRESSBAR_P_H +#define DINDETERMINATEPROGRESSBAR_P_H + +#include +#include + +#include + +class QPropertyAnimation; +class DIndeterminateProgressbarPrivate : public DTK_CORE_NAMESPACE::DObjectPrivate +{ +public: + DIndeterminateProgressbarPrivate(DIndeterminateProgressbar *qq); + + QWidget *m_sliderWidget; + QTimer *m_timer; + bool m_leftToRight; + QWidget *m_spotWidget; + QPropertyAnimation *m_animation; + +private: + D_DECLARE_PUBLIC(DIndeterminateProgressbar) +}; + +#endif // DINDETERMINATEPROGRESSBAR_P_H diff --git a/src/widgets/private/dmessagemanager_p.h b/src/widgets/private/dmessagemanager_p.h new file mode 100644 index 000000000..0b77cf637 --- /dev/null +++ b/src/widgets/private/dmessagemanager_p.h @@ -0,0 +1,33 @@ +// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: LGPL-3.0-or-later + +#ifndef DABOUTDIALOG_P_H +#define DABOUTDIALOG_P_H + +#include "dmessagemanager.h" + +#include + +#include +#include +#include + +DWIDGET_BEGIN_NAMESPACE + +class DMessageManagerPrivate : public DCORE_NAMESPACE::DObjectPrivate +{ +public: + DMessageManagerPrivate(DMessageManager *qq); + + QPropertyAnimation *m_aniGeometry; + QPropertyAnimation *m_aniOpacity;; + QParallelAnimationGroup *m_aniGroup; + QLabel *m_label; + + D_DECLARE_PUBLIC(DMessageManager); +}; + +DWIDGET_END_NAMESPACE + +#endif // DABOUTDIALOG_P_H