The scroll-and-highlight animation when integrating an element into a project is now optional.

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/branches/0.3@1714 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
xavier
2012-04-29 20:29:40 +00:00
parent 7990889d99
commit b56a594c54
4 changed files with 18 additions and 2 deletions

View File

@@ -388,7 +388,9 @@ void ElementsPanel::panelContentChange() {
QList<ElementsLocation> ElementsPanel::elementIntegrated(QETProject *project, const ElementsLocation &location) {
// the base implementation simply refreshes the adequate category and returns the list of added locations
QList<ElementsLocation> added_locations = GenericPanel::elementIntegrated(project, location);
if (!added_locations.count()) return(added_locations);
if (!added_locations.count() || !mustHighlightIntegratedElements()) {
return(added_locations);
}
// the additional job of this method consists in displaying the integrated elements...
if (QTreeWidgetItem *integrated_element_qtwi = itemForElementsLocation(location)) {
@@ -550,6 +552,13 @@ int ElementsPanel::elementsCollectionItemsCount() {
return(items_count);
}
/**
@return true if freshly integrated elements should be highlighted, false otherwise.
*/
bool ElementsPanel::mustHighlightIntegratedElements() const {
return(QETApp::settings().value("diagrameditor/highlight-integrated-elements", true).toBool());
}
/**
Recharge l'arbre des elements
@param reload_collections true pour relire les collections depuis leurs sources (fichiers, projets...)