From 68222e6fd36a4f06f7f407eab9a0a6efb079d064 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Thu, 2 Nov 2023 16:00:19 +0100 Subject: [PATCH] ExtensionSystem: Open PluginDialog without horizontal scroll bar This makes the dialog slightly bigger to avoid that horizontal scrollbar (when using normal font sizes). Also, the header sizing code is a bit cleaned up. The "Loaded" column takes less unnecessary space. Change-Id: Ic7db7595a88a6dcedd52dce608aa1c9c79c8a464 Reviewed-by: Reviewed-by: Eike Ziller Reviewed-by: Qt CI Bot --- src/libs/extensionsystem/pluginview.cpp | 8 ++------ src/plugins/coreplugin/plugindialog.cpp | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/libs/extensionsystem/pluginview.cpp b/src/libs/extensionsystem/pluginview.cpp index f4afedc01ea..71a8d3de764 100644 --- a/src/libs/extensionsystem/pluginview.cpp +++ b/src/libs/extensionsystem/pluginview.cpp @@ -276,10 +276,6 @@ PluginView::PluginView(QWidget *parent) m_categoryView->setAlternatingRowColors(true); m_categoryView->setIndentation(20); m_categoryView->setSortingEnabled(true); - m_categoryView->setColumnWidth(LoadedColumn, 40); - m_categoryView->header()->setDefaultSectionSize(120); - m_categoryView->header()->setMinimumSectionSize(35); - m_categoryView->header()->setSortIndicator(0, Qt::AscendingOrder); m_categoryView->setActivationMode(DoubleClickActivation); m_categoryView->setSelectionMode(QAbstractItemView::SingleSelection); m_categoryView->setSelectionBehavior(QAbstractItemView::SelectRows); @@ -298,8 +294,8 @@ PluginView::PluginView(QWidget *parent) gridLayout->addWidget(m_categoryView, 1, 0, 1, 1); QHeaderView *header = m_categoryView->header(); - header->setSectionResizeMode(0, QHeaderView::ResizeToContents); - header->setSectionResizeMode(2, QHeaderView::ResizeToContents); + header->setSortIndicator(NameColumn, Qt::AscendingOrder); + header->setSectionResizeMode(QHeaderView::ResizeToContents); connect(PluginManager::instance(), &PluginManager::pluginsChanged, this, &PluginView::updatePlugins); diff --git a/src/plugins/coreplugin/plugindialog.cpp b/src/plugins/coreplugin/plugindialog.cpp index c7f7dab2311..5e22463000c 100644 --- a/src/plugins/coreplugin/plugindialog.cpp +++ b/src/plugins/coreplugin/plugindialog.cpp @@ -52,7 +52,7 @@ PluginDialog::PluginDialog(QWidget *parent) buttonBox, }.attachTo(this); - resize(650, 400); + resize(760, 440); setWindowTitle(Tr::tr("Installed Plugins")); connect(m_view, &ExtensionSystem::PluginView::currentPluginChanged,