diff options
author | Nadeem Hasan <nhasan@nadmm.com> | 2010-02-23 11:38:59 +0100 |
---|---|---|
committer | mae <qt-info@nokia.com> | 2010-02-23 15:30:25 +0100 |
commit | e280c0b5a5fdac34fed7975f9957dcd1ec5dcf70 (patch) | |
tree | c067cee18af31a3f28c9090ae4903980f7312e09 /src | |
parent | feacbf8a2aba95c47790dc6f0133a8976ada9cc8 (diff) | |
download | qt-creator-e280c0b5a5fdac34fed7975f9957dcd1ec5dcf70.tar.gz |
* Use prev/next icons from coreplugin resource
* Disable close button when there is no editor active
* Hide lock button when there is no editor active
* Hide the info bar when the editor is closed and no editors are left
Merge-request: 114
Reviewed-by: mae <qt-info@nokia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/coreplugin/editormanager/editorview.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/plugins/coreplugin/editormanager/editorview.cpp b/src/plugins/coreplugin/editormanager/editorview.cpp index a6c7fcd11a..c1ff15b97e 100644 --- a/src/plugins/coreplugin/editormanager/editorview.cpp +++ b/src/plugins/coreplugin/editormanager/editorview.cpp @@ -86,9 +86,9 @@ EditorView::EditorView(OpenEditorsModel *model, QWidget *parent) : m_currentNavigationHistoryPosition(0) { - m_goBackAction = new QAction(QIcon(QLatin1String(":/help/images/previous.png")), tr("Go Back"), this); + m_goBackAction = new QAction(QIcon(QLatin1String(":/core/images/prev.png")), tr("Go Back"), this); connect(m_goBackAction, SIGNAL(triggered()), this, SLOT(goBackInNavigationHistory())); - m_goForwardAction = new QAction(QIcon(QLatin1String(":/help/images/next.png")), tr("Go Forward"), this); + m_goForwardAction = new QAction(QIcon(QLatin1String(":/core/images/next.png")), tr("Go Forward"), this); connect(m_goForwardAction, SIGNAL(triggered()), this, SLOT(goForwardInNavigationHistory())); QVBoxLayout *tl = new QVBoxLayout(this); @@ -122,10 +122,11 @@ EditorView::EditorView(OpenEditorsModel *model, QWidget *parent) : m_toolBar->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); m_lockButton->setAutoRaise(true); + m_lockButton->setVisible(false); m_closeButton->setAutoRaise(true); m_closeButton->setIcon(QIcon(":/core/images/closebutton.png")); - + m_closeButton->setEnabled(false); QHBoxLayout *toplayout = new QHBoxLayout; toplayout->setSpacing(0); @@ -341,6 +342,12 @@ IEditor *EditorView::currentEditor() const void EditorView::setCurrentEditor(IEditor *editor) { + // FIXME: this keeps the editor hidden if switching from A to B and back + if (editor != m_editorForInfoWidget) { + m_infoWidget->hide(); + m_editorForInfoWidget = 0; + } + if (!editor || m_container->count() <= 0 || m_container->indexOf(editor->widget()) == -1) { updateEditorStatus(0); @@ -358,12 +365,6 @@ void EditorView::setCurrentEditor(IEditor *editor) updateEditorStatus(editor); updateToolBar(editor); updateEditorHistory(editor); - - // FIXME: this keeps the editor hidden if switching from A to B and back - if (editor != m_editorForInfoWidget) { - m_infoWidget->hide(); - m_editorForInfoWidget = 0; - } } void EditorView::checkEditorStatus() @@ -376,6 +377,7 @@ void EditorView::checkEditorStatus() void EditorView::updateEditorStatus(IEditor *editor) { m_lockButton->setVisible(editor != 0); + m_closeButton->setEnabled(editor != 0); if (!editor) { m_editorList->setToolTip(QString()); |