Commit 24be5840 authored by Eike Ziller's avatar Eike Ziller
Browse files

Search result pane: Make the history combo box more present



By adding a title, and a left border.

Change-Id: Id8a577c9011c7a7282f5b540e94e8f809481b6fa
Task-number: QTCREATORBUG-9104
Reviewed-by: default avatarLeena Miettinen <riitta-leena.miettinen@digia.com>
parent c3d10509
......@@ -36,15 +36,17 @@
#include <coreplugin/coreconstants.h>
#include <coreplugin/icontext.h>
#include <utils/qtcassert.h>
#include <utils/styledbar.h>
#include <QSettings>
#include <QDebug>
#include <QFont>
#include <QAction>
#include <QToolButton>
#include <QComboBox>
#include <QDebug>
#include <QFont>
#include <QLabel>
#include <QScrollArea>
#include <QSettings>
#include <QStackedWidget>
#include <QToolButton>
static const char SETTINGSKEYSECTIONNAME[] = "SearchResults";
static const char SETTINGSKEYEXPANDRESULTS[] = "ExpandResults";
......@@ -90,6 +92,8 @@ namespace Internal {
QAction *m_expandCollapseAction;
static const bool m_initiallyExpand = false;
QWidget *m_spacer;
QLabel *m_historyLabel;
QWidget *m_spacer2;
QComboBox *m_recentSearchesBox;
QStackedWidget *m_widget;
QList<SearchResult *> m_searchResults;
......@@ -276,7 +280,11 @@ SearchResultWindow::SearchResultWindow(QWidget *newSearchPanel)
d->m_spacer = new QWidget;
d->m_spacer->setMinimumWidth(30);
d->m_historyLabel = new QLabel(tr("History:"));
d->m_spacer2 = new QWidget;
d->m_spacer2->setMinimumWidth(5);
d->m_recentSearchesBox = new QComboBox;
d->m_recentSearchesBox->setProperty("drawleftborder", true);
d->m_recentSearchesBox->setSizeAdjustPolicy(QComboBox::AdjustToContents);
d->m_recentSearchesBox->addItem(tr("New Search"));
connect(d->m_recentSearchesBox, SIGNAL(activated(int)), d, SLOT(setCurrentIndex(int)));
......@@ -347,7 +355,8 @@ QWidget *SearchResultWindow::outputWidget(QWidget *)
*/
QList<QWidget*> SearchResultWindow::toolBarWidgets() const
{
return QList<QWidget*>() << d->m_expandCollapseButton << d->m_spacer << d->m_recentSearchesBox;
return QList<QWidget*>() << d->m_expandCollapseButton << d->m_spacer
<< d->m_historyLabel << d->m_spacer2 << d->m_recentSearchesBox;
}
/*!
......
......@@ -923,17 +923,25 @@ void ManhattanStyle::drawComplexControl(ComplexControl control, const QStyleOpti
bool isEmpty = cb->currentText.isEmpty() && cb->currentIcon.isNull();
bool reverse = option->direction == Qt::RightToLeft;
bool drawborder = !(widget && widget->property("hideborder").toBool());
bool drawleftborder = (widget && widget->property("drawleftborder").toBool());
bool alignarrow = !(widget && widget->property("alignarrow").toBool());
if (drawborder)
if (drawborder) {
drawButtonSeparator(painter, rect, reverse);
if (drawleftborder)
drawButtonSeparator(painter, rect.adjusted(0, 0, -rect.width() + 2, 0), reverse);
}
QStyleOption toolbutton = *option;
if (isEmpty)
toolbutton.state &= ~(State_Enabled | State_Sunken);
painter->save();
if (drawborder)
painter->setClipRect(toolbutton.rect.adjusted(0, 0, -2, 0));
if (drawborder) {
int leftClipAdjust = 0;
if (drawleftborder)
leftClipAdjust = 2;
painter->setClipRect(toolbutton.rect.adjusted(leftClipAdjust, 0, -2, 0));
}
drawPrimitive(PE_PanelButtonTool, &toolbutton, painter, widget);
painter->restore();
// Draw arrow
......
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