From b60c02bcc00a4a8549e16dd780bc74c0f8468c4d Mon Sep 17 00:00:00 2001 From: Andre Hartmann Date: Thu, 27 Apr 2017 20:34:33 +0200 Subject: [PATCH] SearchResultWidget: Re-layout replace options and Replace button Placing the extra options (Preserve Case and Rename Files) left to the Replace button looks more natural (you have to check them *before* pressing Replace. As benefit, the tab order automatically goes from the replace edit to the tree and from there through the extra options to the Replace button. Change-Id: I922b65f6e033a8db7a0a218aba3a714cef9fbc32 Reviewed-by: Nikolai Kosjar --- src/plugins/coreplugin/find/searchresultwidget.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/plugins/coreplugin/find/searchresultwidget.cpp b/src/plugins/coreplugin/find/searchresultwidget.cpp index 4020060757d..5bf7e492409 100644 --- a/src/plugins/coreplugin/find/searchresultwidget.cpp +++ b/src/plugins/coreplugin/find/searchresultwidget.cpp @@ -177,16 +177,16 @@ SearchResultWidget::SearchResultWidget(QWidget *parent) : m_replaceTextEdit->setMinimumWidth(120); m_replaceTextEdit->setEnabled(false); m_replaceTextEdit->setTabOrder(m_replaceTextEdit, m_searchResultTreeView); - m_replaceButton = new QToolButton(m_topReplaceWidget); - m_replaceButton->setToolTip(tr("Replace all occurrences.")); - m_replaceButton->setText(tr("&Replace")); - m_replaceButton->setToolButtonStyle(Qt::ToolButtonTextOnly); - m_replaceButton->setEnabled(false); m_preserveCaseCheck = new QCheckBox(m_topReplaceWidget); m_preserveCaseCheck->setText(tr("Preser&ve case")); m_preserveCaseCheck->setEnabled(false); m_renameFilesCheckBox = new QCheckBox(m_topReplaceWidget); m_renameFilesCheckBox->setVisible(false); + m_replaceButton = new QToolButton(m_topReplaceWidget); + m_replaceButton->setToolTip(tr("Replace all occurrences.")); + m_replaceButton->setText(tr("&Replace")); + m_replaceButton->setToolButtonStyle(Qt::ToolButtonTextOnly); + m_replaceButton->setEnabled(false); m_preserveCaseCheck->setChecked(Find::hasFindFlag(FindPreserveCase)); connect(m_preserveCaseCheck, &QAbstractButton::clicked, Find::instance(), &Find::setPreserveCase); @@ -201,9 +201,9 @@ SearchResultWidget::SearchResultWidget(QWidget *parent) : topFindLayout->addWidget(m_matchesFoundLabel); topReplaceLayout->addWidget(m_replaceLabel); topReplaceLayout->addWidget(m_replaceTextEdit); - topReplaceLayout->addWidget(m_replaceButton); topReplaceLayout->addWidget(m_preserveCaseCheck); topReplaceLayout->addWidget(m_renameFilesCheckBox); + topReplaceLayout->addWidget(m_replaceButton); topReplaceLayout->addStretch(2); setShowReplaceUI(m_replaceSupported); setSupportPreserveCase(true);