2023-02-16 13:51:55 +08:00
|
|
|
// SPDX-FileCopyrightText: 2018 - 2023 UnionTech Software Technology Co., Ltd.
|
2022-09-06 11:36:55 +08:00
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: LGPL-3.0-or-later
|
|
|
|
|
2018-12-27 16:54:49 +08:00
|
|
|
#include "attentioncontainer.h"
|
|
|
|
|
|
|
|
AttentionContainer::AttentionContainer(TrayPlugin *trayPlugin, QWidget *parent)
|
|
|
|
: AbstractContainer(trayPlugin, parent)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
FashionTrayWidgetWrapper *AttentionContainer::takeAttentionWrapper()
|
|
|
|
{
|
|
|
|
if (isEmpty()) {
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
return takeWrapper(wrapperList().first());
|
|
|
|
}
|
|
|
|
|
|
|
|
bool AttentionContainer::acceptWrapper(FashionTrayWidgetWrapper *wrapper)
|
|
|
|
{
|
2021-12-31 15:09:12 +08:00
|
|
|
Q_UNUSED(wrapper);
|
|
|
|
|
2018-12-27 16:54:49 +08:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
void AttentionContainer::refreshVisible()
|
|
|
|
{
|
2019-12-26 15:14:12 +08:00
|
|
|
// AbstractContainer::refreshVisible();
|
|
|
|
setContentsMargins(0, 0, 0 ,0);
|
2018-12-27 16:54:49 +08:00
|
|
|
setVisible(!isEmpty());
|
|
|
|
}
|
|
|
|
|
|
|
|
void AttentionContainer::addWrapper(FashionTrayWidgetWrapper *wrapper)
|
|
|
|
{
|
|
|
|
if (!isEmpty()) {
|
|
|
|
qDebug() << "Reject! Already contains a attention wrapper!";
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
AbstractContainer::addWrapper(wrapper);
|
|
|
|
}
|