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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user