fix: always have the instance toolbar be vertical

This overrides the orientation set automatically by Qt when we start
moving the toolbar around.
This commit is contained in:
flow 2022-05-07 20:42:19 -03:00
parent f7f39854f8
commit 29a53d7e95
No known key found for this signature in database
GPG Key ID: 8D0F221F0A59F469

View File

@ -746,6 +746,9 @@ public:
// disabled until we have an instance selected // disabled until we have an instance selected
instanceToolBar->setEnabled(false); instanceToolBar->setEnabled(false);
instanceToolBar->setMovable(true); instanceToolBar->setMovable(true);
// Qt doesn't like vertical moving toolbars, so we have to force them...
// See https://github.com/PolyMC/PolyMC/issues/493
connect(instanceToolBar, &QToolBar::orientationChanged, [=](Qt::Orientation){ instanceToolBar->setOrientation(Qt::Vertical); });
instanceToolBar->setAllowedAreas(Qt::LeftToolBarArea | Qt::RightToolBarArea); instanceToolBar->setAllowedAreas(Qt::LeftToolBarArea | Qt::RightToolBarArea);
instanceToolBar->setToolButtonStyle(Qt::ToolButtonTextOnly); instanceToolBar->setToolButtonStyle(Qt::ToolButtonTextOnly);
instanceToolBar->setFloatable(false); instanceToolBar->setFloatable(false);