Commit e7774e46 authored by Kåre Särs's avatar Kåre Särs

Re-add Text to Search and Next buttons in the search plugin.

The text less search button had a too small hit area. The layout in
this commit is not the most compact one but feels most balanced of the
examples in the review. We will continue to search for better UI.

REVIEW: 128356
parent feaa54b6
......@@ -167,14 +167,14 @@ void KatePluginSearchView::nextFocus(QWidget *currentWidget, bool *found, bool n
// we use the object names here because there can be multiple replaceButtons (on multiple result tabs)
if (next) {
if (currentWidget->objectName() == QStringLiteral("tree")) {
if (currentWidget->objectName() == QStringLiteral("tree") || currentWidget == m_ui.binaryCheckBox) {
m_ui.newTabButton->setFocus();
*found = true;
return;
}
if (currentWidget == m_ui.displayOptions) {
if (m_ui.displayOptions->isChecked()) {
m_ui.newTabButton->setFocus();
m_ui.folderRequester->setFocus();
*found = true;
return;
}
......@@ -192,7 +192,7 @@ void KatePluginSearchView::nextFocus(QWidget *currentWidget, bool *found, bool n
else {
if (currentWidget == m_ui.newTabButton) {
if (m_ui.displayOptions->isChecked()) {
m_ui.displayOptions->setFocus();
m_ui.binaryCheckBox->setFocus();
}
else {
Results *res = qobject_cast<Results *>(m_ui.resultTabWidget->currentWidget());
......@@ -408,7 +408,7 @@ KatePluginSearchView::~KatePluginSearchView()
void KatePluginSearchView::navigateFolderUp()
{
// navigate one folder up
m_ui.folderRequester->setUrl(localFileDirUp (m_ui.folderRequester->url()));
m_ui.folderRequester->setUrl(localFileDirUp(m_ui.folderRequester->url()));
}
void KatePluginSearchView::setCurrentFolder()
......@@ -419,8 +419,9 @@ void KatePluginSearchView::setCurrentFolder()
KTextEditor::View* editView = m_mainWindow->activeView();
if (editView && editView->document()) {
// upUrl as we want the folder not the file
m_ui.folderRequester->setUrl(localFileDirUp (editView->document()->url()));
m_ui.folderRequester->setUrl(localFileDirUp(editView->document()->url()));
}
m_ui.displayOptions->setChecked(true);
}
void KatePluginSearchView::openSearchView()
......
......@@ -12,7 +12,7 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QGridLayout" name="gridLayout" columnstretch="0,0,1,0,0,0,0,0,0">
<layout class="QGridLayout" name="gridLayout" columnstretch="0,0,1,0,0,0,0,0,0,0">
<item row="0" column="0">
<widget class="QToolButton" name="newTabButton">
<property name="text">
......@@ -38,7 +38,7 @@
</widget>
</item>
<item row="0" column="3">
<widget class="QToolButton" name="searchButton">
<widget class="QPushButton" name="searchButton">
<property name="enabled">
<bool>false</bool>
</property>
......@@ -46,7 +46,7 @@
<string>Search</string>
</property>
<property name="text">
<string/>
<string>Search</string>
</property>
</widget>
</item>
......@@ -85,18 +85,15 @@
<number>0</number>
</property>
<item>
<widget class="QPushButton" name="replaceButton">
<widget class="QPushButton" name="nextButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<property name="toolTip">
<string>Next</string>
</property>
<property name="text">
<string>Replace</string>
<string>Next</string>
</property>
</widget>
</item>
......@@ -142,7 +139,7 @@
</widget>
</widget>
</item>
<item row="0" column="5" colspan="4">
<item row="0" column="5" colspan="5">
<widget class="KComboBox" name="searchPlaceCombo">
<item>
<property name="text">
......@@ -171,7 +168,7 @@
</property>
</widget>
</item>
<item row="1" column="1" alignment="Qt::AlignRight">
<item row="1" column="1">
<widget class="QLabel" name="replaceLabel">
<property name="text">
<string>Replace:</string>
......@@ -189,15 +186,12 @@
</widget>
</item>
<item row="1" column="3">
<widget class="QToolButton" name="nextButton">
<widget class="QPushButton" name="replaceButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Next</string>
</property>
<property name="text">
<string/>
<string>Replace</string>
</property>
</widget>
</item>
......@@ -272,6 +266,13 @@
</property>
</widget>
</item>
<item row="1" column="9">
<widget class="QToolButton" name="currentFolderButton">
<property name="toolTip">
<string>Use the current document's path.</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
......@@ -391,13 +392,6 @@
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="currentFolderButton">
<property name="toolTip">
<string>Use the current document's path.</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="2" column="0">
......@@ -524,21 +518,22 @@
</customwidget>
</customwidgets>
<tabstops>
<tabstop>newTabButton</tabstop>
<tabstop>searchCombo</tabstop>
<tabstop>replaceCombo</tabstop>
<tabstop>searchButton</tabstop>
<tabstop>nextButton</tabstop>
<tabstop>replaceButton</tabstop>
<tabstop>stopButton</tabstop>
<tabstop>replaceButton</tabstop>
<tabstop>replaceCheckedBtn</tabstop>
<tabstop>searchPlaceCombo</tabstop>
<tabstop>matchCase</tabstop>
<tabstop>useRegExp</tabstop>
<tabstop>expandResults</tabstop>
<tabstop>currentFolderButton</tabstop>
<tabstop>displayOptions</tabstop>
<tabstop>folderRequester</tabstop>
<tabstop>folderUpButton</tabstop>
<tabstop>currentFolderButton</tabstop>
<tabstop>filterCombo</tabstop>
<tabstop>excludeCombo</tabstop>
<tabstop>recursiveCheckBox</tabstop>
......@@ -546,7 +541,6 @@
<tabstop>symLinkCheckBox</tabstop>
<tabstop>binaryCheckBox</tabstop>
<tabstop>resultTabWidget</tabstop>
<tabstop>newTabButton</tabstop>
</tabstops>
<resources/>
<connections/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment