@ -7,8 +7,8 @@
|
||||
class ActionButton : public QToolButton {
|
||||
Q_OBJECT
|
||||
public:
|
||||
ActionButton(QAction* action, QWidget* parent = nullptr, bool use_default_action = false) : QToolButton(parent),
|
||||
m_action(action), m_use_default_action(use_default_action)
|
||||
ActionButton(QAction* action, QWidget* parent = nullptr, bool use_default_action = false)
|
||||
: QToolButton(parent), m_action(action), m_use_default_action(use_default_action)
|
||||
{
|
||||
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
|
||||
setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
|
||||
@ -229,7 +229,7 @@ void WideBar::showVisibilityMenu(QPoint const& position)
|
||||
act->setCheckable(true);
|
||||
act->setChecked(entry.bar_action->isVisible());
|
||||
|
||||
connect(act, &QAction::toggled, entry.bar_action, [this, &entry](bool toggled){
|
||||
connect(act, &QAction::toggled, entry.bar_action, [this, &entry](bool toggled) {
|
||||
entry.bar_action->setVisible(toggled);
|
||||
|
||||
// NOTE: This is needed so that disabled actions get reflected on the button when it is made visible.
|
||||
@ -245,7 +245,8 @@ void WideBar::showVisibilityMenu(QPoint const& position)
|
||||
m_bar_menu->popup(mapToGlobal(position));
|
||||
}
|
||||
|
||||
void WideBar::addContextMenuAction(QAction* action) {
|
||||
void WideBar::addContextMenuAction(QAction* action)
|
||||
{
|
||||
m_context_menu_actions.append(action);
|
||||
}
|
||||
|
||||
@ -308,5 +309,4 @@ bool WideBar::checkHash(QByteArray const& old_hash) const
|
||||
return old_hash == getHash();
|
||||
}
|
||||
|
||||
|
||||
#include "WideBar.moc"
|
||||
|
Reference in New Issue
Block a user