QmlJSInspector: Moved the property filter back into the QML observer dock

Changed around the way the background is drawn on the crumble path, so
that the background extends below the filter line edit.

Reviewed-by: Kai Koehne
This commit is contained in:
Thorbjørn Lindeijer
2011-02-16 18:01:50 +01:00
parent c74da9b7c5
commit 7f90d08c18
6 changed files with 42 additions and 43 deletions

View File

@@ -81,7 +81,6 @@ QmlInspectorToolBar::QmlInspectorToolBar(QObject *parent) :
m_menuPauseAction(0),
m_playIcon(QIcon(QLatin1String(":/qml/images/play-small.png"))),
m_pauseIcon(QIcon(QLatin1String(":/qml/images/pause-small.png"))),
m_filterExp(0),
m_colorBox(0),
m_emitSignals(true),
m_isRunning(false),
@@ -102,7 +101,6 @@ void QmlInspectorToolBar::setEnabled(bool value)
m_zoomAction->setEnabled(value);
m_colorPickerAction->setEnabled(value);
m_colorBox->setEnabled(value);
m_filterExp->setEnabled(value);
}
void QmlInspectorToolBar::enable()
@@ -304,10 +302,6 @@ void QmlInspectorToolBar::createActions(const Core::Context &context)
m_colorBox->setOuterBorderColor(QColor(58, 58, 58));
toolBarLayout->addWidget(m_colorBox);
m_filterExp = new QLineEdit(m_barWidget);
m_filterExp->setPlaceholderText("<filter property list>");
toolBarLayout->addWidget(m_filterExp);
setEnabled(false);
connect(m_fromQmlAction, SIGNAL(triggered()), SLOT(activateFromQml()));
@@ -318,7 +312,6 @@ void QmlInspectorToolBar::createActions(const Core::Context &context)
connect(m_selectAction, SIGNAL(triggered()), SLOT(activateSelectToolOnClick()));
connect(m_zoomAction, SIGNAL(triggered()), SLOT(activateZoomOnClick()));
connect(m_colorPickerAction, SIGNAL(triggered()), SLOT(activateColorPickerOnClick()));
connect(m_filterExp, SIGNAL(textChanged(QString)), SIGNAL(filterTextChanged(QString)));
Debugger::DebuggerMainWindow *mw = Debugger::DebuggerPlugin::mainWindow();
activeDebugLanguagesChanged(mw->activeDebugLanguages());

View File

@@ -42,7 +42,6 @@
QT_FORWARD_DECLARE_CLASS(QAction)
QT_FORWARD_DECLARE_CLASS(QColor)
QT_FORWARD_DECLARE_CLASS(QToolButton)
QT_FORWARD_DECLARE_CLASS(QLineEdit)
namespace Core {
class Context;
@@ -50,7 +49,6 @@ namespace Core {
namespace Utils {
class StyledBar;
class FilterLineEdit;
}
namespace QmlJSInspector {
@@ -102,7 +100,6 @@ signals:
void showAppOnTopSelected(bool isChecked);
void animationSpeedChanged(qreal slowdownFactor = 1.0f);
void filterTextChanged(const QString &);
private slots:
void activateDesignModeOnClick();
@@ -149,8 +146,6 @@ private:
QIcon m_playIcon;
QIcon m_pauseIcon;
QLineEdit *m_filterExp;
ToolBarColorBox *m_colorBox;
bool m_emitSignals;

View File

@@ -52,6 +52,7 @@
#include <utils/qtcassert.h>
#include <utils/styledbar.h>
#include <utils/stylehelper.h>
#include <coreplugin/icontext.h>
#include <coreplugin/findplaceholder.h>
@@ -94,6 +95,7 @@
#include <QtGui/QAction>
#include <QtGui/QLineEdit>
#include <QtGui/QLabel>
#include <QtGui/QPainter>
#include <QtGui/QSpinBox>
#include <QtGui/QMessageBox>
#include <QtGui/QTextBlock>
@@ -114,6 +116,24 @@ enum {
ConnectionAttemptSimultaneousInterval = 500
};
/**
* A widget that has the base color.
*/
class StyledBackground : public QWidget
{
public:
explicit StyledBackground(QWidget *parent = 0)
: QWidget(parent)
{}
protected:
void paintEvent(QPaintEvent *e)
{
QPainter p(this);
p.fillRect(e->rect(), Utils::StyleHelper::baseColor());
}
};
InspectorUi *InspectorUi::m_instance = 0;
QmlJS::ModelManagerInterface *modelManager()
@@ -126,6 +146,7 @@ InspectorUi::InspectorUi(QObject *parent)
, m_listeningToEditorManager(false)
, m_toolBar(0)
, m_crumblePath(0)
, m_filterExp(0)
, m_propertyInspector(0)
, m_settings(new InspectorSettings(this))
, m_clientProxy(0)
@@ -708,11 +729,24 @@ void InspectorUi::setupDockWidgets()
observerWidget->setWindowTitle(tr("QML Observer"));
observerWidget->setObjectName(Debugger::Constants::DOCKWIDGET_QML_INSPECTOR);
QWidget *pathAndFilterWidget = new StyledBackground;
pathAndFilterWidget->setMaximumHeight(m_crumblePath->height());
m_filterExp = new QLineEdit;
m_filterExp->setPlaceholderText("Filter properties");
m_filterExp->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred);
QHBoxLayout *pathAndFilterLayout = new QHBoxLayout(pathAndFilterWidget);
pathAndFilterLayout->setMargin(0);
pathAndFilterLayout->setSpacing(0);
pathAndFilterLayout->addWidget(m_crumblePath);
pathAndFilterLayout->addWidget(m_filterExp);
QVBoxLayout *wlay = new QVBoxLayout(observerWidget);
wlay->setMargin(0);
wlay->setSpacing(0);
observerWidget->setLayout(wlay);
wlay->addWidget(m_crumblePath);
wlay->addWidget(pathAndFilterWidget);
wlay->addWidget(m_propertyInspector);
QDockWidget *dock = mw->createDockWidget(Debugger::QmlLanguage, observerWidget);
@@ -858,7 +892,7 @@ void InspectorUi::connectSignals()
connect(m_toolBar, SIGNAL(showAppOnTopSelected(bool)),
m_clientProxy, SLOT(showAppOnTop(bool)));
connect(m_toolBar, SIGNAL(filterTextChanged(QString)),
connect(m_filterExp, SIGNAL(textChanged(QString)),
m_propertyInspector, SLOT(filterBy(QString)));
}

View File

@@ -45,6 +45,8 @@
#include <QtGui/QAction>
#include <QtCore/QObject>
QT_FORWARD_DECLARE_CLASS(QLineEdit)
namespace ProjectExplorer {
class Project;
class Environment;
@@ -157,6 +159,7 @@ private:
bool m_listeningToEditorManager;
QmlInspectorToolBar *m_toolBar;
ContextCrumblePath *m_crumblePath;
QLineEdit *m_filterExp;
QmlJSPropertyInspector *m_propertyInspector;
InspectorSettings *m_settings;