TechDraw: Fix Dimension tool being active at wrong times

This commit is contained in:
PaddleStroke
2024-08-07 10:04:54 +02:00
committed by WandererFan
parent 4925957185
commit 55588b9035

View File

@@ -1407,7 +1407,6 @@ CmdTechDrawDimension::CmdTechDrawDimension()
sStatusTip = sToolTipText;
sPixmap = "TechDraw_Dimension";
sAccel = "D";
eType = ForEdit;
}
void CmdTechDrawDimension::activated(int iMsg)
@@ -1445,7 +1444,6 @@ public:
sToolTipText = QT_TR_NOOP("Dimension tools.");
sWhatsThis = "TechDraw_CompDimensionTools";
sStatusTip = sToolTipText;
eType = ForEdit;
setCheckable(false);
setRememberLast(false);
@@ -1478,6 +1476,13 @@ public:
}
const char* className() const override { return "CmdTechDrawCompDimensionTools"; }
bool isActive() override
{
bool havePage = DrawGuiUtil::needPage(this);
bool haveView = DrawGuiUtil::needView(this);
return (havePage && haveView);
}
};
//===========================================================================