Commit 5b1a7b16 authored by loh tar's avatar loh tar
Browse files

ToggleToolViewAction: Avoid unwanted updates

These unneeded updates caused issues on session restore, when we set in unknown
order some view status. Because hiding one tool affect some other tool too when
they are in the same tab bar.

- Only call show/hide when needed
- Avoid unneeded function call, use given parameter
parent 1b93ede0
......@@ -49,15 +49,19 @@ ToggleToolViewAction::ToggleToolViewAction(const QString &text, ToolView *tv, QO
setChecked(m_tv->toolVisible());
}
void ToggleToolViewAction::toolVisibleChanged(bool)
void ToggleToolViewAction::toolVisibleChanged(bool v)
{
if (isChecked() != m_tv->toolVisible()) {
setChecked(m_tv->toolVisible());
if (isChecked() != v) {
setChecked(v);
}
}
void ToggleToolViewAction::slotToggled(bool t)
{
if (m_tv->toolVisible() == t) {
return;
}
if (t) {
m_tv->mainWindow()->showToolView(m_tv);
m_tv->setFocus();
......
Supports Markdown
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