Skip to content
Permalink
Browse files

Fix for ticket #414 (legend size is not remembered).

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@6198 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
g_j_m
g_j_m committed Dec 7, 2006
1 parent e29bbeb commit bcc3e82451023213d5ccb56e9a3d157be49a2b02
Showing with 18 additions and 2 deletions.
  1. +13 −1 src/gui/qgisapp.cpp
  2. +5 −1 src/gui/qgsoptions.cpp
@@ -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);
}


@@ -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()
@@ -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 ///////////////

@@ -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);
}
}

@@ -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
@@ -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();
}

0 comments on commit bcc3e82

Please sign in to comment.
You can’t perform that action at this time.