Commit 2fba3888 authored by mae's avatar mae
Browse files

Fix combobox tooltip and lock-button visibility for empty editor views

Reviewed-by: con
parent 4e4adc86
...@@ -343,6 +343,7 @@ void EditorView::setCurrentEditor(IEditor *editor) ...@@ -343,6 +343,7 @@ void EditorView::setCurrentEditor(IEditor *editor)
{ {
if (!editor || m_container->count() <= 0 if (!editor || m_container->count() <= 0
|| m_container->indexOf(editor->widget()) == -1) { || m_container->indexOf(editor->widget()) == -1) {
updateEditorStatus(0);
// ### TODO the combo box m_editorList should show an empty item // ### TODO the combo box m_editorList should show an empty item
return; return;
} }
...@@ -377,6 +378,13 @@ void EditorView::updateEditorStatus(IEditor *editor) ...@@ -377,6 +378,13 @@ void EditorView::updateEditorStatus(IEditor *editor)
static const QIcon lockedIcon(QLatin1String(":/core/images/locked.png")); static const QIcon lockedIcon(QLatin1String(":/core/images/locked.png"));
static const QIcon unlockedIcon(QLatin1String(":/core/images/unlocked.png")); static const QIcon unlockedIcon(QLatin1String(":/core/images/unlocked.png"));
m_lockButton->setVisible(editor != 0);
if (!editor) {
m_editorList->setToolTip(QString());
return;
}
if (editor->file()->isReadOnly()) { if (editor->file()->isReadOnly()) {
m_lockButton->setIcon(lockedIcon); m_lockButton->setIcon(lockedIcon);
m_lockButton->setEnabled(!editor->file()->fileName().isEmpty()); m_lockButton->setEnabled(!editor->file()->fileName().isEmpty());
......
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