From a11d49efeeed7d865d19e8ff1a1f432ca527ad43 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Tue, 6 Mar 2018 16:54:49 +0100 Subject: [PATCH] NewDialog: Add option for wizard list Change-Id: I2b1b09bd64507b9875f9770d20233b7ec936f075 Reviewed-by: Alessandro Portale --- src/plugins/coreplugin/dialogs/newdialog.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/plugins/coreplugin/dialogs/newdialog.cpp b/src/plugins/coreplugin/dialogs/newdialog.cpp index 0bc113a42fb..7ae0953ad17 100644 --- a/src/plugins/coreplugin/dialogs/newdialog.cpp +++ b/src/plugins/coreplugin/dialogs/newdialog.cpp @@ -53,6 +53,7 @@ const char LAST_PLATFORM_KEY[] = "Core/NewDialog/LastPlatform"; const char ALLOW_ALL_TEMPLATES[] = "Core/NewDialog/AllowAllTemplates"; const char SHOW_PLATOFORM_FILTER[] = "Core/NewDialog/ShowPlatformFilter"; const char BLACKLISTED_CATEGORIES_KEY[] = "Core/NewDialog/BlacklistedCategories"; +const char ALTERNATIVE_WIZARD_STYLE[] = "Core/NewDialog/AlternativeWizardStyle"; using namespace Core; using namespace Core::Internal; @@ -205,6 +206,21 @@ NewDialog::NewDialog(QWidget *parent) : m_ui->templatesView->setModel(m_filterProxyModel); m_ui->templatesView->setIconSize(QSize(ICON_SIZE, ICON_SIZE)); + const bool alternativeWizardStyle = ICore::settings()->value(ALTERNATIVE_WIZARD_STYLE, false).toBool(); + + if (alternativeWizardStyle) { + m_ui->templatesView->setGridSize(QSize(256, 128)); + m_ui->templatesView->setIconSize(QSize(96, 96)); + m_ui->templatesView->setSpacing(4); + + m_ui->templatesView->setViewMode(QListView::IconMode); + m_ui->templatesView->setMovement(QListView::Static); + m_ui->templatesView->setResizeMode(QListView::Adjust); + m_ui->templatesView->setSelectionRectVisible(false); + m_ui->templatesView->setWrapping(true); + m_ui->templatesView->setWordWrap(true); + } + connect(m_ui->templateCategoryView->selectionModel(), &QItemSelectionModel::currentChanged, this, &NewDialog::currentCategoryChanged);