mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 20:50:34 +01:00
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:
@@ -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...)
|
||||
|
||||
Reference in New Issue
Block a user