From 29a53d7e95508f6c7cd6c1945d2100cca98533c1 Mon Sep 17 00:00:00 2001
From: flow <thiagodonato300@gmail.com>
Date: Sat, 7 May 2022 20:42:19 -0300
Subject: fix: always have the instance toolbar be vertical

This overrides the orientation set automatically by Qt when we start
moving the toolbar around.
---
 launcher/ui/MainWindow.cpp | 3 +++
 1 file changed, 3 insertions(+)

(limited to 'launcher/ui')

diff --git a/launcher/ui/MainWindow.cpp b/launcher/ui/MainWindow.cpp
index f34cf1ab..44eba369 100644
--- a/launcher/ui/MainWindow.cpp
+++ b/launcher/ui/MainWindow.cpp
@@ -746,6 +746,9 @@ public:
         // disabled until we have an instance selected
         instanceToolBar->setEnabled(false);
         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->setToolButtonStyle(Qt::ToolButtonTextOnly);
         instanceToolBar->setFloatable(false);
-- 
cgit