Add option to move SideBar to right side of window (#5114)

This commit is contained in:
Kevin Zander
2020-05-04 21:46:25 -05:00
committed by GitHub
parent 6095bbc762
commit 1a6f4c1104
3 changed files with 25 additions and 4 deletions

View File

@@ -117,6 +117,7 @@ MainWindow::MainWindow() :
splitter->setChildrenCollapsible( false );
ConfigManager* confMgr = ConfigManager::inst();
bool sideBarOnRight = confMgr->value("ui", "sidebaronright").toInt();
emit initProgress(tr("Preparing plugin browser"));
sideBar->appendTab( new PluginBrowser( splitter ) );
@@ -171,7 +172,7 @@ MainWindow::MainWindow() :
embed::getIconPixmap( "computer" ).transformed( QTransform().rotate( 90 ) ),
splitter, dirs_as_items) );
m_workspace = new QMdiArea( splitter );
m_workspace = new QMdiArea(splitter);
// Load background
emit initProgress(tr("Loading background picture"));
@@ -194,9 +195,15 @@ MainWindow::MainWindow() :
m_workspace->setHorizontalScrollBarPolicy( Qt::ScrollBarAsNeeded );
m_workspace->setVerticalScrollBarPolicy( Qt::ScrollBarAsNeeded );
hbox->addWidget( sideBar );
hbox->addWidget( splitter );
hbox->addWidget(sideBar);
hbox->addWidget(splitter);
// If the user wants the sidebar on the right, we move the workspace and
// the splitter to the "left" side, or the first widgets in their list
if (sideBarOnRight)
{
splitter->insertWidget(0, m_workspace);
hbox->insertWidget(0, splitter);
}
// create global-toolbar at the top of our window
m_toolBar = new QWidget( main_widget );