From c5f1b9d4bd844738da1af33f068a67087946c715 Mon Sep 17 00:00:00 2001 From: liyigang Date: Thu, 17 Oct 2024 10:50:07 +0800 Subject: [PATCH] fix: [ui]The search box loading icon is too large The search box loading icon is too large Log: The search box loading icon is too large Bug: https://pms.uniontech.com/bug-view-253889.html --- .../core/dfmplugin-titlebar/dfmplugin_titlebar_global.h | 2 ++ .../core/dfmplugin-titlebar/views/addressbar.cpp | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/plugins/filemanager/core/dfmplugin-titlebar/dfmplugin_titlebar_global.h b/src/plugins/filemanager/core/dfmplugin-titlebar/dfmplugin_titlebar_global.h index 9256298374..a09769ab4e 100644 --- a/src/plugins/filemanager/core/dfmplugin-titlebar/dfmplugin_titlebar_global.h +++ b/src/plugins/filemanager/core/dfmplugin-titlebar/dfmplugin_titlebar_global.h @@ -30,6 +30,8 @@ inline constexpr int kIconHeight { 14 }; inline constexpr int kItemHeight { 30 }; inline constexpr int kItemMargin { 8 }; inline constexpr int kCompleterMaxHeight { 260 }; +inline constexpr int kSpinnerSize { 24 }; +inline constexpr int kCompactSpinnerSize { 16 }; namespace CustomKey { inline constexpr char kUrl[] { "CrumbData_Key_Url" }; diff --git a/src/plugins/filemanager/core/dfmplugin-titlebar/views/addressbar.cpp b/src/plugins/filemanager/core/dfmplugin-titlebar/views/addressbar.cpp index 2bed7357d8..5a7381970a 100644 --- a/src/plugins/filemanager/core/dfmplugin-titlebar/views/addressbar.cpp +++ b/src/plugins/filemanager/core/dfmplugin-titlebar/views/addressbar.cpp @@ -636,7 +636,11 @@ void AddressBarPrivate::onCompletionModelCountChanged() bool AddressBarPrivate::eventFilterResize(AddressBar *addressbar, QResizeEvent *event) { Q_UNUSED(addressbar) - spinner.setFixedSize(q->height() - 8, q->height() - 8); + int spinnerSize = kSpinnerSize; +#ifdef DTKWIDGET_CLASS_DSizeMode + spinnerSize = DSizeModeHelper::element(kCompactSpinnerSize, kSpinnerSize); +#endif + spinner.setFixedSize(spinnerSize, spinnerSize); spinner.setGeometry(event->size().width() - spinner.size().width() - 45, (event->size().height() - spinner.size().height()) / 2, spinner.size().width(), spinner.size().height());