forked from qt-creator/qt-creator
Fix the height of the new search result pane.
For the bigger search filters like C++ Symbols & Files on File System it was unusable e.g. on Mac. Change-Id: I1839238660cc7508ada4e580388ee08d8eca8a6a Reviewed-by: Daniel Teske <daniel.teske@nokia.com> Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
This commit is contained in:
@@ -7,7 +7,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>673</width>
|
<width>673</width>
|
||||||
<height>210</height>
|
<height>240</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximumSize">
|
<property name="maximumSize">
|
||||||
@@ -17,28 +17,53 @@
|
|||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<item row="0" column="0">
|
<property name="sizeConstraint">
|
||||||
<widget class="QLabel" name="label">
|
<enum>QLayout::SetFixedSize</enum>
|
||||||
<property name="sizePolicy">
|
</property>
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
<item row="4" column="0" colspan="2">
|
||||||
<horstretch>0</horstretch>
|
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||||
<verstretch>0</verstretch>
|
<item>
|
||||||
</sizepolicy>
|
<spacer name="horizontalSpacer_3">
|
||||||
</property>
|
<property name="orientation">
|
||||||
<property name="minimumSize">
|
<enum>Qt::Horizontal</enum>
|
||||||
<size>
|
</property>
|
||||||
<width>80</width>
|
<property name="sizeHint" stdset="0">
|
||||||
<height>0</height>
|
<size>
|
||||||
</size>
|
<width>40</width>
|
||||||
</property>
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="searchButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Search</string>
|
||||||
|
</property>
|
||||||
|
<property name="default">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="replaceButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>Search && &Replace</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QLabel" name="label_2">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Sco&pe:</string>
|
<string>Sear&ch for:</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="alignment">
|
<property name="alignment">
|
||||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
</property>
|
</property>
|
||||||
<property name="buddy">
|
<property name="buddy">
|
||||||
<cstring>filterList</cstring>
|
<cstring>searchTerm</cstring>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@@ -77,22 +102,6 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
|
||||||
<widget class="QLabel" name="label_2">
|
|
||||||
<property name="text">
|
|
||||||
<string>Sear&ch for:</string>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
|
||||||
</property>
|
|
||||||
<property name="buddy">
|
|
||||||
<cstring>searchTerm</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="1">
|
|
||||||
<widget class="QLineEdit" name="searchTerm"/>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="1">
|
<item row="2" column="1">
|
||||||
<widget class="QWidget" name="widget" native="true">
|
<widget class="QWidget" name="widget" native="true">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
@@ -136,6 +145,34 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>80</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Sco&pe:</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>filterList</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="QLineEdit" name="searchTerm"/>
|
||||||
|
</item>
|
||||||
<item row="3" column="0" colspan="2">
|
<item row="3" column="0" colspan="2">
|
||||||
<widget class="QWidget" name="configWidget" native="true">
|
<widget class="QWidget" name="configWidget" native="true">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
@@ -146,53 +183,6 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="0" colspan="2">
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
|
||||||
<item>
|
|
||||||
<spacer name="horizontalSpacer_3">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>40</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="searchButton">
|
|
||||||
<property name="text">
|
|
||||||
<string>&Search</string>
|
|
||||||
</property>
|
|
||||||
<property name="default">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="replaceButton">
|
|
||||||
<property name="text">
|
|
||||||
<string>Search && &Replace</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item row="5" column="1">
|
|
||||||
<spacer name="verticalSpacer">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<tabstops>
|
<tabstops>
|
||||||
|
|||||||
@@ -40,6 +40,7 @@
|
|||||||
#include <QtGui/QStringListModel>
|
#include <QtGui/QStringListModel>
|
||||||
#include <QtGui/QCompleter>
|
#include <QtGui/QCompleter>
|
||||||
#include <QtGui/QKeyEvent>
|
#include <QtGui/QKeyEvent>
|
||||||
|
#include <QtGui/QScrollArea>
|
||||||
|
|
||||||
using namespace Find;
|
using namespace Find;
|
||||||
using namespace Find::Internal;
|
using namespace Find::Internal;
|
||||||
@@ -186,6 +187,19 @@ void FindToolWindow::setCurrentFilter(int index)
|
|||||||
configWidget->setParent(0);
|
configWidget->setParent(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
QWidget *w = m_ui.configWidget;
|
||||||
|
while (w) {
|
||||||
|
QScrollArea *sa = qobject_cast<QScrollArea *>(w);
|
||||||
|
if (sa) {
|
||||||
|
sa->updateGeometry();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
w = w->parentWidget();
|
||||||
|
}
|
||||||
|
for (w = m_configWidget ? m_configWidget : m_ui.configWidget; w; w = w->parentWidget()) {
|
||||||
|
if (w->layout())
|
||||||
|
w->layout()->activate();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void FindToolWindow::acceptAndGetParameters(QString *term, IFindFilter **filter)
|
void FindToolWindow::acceptAndGetParameters(QString *term, IFindFilter **filter)
|
||||||
|
|||||||
@@ -58,7 +58,28 @@ namespace Find {
|
|||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class SearchResultWindowPrivate : public QObject {
|
class InternalScrollArea : public QScrollArea
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
explicit InternalScrollArea(QWidget *parent)
|
||||||
|
: QScrollArea(parent)
|
||||||
|
{
|
||||||
|
setFrameStyle(QFrame::NoFrame);
|
||||||
|
setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
|
||||||
|
setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
|
||||||
|
}
|
||||||
|
|
||||||
|
QSize sizeHint() const
|
||||||
|
{
|
||||||
|
if (widget())
|
||||||
|
return widget()->size();
|
||||||
|
return QScrollArea::sizeHint();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
class SearchResultWindowPrivate : public QObject
|
||||||
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
SearchResultWindowPrivate(SearchResultWindow *window);
|
SearchResultWindowPrivate(SearchResultWindow *window);
|
||||||
@@ -210,8 +231,7 @@ SearchResultWindow::SearchResultWindow(QWidget *newSearchPanel)
|
|||||||
d->m_widget = new QStackedWidget;
|
d->m_widget = new QStackedWidget;
|
||||||
d->m_widget->setWindowTitle(displayName());
|
d->m_widget->setWindowTitle(displayName());
|
||||||
|
|
||||||
QScrollArea *newSearchArea = new QScrollArea(d->m_widget);
|
InternalScrollArea *newSearchArea = new InternalScrollArea(d->m_widget);
|
||||||
newSearchArea->setFrameStyle(QFrame::NoFrame);
|
|
||||||
newSearchArea->setWidget(newSearchPanel);
|
newSearchArea->setWidget(newSearchPanel);
|
||||||
newSearchArea->setFocusProxy(newSearchPanel);
|
newSearchArea->setFocusProxy(newSearchPanel);
|
||||||
d->m_widget->addWidget(newSearchArea);
|
d->m_widget->addWidget(newSearchArea);
|
||||||
|
|||||||
Reference in New Issue
Block a user