Commit b8e92e83 authored by Jan Möbius's avatar Jan Möbius

Function to change toolbox orientation

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@10348 383ad7c9-94d9-4d36-a494-682f7c89f535
parent d8e145de
......@@ -474,9 +474,23 @@ CoreWidget( QVector<ViewMode*>& _viewModes,
wsizes = toolSplitter_->sizes();
wsizes[0] = 480;
wsizes[1] = 240;
toolSplitter_->setSizes(wsizes);
// if the toolbox should be on the right, use the defaults. Otherwise, we have to reorder them.
if ( OpenFlipperSettings().value("Core/Gui/ToolBoxOnTheRight", true).toBool() ) {
// Set relative sizes of windows
wsizes[0] = 480;
wsizes[1] = 240;
toolSplitter_->setSizes(wsizes);
} else {
// Show tool box on the left side of the main window
toolSplitter_->insertWidget(0, toolBoxArea_);
toolSplitter_->insertWidget(1, splitter_);
// Default sizes are swaped when toolbox is on the left.
wsizes[0] = 240;
wsizes[1] = 480;
toolSplitter_->setSizes(wsizes);
}
// ======================================================================
// Create pick ToolBar
......@@ -816,6 +830,43 @@ CoreWidget::showToolbox( bool _state ) {
}
}
//=============================================================================
void CoreWidget::setToolBoxOrientation(bool _toolBoxRight) {
QList<int> wsizes;
if(_toolBoxRight) {
// Show tool box on the right side of the main window
toolSplitter_->insertWidget(0, splitter_);
toolSplitter_->insertWidget(1, toolBoxArea_);
wsizes = toolSplitter_->sizes();
// Set relative sizes of windows
std::swap(wsizes[0],wsizes[1]);
toolSplitter_->setSizes(wsizes);
} else {
// Show tool box on the left side of the main window
toolSplitter_->insertWidget(0, toolBoxArea_);
toolSplitter_->insertWidget(1, splitter_);
wsizes = toolSplitter_->sizes();
// Set relative sizes of windows
std::swap(wsizes[0],wsizes[1]);
toolSplitter_->setSizes(wsizes);
}
// remove the windowstates definition for the toolboxes, as it changed anyway.
QSettings windowStates(QDir::home().absolutePath() + OpenFlipper::Options::dirSeparator() + ".OpenFlipper" +
OpenFlipper::Options::dirSeparator() + "WindowStates.dat", QSettings::IniFormat);
windowStates.value("Core/ToolSplitter");
toolSplitter_->refresh();
}
//=============================================================================
void
......
......@@ -434,6 +434,9 @@ public:
/// Slot for Changing visible toolWidgets
void slotChangeView(QString _mode, QStringList _toolboxWidgets, QStringList _toolbars, QStringList _contextmenus, bool _expandAll = false);
/// Set orientation of tool box (either on the right or the left side of the screen)
void setToolBoxOrientation(bool _toolBoxRight);
private slots:
/// Remove viewMode
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment