Fixed painting glitch visible on Windows

Creator would get darker and darker when dragging or clicking the mouse.
Don't paint the editor indicator when there is no view or the view has
editors.

Reviewed-by: mae
Reviewed-by: Daniel Molkentin
This commit is contained in:
Thorbjørn Lindeijer
2009-09-02 15:54:49 +02:00
parent 1fd9ebfcaf
commit 0f6f1f428c
2 changed files with 6 additions and 5 deletions

View File

@@ -554,13 +554,11 @@ IEditor *EditorManager::currentEditor() const
return m_d->m_currentEditor; return m_d->m_currentEditor;
} }
void EditorManager::emptyView(Core::Internal::EditorView *view) void EditorManager::emptyView(Core::Internal::EditorView *view)
{ {
if (!view) if (!view)
return; return;
QList<IEditor *> editors = view->editors(); QList<IEditor *> editors = view->editors();
foreach (IEditor *editor, editors) { foreach (IEditor *editor, editors) {
if (!m_d->m_editorModel->isDuplicate(editor)) { if (!m_d->m_editorModel->isDuplicate(editor)) {

View File

@@ -650,11 +650,14 @@ void SplitterOrView::mousePressEvent(QMouseEvent *e)
void SplitterOrView::paintEvent(QPaintEvent *) void SplitterOrView::paintEvent(QPaintEvent *)
{ {
if (CoreImpl::instance()->editorManager()->currentSplitterOrView() != this) if (CoreImpl::instance()->editorManager()->currentSplitterOrView() != this)
return; return;
QPainter painter(this);
// Discreet indication where an editor would be if (!m_view || hasEditors())
return;
// Discreet indication where an editor would be if there is none
QPainter painter(this);
painter.setRenderHint(QPainter::Antialiasing, true); painter.setRenderHint(QPainter::Antialiasing, true);
painter.setPen(Qt::NoPen); painter.setPen(Qt::NoPen);
QColor shadeBrush(Qt::black); QColor shadeBrush(Qt::black);