fix widebar action removal
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
parent
c9809fff6d
commit
a9c7e95c66
3 changed files with 18 additions and 12 deletions
|
@ -309,17 +309,15 @@ bool WideBar::checkHash(QByteArray const& old_hash) const
|
|||
return old_hash == getHash();
|
||||
}
|
||||
|
||||
void WideBar::setActionVisible(QAction* action, bool visible)
|
||||
void WideBar::removeAction(QAction* action)
|
||||
{
|
||||
auto iter = getMatching(action);
|
||||
if (iter == m_entries.end()) {
|
||||
if (iter == m_entries.end())
|
||||
return;
|
||||
}
|
||||
|
||||
iter->bar_action->setVisible(visible);
|
||||
|
||||
// NOTE: This is needed so that disabled actions get reflected on the button when it is made visible.
|
||||
static_cast<ActionButton*>(widgetForAction(iter->bar_action))->actionChanged();
|
||||
iter->bar_action->setVisible(false);
|
||||
removeAction(iter->bar_action);
|
||||
m_entries.erase(iter);
|
||||
}
|
||||
|
||||
#include "WideBar.moc"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue