Skip to content

Commit

Permalink
Gui: [skip ci] make it configurable to set size of thumbnails
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Mar 19, 2020
1 parent 9eeceb4 commit be1fd42
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Gui/Document.cpp
Expand Up @@ -1216,14 +1216,16 @@ void Document::Save (Base::Writer &writer) const
if (writer.isForceXML() == false) {
writer.addFile("GuiDocument.xml", this);

if (App::GetApplication().GetParameterGroupByPath
("User parameter:BaseApp/Preferences/Document")->GetBool("SaveThumbnail",false)) {
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Document");
if (hGrp->GetBool("SaveThumbnail", false)) {
int size = hGrp->GetInt("ThumbnailSize", 128);
size = Base::clamp<int>(size, 64, 512);
std::list<MDIView*> mdi = getMDIViews();
for (std::list<MDIView*>::iterator it = mdi.begin(); it != mdi.end(); ++it) {
if ((*it)->getTypeId().isDerivedFrom(View3DInventor::getClassTypeId())) {
View3DInventorViewer* view = static_cast<View3DInventor*>(*it)->getViewer();
d->thumb.setFileName(d->_pcDocument->FileName.getValue());
d->thumb.setSize(128);
d->thumb.setSize(size);
d->thumb.setViewer(view);
d->thumb.Save(writer);
break;
Expand Down

0 comments on commit be1fd42

Please sign in to comment.