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