Commit a318ac8d authored by mae's avatar mae
Browse files

smaller minimum size hint for the SplitterOrView, some safeguards for editor activation

parent 8fee8fb3
......@@ -752,6 +752,8 @@ IEditor *EditorManager::pickUnusedEditor() const
void EditorManager::activateEditor(IEditor *editor, OpenEditorFlags flags)
{
SplitterOrView *splitterOrView = m_d->m_currentView;
if (splitterOrView && splitterOrView->splitter())
splitterOrView = 0; // safety if currentView gets out of sync
setCurrentView(0);
if (editor && (flags & ActivateInPlace)) {
......@@ -765,9 +767,11 @@ void EditorManager::activateEditor(IEditor *editor, OpenEditorFlags flags)
if (!splitterOrView)
splitterOrView = m_d->m_splitter->findEmptyView();
if (!splitterOrView && m_d->m_currentEditor)
if (!splitterOrView && m_d->m_currentEditor) {
splitterOrView = m_d->m_splitter->findView(m_d->m_currentEditor);
if (splitterOrView && !splitterOrView->isVisible()) // safety if currentEditor gets out of sync
splitterOrView = 0;
}
if (!splitterOrView)
splitterOrView = m_d->m_splitter->findFirstView();
......@@ -1686,7 +1690,7 @@ void EditorManager::split(Qt::Orientation orientation)
if (!view)
view = m_d->m_currentEditor ? m_d->m_splitter->findView(m_d->m_currentEditor)
: m_d->m_splitter->findFirstView();
if (view) {
if (view && !view->splitter()) {
view->split(orientation);
updateEditorHistory();
}
......
......@@ -179,6 +179,9 @@ public:
SplitterOrView *findNextView(SplitterOrView *view);
QSize sizeHint() const { return QSize(32, 32); }
QSize minimumSizeHint() const { return QSize(32, 32); }
protected:
void focusInEvent(QFocusEvent *);
void paintEvent(QPaintEvent *);
......
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