Skip to content
Snippets Groups Projects
Commit e5c845fc authored by Jens Bache-Wiig's avatar Jens Bache-Wiig
Browse files

Fixes: Toolbar cosmetic problem

RevBy:    b_lindeijer
Details:
This resolves the problem with missing top-borders on
the find toolbar.
parent e0e929a0
No related branches found
No related tags found
No related merge requests found
...@@ -871,10 +871,11 @@ void ManhattanStyle::drawControl(ControlElement element, const QStyleOption *opt ...@@ -871,10 +871,11 @@ void ManhattanStyle::drawControl(ControlElement element, const QStyleOption *opt
painter->setPen(StyleHelper::borderColor()); painter->setPen(StyleHelper::borderColor());
if (horizontal) { if (horizontal) {
// Note: This is a hack to determine if we are the topmost // Note: This is a hack to determine if the
// toolbar and menu bar should draw the outline // toolbar should draw the top or bottom outline
// (needed for the find toolbar for instance)
QColor lighter(255, 255, 255, 40); QColor lighter(255, 255, 255, 40);
if (widget->mapToParent(rect.topLeft()).y()) { if (widget && widget->property("topBorder").toBool()) {
p->drawLine(rect.topLeft(), rect.topRight()); p->drawLine(rect.topLeft(), rect.topRight());
p->setPen(lighter); p->setPen(lighter);
p->drawLine(rect.topLeft() + QPoint(0, 1), rect.topRight() + QPoint(0, 1)); p->drawLine(rect.topLeft() + QPoint(0, 1), rect.topRight() + QPoint(0, 1));
......
...@@ -620,6 +620,7 @@ bool DebuggerPlugin::initialize(const QStringList &arguments, QString *error_mes ...@@ -620,6 +620,7 @@ bool DebuggerPlugin::initialize(const QStringList &arguments, QString *error_mes
m_debugMode->setWidget(splitter2); m_debugMode->setWidget(splitter2);
QToolBar *debugToolBar = new QToolBar; QToolBar *debugToolBar = new QToolBar;
debugToolBar->setProperty("topBorder", true);
debugToolBar->addAction(am->command(ProjectExplorer::Constants::DEBUG)->action()); debugToolBar->addAction(am->command(ProjectExplorer::Constants::DEBUG)->action());
debugToolBar->addAction(am->command(Constants::INTERRUPT)->action()); debugToolBar->addAction(am->command(Constants::INTERRUPT)->action());
debugToolBar->addAction(am->command(Constants::NEXT)->action()); debugToolBar->addAction(am->command(Constants::NEXT)->action());
......
...@@ -78,6 +78,7 @@ FindToolBar::FindToolBar(FindPlugin *plugin, CurrentDocumentFind *currentDocumen ...@@ -78,6 +78,7 @@ FindToolBar::FindToolBar(FindPlugin *plugin, CurrentDocumentFind *currentDocumen
m_ui.setupUi(m_widget); m_ui.setupUi(m_widget);
addWidget(m_widget); addWidget(m_widget);
setFocusProxy(m_ui.findEdit); setFocusProxy(m_ui.findEdit);
setProperty("topBorder", true);
connect(m_ui.findEdit, SIGNAL(editingFinished()), this, SLOT(invokeResetIncrementalSearch())); connect(m_ui.findEdit, SIGNAL(editingFinished()), this, SLOT(invokeResetIncrementalSearch()));
...@@ -225,16 +226,6 @@ FindToolBar::~FindToolBar() ...@@ -225,16 +226,6 @@ FindToolBar::~FindToolBar()
{ {
} }
void FindToolBar::paintEvent(QPaintEvent *event)
{
QToolBar::paintEvent(event);
QPainter p(this);
const QRect r = rect();
p.setPen(StyleHelper::borderColor());
p.drawLine(r.topLeft(), r.topRight());
}
bool FindToolBar::eventFilter(QObject *obj, QEvent *event) bool FindToolBar::eventFilter(QObject *obj, QEvent *event)
{ {
if ((obj == m_ui.findEdit || obj == m_findCompleter->popup()) if ((obj == m_ui.findEdit || obj == m_findCompleter->popup())
......
...@@ -58,8 +58,6 @@ public: ...@@ -58,8 +58,6 @@ public:
void invokeClearResults(); void invokeClearResults();
void paintEvent(QPaintEvent *event);
private slots: private slots:
void invokeFindNext(); void invokeFindNext();
void invokeFindPrevious(); void invokeFindPrevious();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment