forked from qt-creator/qt-creator
Make the help mode more UI consistent
- We now used styled bars where available - We use frameless windows to optimize screen space - We use the fancylineedit where possible Reviewed-by: thorbjorn
This commit is contained in:
@@ -33,6 +33,9 @@
|
||||
#include "helpmanager.h"
|
||||
#include "openpagesmanager.h"
|
||||
|
||||
#include <utils/filterlineedit.h>
|
||||
#include <utils/styledbar.h>
|
||||
|
||||
#include <QtGui/QMenu>
|
||||
#include <QtGui/QIcon>
|
||||
#include <QtGui/QStyle>
|
||||
@@ -423,19 +426,27 @@ void BookmarkWidget::setup(bool showButtons)
|
||||
regExp.setCaseSensitivity(Qt::CaseInsensitive);
|
||||
|
||||
QLayout *vlayout = new QVBoxLayout(this);
|
||||
vlayout->setMargin(4);
|
||||
vlayout->setMargin(0);
|
||||
vlayout->setSpacing(0);
|
||||
|
||||
QLabel *label = new QLabel(tr("Filter:"), this);
|
||||
vlayout->addWidget(label);
|
||||
|
||||
searchField = new QLineEdit(this);
|
||||
searchField = new Utils::FilterLineEdit(this);
|
||||
setFocusProxy(searchField);
|
||||
|
||||
Utils::StyledBar *toolbar = new Utils::StyledBar(this);
|
||||
toolbar->setSingleRow(false);
|
||||
QLayout *tbLayout = new QHBoxLayout();
|
||||
tbLayout->setMargin(4);
|
||||
tbLayout->addWidget(searchField);
|
||||
toolbar->setLayout(tbLayout);
|
||||
|
||||
vlayout->addWidget(toolbar);
|
||||
|
||||
searchField->installEventFilter(this);
|
||||
vlayout->addWidget(searchField);
|
||||
connect(searchField, SIGNAL(textChanged(const QString &)), this,
|
||||
SLOT(filterChanged()));
|
||||
|
||||
treeView = new TreeView(this);
|
||||
treeView->setFrameStyle(QFrame::NoFrame);
|
||||
vlayout->addWidget(treeView);
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
|
||||
@@ -52,7 +52,7 @@ ContentWindow::ContentWindow()
|
||||
setFocusProxy(m_contentWidget);
|
||||
|
||||
QVBoxLayout *layout = new QVBoxLayout(this);
|
||||
layout->setMargin(4);
|
||||
layout->setMargin(0);
|
||||
layout->addWidget(m_contentWidget);
|
||||
|
||||
connect(m_contentWidget, SIGNAL(customContextMenuRequested(QPoint)), this,
|
||||
@@ -63,6 +63,8 @@ ContentWindow::ContentWindow()
|
||||
QHelpContentModel *contentModel =
|
||||
qobject_cast<QHelpContentModel*>(m_contentWidget->model());
|
||||
connect(contentModel, SIGNAL(contentsCreated()), this, SLOT(expandTOC()));
|
||||
|
||||
m_contentWidget->setFrameStyle(QFrame::NoFrame);
|
||||
}
|
||||
|
||||
ContentWindow::~ContentWindow()
|
||||
|
||||
@@ -34,6 +34,9 @@
|
||||
#include "openpagesmanager.h"
|
||||
#include "topicchooser.h"
|
||||
|
||||
#include <utils/filterlineedit.h>
|
||||
#include <utils/styledbar.h>
|
||||
|
||||
#include <QtGui/QLayout>
|
||||
#include <QtGui/QLabel>
|
||||
#include <QtGui/QLineEdit>
|
||||
@@ -41,6 +44,7 @@
|
||||
#include <QtGui/QMenu>
|
||||
#include <QtGui/QContextMenuEvent>
|
||||
#include <QtGui/QListWidgetItem>
|
||||
#include <QtGui/QToolBar>
|
||||
|
||||
#include <QtHelp/QHelpEngine>
|
||||
#include <QtHelp/QHelpIndexWidget>
|
||||
@@ -52,17 +56,29 @@ IndexWindow::IndexWindow()
|
||||
, m_indexWidget(0)
|
||||
{
|
||||
QVBoxLayout *layout = new QVBoxLayout(this);
|
||||
QLabel *l = new QLabel(tr("&Look for:"));
|
||||
layout->addWidget(l);
|
||||
|
||||
m_searchLineEdit = new QLineEdit();
|
||||
l->setBuddy(m_searchLineEdit);
|
||||
m_searchLineEdit = new Utils::FilterLineEdit();
|
||||
m_searchLineEdit->setPlaceholderText(QString());
|
||||
setFocusProxy(m_searchLineEdit);
|
||||
connect(m_searchLineEdit, SIGNAL(textChanged(QString)), this,
|
||||
SLOT(filterIndices(QString)));
|
||||
m_searchLineEdit->installEventFilter(this);
|
||||
layout->setMargin(4);
|
||||
layout->addWidget(m_searchLineEdit);
|
||||
|
||||
QLabel *l = new QLabel(tr("&Look for:"));
|
||||
l->setBuddy(m_searchLineEdit);
|
||||
layout->addWidget(l);
|
||||
layout->setMargin(0);
|
||||
layout->setSpacing(0);
|
||||
|
||||
Utils::StyledBar *toolbar = new Utils::StyledBar(this);
|
||||
toolbar->setSingleRow(false);
|
||||
QLayout *tbLayout = new QHBoxLayout();
|
||||
tbLayout->setSpacing(6);
|
||||
tbLayout->setMargin(4);
|
||||
tbLayout->addWidget(l);
|
||||
tbLayout->addWidget(m_searchLineEdit);
|
||||
toolbar->setLayout(tbLayout);
|
||||
layout->addWidget(toolbar);
|
||||
|
||||
QHelpEngine *engine = &Help::HelpManager::helpEngine();
|
||||
m_indexWidget = engine->indexWidget();
|
||||
@@ -77,6 +93,7 @@ IndexWindow::IndexWindow()
|
||||
this, SIGNAL(linksActivated(QMap<QString, QUrl>, QString)));
|
||||
connect(m_searchLineEdit, SIGNAL(returnPressed()), m_indexWidget,
|
||||
SLOT(activateCurrentItem()));
|
||||
m_indexWidget->setFrameStyle(QFrame::NoFrame);
|
||||
layout->addWidget(m_indexWidget);
|
||||
|
||||
m_indexWidget->viewport()->installEventFilter(this);
|
||||
|
||||
Reference in New Issue
Block a user