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

Updated toolbox setting function

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@10350 383ad7c9-94d9-4d36-a494-682f7c89f535
parent f84cdf0c
......@@ -834,34 +834,40 @@ CoreWidget::showToolbox( bool _state ) {
void CoreWidget::setToolBoxOrientation(bool _toolBoxRight) {
QList<int> wsizes;
if(_toolBoxRight) {
bool currentstate = OpenFlipperSettings().value("Core/Gui/ToolBoxOnTheRight",true).toBool();
if ( _toolBoxRight != currentstate ) {
if(_toolBoxRight ) {
// Show tool box on the right side of the main window
toolSplitter_->insertWidget(0, splitter_);
toolSplitter_->insertWidget(1, toolBoxArea_);
} else {
// Show tool box on the left side of the main window
toolSplitter_->insertWidget(0, toolBoxArea_);
toolSplitter_->insertWidget(1, splitter_);
}
// 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 {
// Store new setting
OpenFlipperSettings().setValue("Core/Gui/ToolBoxOnTheRight",_toolBoxRight);
// Show tool box on the left side of the main window
toolSplitter_->insertWidget(0, toolBoxArea_);
toolSplitter_->insertWidget(1, splitter_);
wsizes = toolSplitter_->sizes();
// 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");
// 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();
}
......
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