summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Bache-Wiig <jens.bache-wiig@nokia.com>2009-02-04 12:46:38 +0100
committerThorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com>2009-02-06 15:05:58 +0100
commit3b7c35fa9b452b17b986b719d1914263d472060d (patch)
treeaeb7a431ee2565fe08118606bd5595da190f966b
parent932845fc368cfd0556d463d7dd210b8f18f4ff96 (diff)
downloadqt-creator-3b7c35fa9b452b17b986b719d1914263d472060d.tar.gz
Fixes: Toolbar cosmetic problem
RevBy: b_lindeijer Details: This resolves the problem with missing top-borders on the find toolbar. (cherry picked from commit e5c845fcc7d84e4cc042fd3f0f1be883e2b4bcb0)
-rw-r--r--src/plugins/coreplugin/manhattanstyle.cpp7
-rw-r--r--src/plugins/debugger/debuggerplugin.cpp1
-rw-r--r--src/plugins/find/findtoolbar.cpp11
-rw-r--r--src/plugins/find/findtoolbar.h2
4 files changed, 6 insertions, 15 deletions
diff --git a/src/plugins/coreplugin/manhattanstyle.cpp b/src/plugins/coreplugin/manhattanstyle.cpp
index c61dbbbe3e..2bd86a6888 100644
--- a/src/plugins/coreplugin/manhattanstyle.cpp
+++ b/src/plugins/coreplugin/manhattanstyle.cpp
@@ -871,10 +871,11 @@ void ManhattanStyle::drawControl(ControlElement element, const QStyleOption *opt
painter->setPen(StyleHelper::borderColor());
if (horizontal) {
- // Note: This is a hack to determine if we are the topmost
- // toolbar and menu bar should draw the outline
+ // Note: This is a hack to determine if the
+ // toolbar should draw the top or bottom outline
+ // (needed for the find toolbar for instance)
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->setPen(lighter);
p->drawLine(rect.topLeft() + QPoint(0, 1), rect.topRight() + QPoint(0, 1));
diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp
index 82c48f37fb..b8bffaa14e 100644
--- a/src/plugins/debugger/debuggerplugin.cpp
+++ b/src/plugins/debugger/debuggerplugin.cpp
@@ -620,6 +620,7 @@ bool DebuggerPlugin::initialize(const QStringList &arguments, QString *error_mes
m_debugMode->setWidget(splitter2);
QToolBar *debugToolBar = new QToolBar;
+ debugToolBar->setProperty("topBorder", true);
debugToolBar->addAction(am->command(ProjectExplorer::Constants::DEBUG)->action());
debugToolBar->addAction(am->command(Constants::INTERRUPT)->action());
debugToolBar->addAction(am->command(Constants::NEXT)->action());
diff --git a/src/plugins/find/findtoolbar.cpp b/src/plugins/find/findtoolbar.cpp
index 7d8072b7ac..e4bb642a48 100644
--- a/src/plugins/find/findtoolbar.cpp
+++ b/src/plugins/find/findtoolbar.cpp
@@ -78,6 +78,7 @@ FindToolBar::FindToolBar(FindPlugin *plugin, CurrentDocumentFind *currentDocumen
m_ui.setupUi(m_widget);
addWidget(m_widget);
setFocusProxy(m_ui.findEdit);
+ setProperty("topBorder", true);
connect(m_ui.findEdit, SIGNAL(editingFinished()), this, SLOT(invokeResetIncrementalSearch()));
@@ -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)
{
if ((obj == m_ui.findEdit || obj == m_findCompleter->popup())
diff --git a/src/plugins/find/findtoolbar.h b/src/plugins/find/findtoolbar.h
index ce3dfdd744..030a57876a 100644
--- a/src/plugins/find/findtoolbar.h
+++ b/src/plugins/find/findtoolbar.h
@@ -58,8 +58,6 @@ public:
void invokeClearResults();
- void paintEvent(QPaintEvent *event);
-
private slots:
void invokeFindNext();
void invokeFindPrevious();