Add-folder wizard: Make sure there is a scrollbar if folder names are too long
authorOlivier Goffart <ogoffart@woboq.com>
Mon, 23 Mar 2015 15:28:42 +0000 (16:28 +0100)
committerOlivier Goffart <ogoffart@woboq.com>
Mon, 23 Mar 2015 15:32:41 +0000 (16:32 +0100)
Fixes #2962

src/gui/folderwizard.cpp

index 6326194cd3523bc1d982fd0e08f40d6bd29e56a1..88097f67978a43b019cfd53a2d8f52a72c1cda84 100644 (file)
@@ -246,6 +246,12 @@ FolderWizardRemotePath::FolderWizardRemotePath(AccountPtr account)
     _lscolTimer.setInterval(500);
     _lscolTimer.setSingleShot(true);
     connect(&_lscolTimer, SIGNAL(timeout()), SLOT(slotLsColFolderEntry()));
+
+#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
+    _ui.folderTreeWidget->header()->setSectionResizeMode(0,QHeaderView::ResizeToContents);
+    // Make sure that there will be a scrollbar when the contents is too wide
+    _ui.folderTreeWidget->header()->setStretchLastSection(false);
+#endif
 }
 
 void FolderWizardRemotePath::slotAddRemoteFolder()