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