Skip to content

Commit

Permalink
Fix for ticket #414 (legend size is not remembered).
Browse files Browse the repository at this point in the history
Also provides a toggle to let the user set whether dragging the
legend/map splitter causes continuous map redraws or not.


git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@6198 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
g_j_m committed Dec 7, 2006
1 parent 8a0dd8f commit 8a101d9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
14 changes: 13 additions & 1 deletion src/gui/qgisapp.cpp
Expand Up @@ -366,6 +366,10 @@ void QgisApp::readSettings()
// Add the recently accessed project file paths to the File menu
mRecentProjectPaths = settings.readListEntry("/UI/recentProjectsList");

// Set the behaviour when the map splitters are resized
bool splitterRedraw = settings.value("/qgis/splitterRedraw", true).toBool();
canvasLegendSplit->setOpaqueResize(splitterRedraw);
legendOverviewSplit->setOpaqueResize(splitterRedraw);
}


Expand Down Expand Up @@ -1244,7 +1248,8 @@ void QgisApp::saveWindowState()
settings.writeEntry("/Geometry/y", p.y());
settings.writeEntry("/Geometry/w", s.width());
settings.writeEntry("/Geometry/h", s.height());

settings.setValue("/Geometry/canvasSplitterState", canvasLegendSplit->saveState());
settings.setValue("/Geometry/legendSplitterState", legendOverviewSplit->saveState());
}

void QgisApp::restoreWindowState()
Expand All @@ -1264,6 +1269,9 @@ void QgisApp::restoreWindowState()
int y = settings.readNumEntry("/Geometry/y", (dh - 400) / 2);
resize(w, h);
move(x, y);

canvasLegendSplit->restoreState(settings.value("/Geometry/canvasSplitterState").toByteArray());
legendOverviewSplit->restoreState(settings.value("/Geometry/legendSplitterState").toByteArray());
}
///////////// END OF GUI SETUP ROUTINES ///////////////

Expand Down Expand Up @@ -4139,6 +4147,10 @@ void QgisApp::options()
int action = mySettings.value("/qgis/wheel_action", 0).toInt();
double zoomFactor = mySettings.value("/qgis/zoom_factor", 2).toDouble();
mMapCanvas->setWheelAction((QgsMapCanvas::WheelAction) action, zoomFactor);

bool splitterRedraw = mySettings.value("/qgis/splitterRedraw", true).toBool();
canvasLegendSplit->setOpaqueResize(splitterRedraw);
legendOverviewSplit->setOpaqueResize(splitterRedraw);
}
}

Expand Down
6 changes: 5 additions & 1 deletion src/gui/qgsoptions.cpp
Expand Up @@ -141,6 +141,8 @@ QgsOptions::QgsOptions(QWidget *parent, Qt::WFlags fl) :

cmbWheelAction->setCurrentIndex(settings.value("/qgis/wheel_action", 0).toInt());
spinZoomFactor->setValue(settings.value("/qgis/zoom_factor", 2).toDouble());

splitterRedrawCB->setChecked(settings.value("/qgis/splitterRedraw", QVariant(true)).toBool());
}

//! Destructor
Expand Down Expand Up @@ -248,7 +250,9 @@ void QgsOptions::saveOptions()

settings.writeEntry("/qgis/wheel_action", cmbWheelAction->currentIndex());
settings.writeEntry("/qgis/zoom_factor", spinZoomFactor->value());


settings.setValue("/qgis/splitterRedraw", splitterRedrawCB->isChecked());

//all done
accept();
}
Expand Down

0 comments on commit 8a101d9

Please sign in to comment.