Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
ac36fac1
Commit
ac36fac1
authored
Dec 12, 2008
by
mae
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reduce startup flicker with editor toolbars.
parent
364a869e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
13 deletions
+21
-13
src/plugins/coreplugin/editormanager/editormanager.cpp
src/plugins/coreplugin/editormanager/editormanager.cpp
+5
-0
src/plugins/coreplugin/editormanager/stackededitorgroup.cpp
src/plugins/coreplugin/editormanager/stackededitorgroup.cpp
+15
-13
src/plugins/coreplugin/editormanager/stackededitorgroup.h
src/plugins/coreplugin/editormanager/stackededitorgroup.h
+1
-0
No files found.
src/plugins/coreplugin/editormanager/editormanager.cpp
View file @
ac36fac1
...
...
@@ -871,6 +871,7 @@ IEditor *EditorManager::openEditor(const QString &fileName, const QString &edito
restoreEditorState
(
editor
);
QApplication
::
restoreOverrideCursor
();
ensureEditorManagerVisible
();
setCurrentEditor
(
editor
);
return
editor
;
}
...
...
@@ -1351,6 +1352,8 @@ bool EditorManager::restoreState(const QByteArray &state)
if
(
!
success
)
return
false
;
QApplication
::
setOverrideCursor
(
Qt
::
WaitCursor
);
bool
editorChangesSuppressed
=
m_d
->
m_suppressEditorChanges
;
m_d
->
m_suppressEditorChanges
=
true
;
...
...
@@ -1366,6 +1369,8 @@ bool EditorManager::restoreState(const QByteArray &state)
m_d
->
m_suppressEditorChanges
=
editorChangesSuppressed
;
if
(
currentEditor
())
setCurrentEditor
(
currentEditor
());
// looks like a null-op but is not
QApplication
::
restoreOverrideCursor
();
return
true
;
}
...
...
src/plugins/coreplugin/editormanager/stackededitorgroup.cpp
View file @
ac36fac1
...
...
@@ -225,12 +225,11 @@ void StackedEditorGroup::insertEditor(int index, IEditor *editor)
m_widgetEditorMap
.
insert
(
editor
->
widget
(),
editor
);
QToolBar
*
toolBar
=
editor
->
toolBar
();
if
(
toolBar
)
if
(
toolBar
)
{
toolBar
->
setVisible
(
false
);
// will be made visible in setCurrentEditor
m_toolBar
->
layout
()
->
addWidget
(
toolBar
);
connect
(
editor
,
SIGNAL
(
changed
()),
this
,
SLOT
(
updateEditorStatus
()));
updateEditorStatus
(
editor
);
updateToolBar
(
editor
);
}
connect
(
editor
,
SIGNAL
(
changed
()),
this
,
SLOT
(
checkEditorStatus
()));
emit
editorAdded
(
editor
);
}
...
...
@@ -284,23 +283,26 @@ void StackedEditorGroup::setCurrentEditor(IEditor *editor)
const
bool
block
=
m_editorList
->
blockSignals
(
true
);
m_editorList
->
setCurrentIndex
(
indexOf
(
editor
));
m_editorList
->
blockSignals
(
block
);
updateEditorStatus
(
editor
);
updateToolBar
(
editor
);
}
setEditorFocus
(
idx
);
updateEditorStatus
(
editor
);
updateToolBar
(
editor
);
if
(
editor
!=
m_editorForInfoWidget
)
{
m_infoWidget
->
hide
();
m_editorForInfoWidget
=
0
;
}
}
void
StackedEditorGroup
::
update
EditorStatus
(
IEditor
*
editor
)
void
StackedEditorGroup
::
check
EditorStatus
()
{
if
(
!
editor
)
editor
=
qobject_cast
<
IEditor
*>
(
sender
());
QTC_ASSERT
(
editor
,
return
);
IEditor
*
editor
=
qobject_cast
<
IEditor
*>
(
sender
());
if
(
editor
==
currentEditor
())
updateEditorStatus
(
editor
);
}
void
StackedEditorGroup
::
updateEditorStatus
(
IEditor
*
editor
)
{
static
const
QIcon
lockedIcon
(
QLatin1String
(
":/qworkbench/images/locked.png"
));
static
const
QIcon
unlockedIcon
(
QLatin1String
(
":/qworkbench/images/unlocked.png"
));
...
...
@@ -325,8 +327,8 @@ void StackedEditorGroup::updateToolBar(IEditor *editor)
toolBar
=
m_defaultToolBar
;
if
(
m_activeToolBar
==
toolBar
)
return
;
m_activeToolBar
->
setVisible
(
false
);
toolBar
->
setVisible
(
true
);
m_activeToolBar
->
setVisible
(
false
);
m_activeToolBar
=
toolBar
;
}
...
...
src/plugins/coreplugin/editormanager/stackededitorgroup.h
View file @
ac36fac1
...
...
@@ -80,6 +80,7 @@ protected:
private
slots
:
void
sendCloseRequest
();
void
updateEditorStatus
(
Core
::
IEditor
*
editor
=
0
);
void
checkEditorStatus
();
void
setEditorFocus
(
int
index
);
void
makeEditorWritable
();
void
listSelectionChanged
(
int
index
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment