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

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 ) { ...@@ -834,34 +834,40 @@ CoreWidget::showToolbox( bool _state ) {
void CoreWidget::setToolBoxOrientation(bool _toolBoxRight) { void CoreWidget::setToolBoxOrientation(bool _toolBoxRight) {
QList<int> wsizes; 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(); wsizes = toolSplitter_->sizes();
// Set relative sizes of windows // Set relative sizes of windows
std::swap(wsizes[0],wsizes[1]); std::swap(wsizes[0],wsizes[1]);
toolSplitter_->setSizes(wsizes); toolSplitter_->setSizes(wsizes);
} else { // Store new setting
OpenFlipperSettings().setValue("Core/Gui/ToolBoxOnTheRight",_toolBoxRight);
// Show tool box on the left side of the main window // remove the windowstates definition for the toolboxes, as it changed anyway.
toolSplitter_->insertWidget(0, toolBoxArea_); QSettings windowStates(QDir::home().absolutePath() + OpenFlipper::Options::dirSeparator() + ".OpenFlipper" +
toolSplitter_->insertWidget(1, splitter_); OpenFlipper::Options::dirSeparator() + "WindowStates.dat", QSettings::IniFormat);
wsizes = toolSplitter_->sizes();
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(); 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