Skip to content

Commit

Permalink
sync: from linuxdeepin/dtkwidget
Browse files Browse the repository at this point in the history
Synchronize source files from linuxdeepin/dtkwidget.

Source-pull-request: linuxdeepin/dtkwidget#580
  • Loading branch information
deepin-ci-robot authored and mhduiy committed Jul 3, 2024
1 parent c45fcc3 commit ea9b690
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/widgets/daboutdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ void DAboutDialog::setProductIcon(const QIcon &icon)
#else
winId(); // TODO: wait for checking
auto window = windowHandle();
d->logoLabel->setPixmap(icon.pixmap(window->baseSize(), window->screen()->devicePixelRatio()));
d->logoLabel->setPixmap(icon.pixmap(QSize(128, 128), window->screen()->devicePixelRatio()));
#endif
}

Expand Down
20 changes: 12 additions & 8 deletions src/widgets/dmessagemanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,21 @@ template<typename IconType>
static void sendMessage_helper(DMessageManager *manager, QWidget *par, IconType icon, const QString &message)
{
QWidget *content = par->findChild<QWidget *>(D_MESSAGE_MANAGER_CONTENT, Qt::FindDirectChildrenOnly);
int text_message_count = 0;

for (DFloatingMessage *message : content->findChildren<DFloatingMessage*>(QString(), Qt::FindDirectChildrenOnly)) {
if (message->messageType() == DFloatingMessage::TransientType) {
++text_message_count;
if (content) {
int text_message_count = 0;

for (DFloatingMessage *message : content->findChildren<DFloatingMessage *>(QString(), Qt::FindDirectChildrenOnly)) {
if (message->messageType() == DFloatingMessage::TransientType) {
++text_message_count;
}
}
}

// TransientType 类型的通知消息,最多只允许同时显示三个
if (text_message_count >= 3)
return;
// TransientType 类型的通知消息,最多只允许同时显示三个
if (text_message_count >= 3) {
return;
}
}

DFloatingMessage *floMsg = new DFloatingMessage(DFloatingMessage::TransientType);
floMsg->setAttribute(Qt::WA_DeleteOnClose);
Expand Down

0 comments on commit ea9b690

Please sign in to comment.