Skip to content

Commit

Permalink
Gui: fix unpressable top left buttons in MacOS
Browse files Browse the repository at this point in the history
Caused by supposedly zero sized toolbar manager widget for action shortcuts

Fixes #335
@berniev
  • Loading branch information
realthunder committed Apr 12, 2022
1 parent c9581ff commit 850c321
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/Gui/ToolBarManager.cpp
Expand Up @@ -529,9 +529,16 @@ void ToolBarManager::setup(ToolBarItem* toolBarItems)
return; // empty menu bar

static QPointer<QWidget> _ActionWidget;
if (!_ActionWidget)
if (!_ActionWidget) {
_ActionWidget = new QWidget(getMainWindow());
else {
_ActionWidget->setObjectName(QStringLiteral("_fc_action_widget_"));
// Although _ActionWidget has zero size, on MacOS it somehow has a
// 'phantom' size without any visible content and will block the top
// left tool buttons of the application main window. So we move it out
// of the way.
_ActionWidget->move(QPoint(-100,-100));

} else {
for (auto action : _ActionWidget->actions())
_ActionWidget->removeAction(action);
}
Expand Down

0 comments on commit 850c321

Please sign in to comment.