Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sync: from linuxdeepin/dtkwidget #57

Merged
merged 1 commit into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
5 changes: 5 additions & 0 deletions src/widgets/dabstractdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ void DAbstractDialogPrivate::init(bool blurIfPossible)
q->setAttribute(Qt::WA_TranslucentBackground, blurIfPossible);
} else if (noTitlebarEnabled()) {
handle = new DPlatformWindowHandle(q, q);

if (!handle->enableBlurWindow()) {
handle->setEnableBlurWindow(true);
}

// fix wayland no titlebar
//q->setWindowFlags(q->windowFlags() | Qt::FramelessWindowHint);
}
Expand Down
2 changes: 2 additions & 0 deletions src/widgets/ddialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,14 @@ void DDialogPrivate::init()
spacer = new QSpacerItem(1, 0);

// MainLayout--TopLayout
mainLayout->setSpacing(0);
mainLayout->addWidget(titleBar, 0, Qt::AlignTop);
mainLayout->addWidget(contentWidget);
mainLayout->setContentsMargins(QMargins(0, 0, 0, 0));

// MainLayout--ButtonLayout
buttonLayout = new QHBoxLayout;
buttonLayout->setSpacing(5);
buttonLayout->setContentsMargins(DIALOG::BUTTON_LAYOUT_LEFT_MARGIN,
DIALOG::BUTTON_LAYOUT_TOP_MARGIN,
DIALOG::BUTTON_LAYOUT_RIGHT_MARGIN,
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
Loading