[Core] Add visibility toggling to ViewProvider
With this extension of the API, view providers can indicate whether document objects should be able to be toggled for visibility. There is both a C++ and Python interface, idiomatic for FreeCAD code.
This commit is contained in:
@@ -5534,7 +5534,9 @@ void DocumentObjectItem::testStatus(bool resetStatus, QIcon& icon1, QIcon& icon2
|
||||
QPainter pt;
|
||||
pt.begin(&px);
|
||||
pt.setPen(Qt::NoPen);
|
||||
pt.drawPixmap(0, 0, px_org.width(), px_org.height(), (currentStatus & Status::Visible) ? pxVisible : pxInvisible);
|
||||
if (object()->canToggleVisibility()) {
|
||||
pt.drawPixmap(0, 0, px_org.width(), px_org.height(), (currentStatus & Status::Visible) ? pxVisible : pxInvisible);
|
||||
}
|
||||
pt.drawPixmap(px_org.width() + spacing, 0, px_org.width(), px_org.height(), px_org);
|
||||
pt.end();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user