ToolWidget-Sketcher: Tool widget basic framework

================================================

Provides a framework to show in the taskbar a taskbox with a tool settings dialog.
This commit is contained in:
Paddle
2023-10-13 14:47:33 +02:00
committed by abdullahtahiriyo
parent a1b8a2ec70
commit c62f5f30fd
12 changed files with 1791 additions and 5 deletions

View File

@@ -148,6 +148,12 @@ inline void ViewProviderSketchDrawSketchHandlerAttorney::moveConstraint(ViewProv
vp.moveConstraint(constNum, toPos);
}
inline void
ViewProviderSketchDrawSketchHandlerAttorney::signalToolChanged(const ViewProviderSketch& vp,
const std::string& toolname)
{
vp.signalToolChanged(toolname);
}
/**************************** CurveConverter **********************************************/
@@ -270,6 +276,11 @@ DrawSketchHandler::DrawSketchHandler()
DrawSketchHandler::~DrawSketchHandler()
{}
std::string DrawSketchHandler::getToolName() const
{
return "DSH_None";
}
QString DrawSketchHandler::getCrosshairCursorSVGName() const
{
return QString::fromLatin1("None");
@@ -288,6 +299,8 @@ void DrawSketchHandler::activate(ViewProviderSketch* vp)
updateCursor();
this->signalToolChanged();
this->preActivated();
this->activated();
}
@@ -308,6 +321,8 @@ void DrawSketchHandler::deactivate()
resetPositionText();
unsetCursor();
setAngleSnapping(false);
ViewProviderSketchDrawSketchHandlerAttorney::signalToolChanged(*sketchgui, "DSH_None");
}
void DrawSketchHandler::preActivated()
@@ -325,6 +340,12 @@ void DrawSketchHandler::quit()
sketchgui->purgeHandler();
}
void DrawSketchHandler::toolWidgetChanged(QWidget* newwidget)
{
toolwidget = newwidget;
onWidgetChanged();
}
//**************************************************************************
// Helpers
@@ -1145,3 +1166,8 @@ void DrawSketchHandler::moveConstraint(int constNum, const Base::Vector2d& toPos
{
ViewProviderSketchDrawSketchHandlerAttorney::moveConstraint(*sketchgui, constNum, toPos);
}
void DrawSketchHandler::signalToolChanged() const
{
ViewProviderSketchDrawSketchHandlerAttorney::signalToolChanged(*sketchgui, this->getToolName());
}