From 1c111a900b351c0a5c2609ebfe1ff79e83e1f46c Mon Sep 17 00:00:00 2001 From: Lighto-Ku Date: Fri, 13 Dec 2024 14:18:29 +0800 Subject: [PATCH] fix: workspace widget layout issue 1.Set right stretch of every widgets inserted in workspace. Log: fix ui issue --- .../filemanager/dfmplugin-trash/views/emptyTrashWidget.cpp | 2 +- .../filemanager/dfmplugin-workspace/views/workspacewidget.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/filemanager/dfmplugin-trash/views/emptyTrashWidget.cpp b/src/plugins/filemanager/dfmplugin-trash/views/emptyTrashWidget.cpp index a089f53b58..a10e1f14dd 100644 --- a/src/plugins/filemanager/dfmplugin-trash/views/emptyTrashWidget.cpp +++ b/src/plugins/filemanager/dfmplugin-trash/views/emptyTrashWidget.cpp @@ -17,7 +17,7 @@ using namespace dfmplugin_trash; EmptyTrashWidget::EmptyTrashWidget(QWidget *parent) : QFrame(parent) { - + setFixedHeight(42); this->setFrameShape(QFrame::NoFrame); QHBoxLayout *emptyTrashLayout = new QHBoxLayout; QLabel *trashLabel = new QLabel(this); diff --git a/src/plugins/filemanager/dfmplugin-workspace/views/workspacewidget.cpp b/src/plugins/filemanager/dfmplugin-workspace/views/workspacewidget.cpp index 90974482ce..7dd0be3a7f 100644 --- a/src/plugins/filemanager/dfmplugin-workspace/views/workspacewidget.cpp +++ b/src/plugins/filemanager/dfmplugin-workspace/views/workspacewidget.cpp @@ -318,7 +318,7 @@ void WorkspaceWidget::initViewLayout() viewStackLayout->setContentsMargins(0, 0, 0, 0); widgetLayout = new QVBoxLayout; - widgetLayout->addLayout(viewStackLayout, 0); + widgetLayout->addLayout(viewStackLayout, 1); widgetLayout->setSpacing(0); widgetLayout->setContentsMargins(0, 0, 0, 0); setLayout(widgetLayout); @@ -366,7 +366,7 @@ void WorkspaceWidget::initCustomTopWidgets(const QUrl &url) } else { TopWidgetPtr topWidgetPtr = QSharedPointer(interface->create()); if (topWidgetPtr) { - widgetLayout->insertWidget(0, topWidgetPtr.get(), 1, Qt::AlignTop); + widgetLayout->insertWidget(0, topWidgetPtr.get()); topWidgets.insert(scheme, topWidgetPtr); topWidgetPtr->setVisible(interface->isShowFromUrl(topWidgets[scheme].data(), url) || interface->isKeepShow()); }