Add option to move SideBar to right side of window (#5114)
This commit is contained in:
@@ -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 );
|
||||
|
||||
@@ -100,6 +100,8 @@ SetupDialog::SetupDialog(ConfigTabs tab_to_open) :
|
||||
"ui", "compacttrackbuttons").toInt()),
|
||||
m_oneInstrumentTrackWindow(ConfigManager::inst()->value(
|
||||
"ui", "oneinstrumenttrackwindow").toInt()),
|
||||
m_sideBarOnRight(ConfigManager::inst()->value(
|
||||
"ui", "sidebaronright").toInt()),
|
||||
m_MMPZ(!ConfigManager::inst()->value(
|
||||
"app", "nommpz").toInt()),
|
||||
m_disableBackup(!ConfigManager::inst()->value(
|
||||
@@ -229,6 +231,8 @@ SetupDialog::SetupDialog(ConfigTabs tab_to_open) :
|
||||
m_compactTrackButtons, SLOT(toggleCompactTrackButtons(bool)), true);
|
||||
addLedCheckBox("Enable one instrument-track-window mode", gui_tw, counter,
|
||||
m_oneInstrumentTrackWindow, SLOT(toggleOneInstrumentTrackWindow(bool)), true);
|
||||
addLedCheckBox("Show sidebar on the right-hand side", gui_tw, counter,
|
||||
m_sideBarOnRight, SLOT(toggleSideBarOnRight(bool)), true);
|
||||
|
||||
gui_tw->setFixedHeight(YDelta + YDelta * counter);
|
||||
|
||||
@@ -876,6 +880,8 @@ void SetupDialog::accept()
|
||||
QString::number(m_compactTrackButtons));
|
||||
ConfigManager::inst()->setValue("ui", "oneinstrumenttrackwindow",
|
||||
QString::number(m_oneInstrumentTrackWindow));
|
||||
ConfigManager::inst()->setValue("ui", "sidebaronright",
|
||||
QString::number(m_sideBarOnRight));
|
||||
ConfigManager::inst()->setValue("app", "nommpz",
|
||||
QString::number(!m_MMPZ));
|
||||
ConfigManager::inst()->setValue("app", "disablebackup",
|
||||
@@ -980,6 +986,12 @@ void SetupDialog::toggleOneInstrumentTrackWindow(bool enabled)
|
||||
}
|
||||
|
||||
|
||||
void SetupDialog::toggleSideBarOnRight(bool enabled)
|
||||
{
|
||||
m_sideBarOnRight = enabled;
|
||||
}
|
||||
|
||||
|
||||
void SetupDialog::toggleMMPZ(bool enabled)
|
||||
{
|
||||
m_MMPZ = enabled;
|
||||
|
||||
Reference in New Issue
Block a user