feat: Manage active drawing tool state in controller and UI

Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
2026-02-13 17:33:56 -07:00
parent d51e7127af
commit 2727b73208
3 changed files with 37 additions and 0 deletions

View File

@@ -12,14 +12,24 @@ class ApplicationController : public QObject
{
Q_OBJECT
public:
enum ToolType {
None,
Line,
Rectangle,
Circle
};
Q_ENUM(ToolType)
explicit ApplicationController(QObject *parent = nullptr);
~ApplicationController();
void setMainWindow(MainWindow* mainWindow);
Document* document() const;
SketchFeature* activeSketch() const;
ToolType activeTool() const;
public slots:
void setActiveTool(ToolType tool);
void newDocument();
bool openDocument();
bool saveDocument();
@@ -32,6 +42,7 @@ signals:
void sketchModeStarted(ViewportWidget::SketchPlane plane);
void sketchModeEnded();
void currentFileChanged(const QString& path);
void activeToolChanged(ToolType tool);
private:
ApplicationController(const ApplicationController&) = delete;
@@ -43,6 +54,7 @@ private:
QString m_currentFile;
MainWindow* m_mainWindow = nullptr;
SketchFeature* m_activeSketch = nullptr;
ToolType m_activeTool = ToolType::None;
};
#endif // APPLICATIONCONTROLLER_H