Refine dialog lifecycle cleanup

This commit is contained in:
Codex
2026-04-09 04:45:05 +08:00
parent 97710db9e3
commit 241a564095
2 changed files with 42 additions and 79 deletions
+1 -5
View File
@@ -45,8 +45,7 @@ class Dialog : public Canvas
std::string message; //提示信息
std::vector<std::string> lines; //消息内容按行分割
bool needsInitialization = true; //是否需要初始化
bool close = false; //是否关闭
bool needsInitialization = true; // 是否需要根据当前内容重新初始化布局和内部按钮
bool modal = true; //是否模态
COLORREF backgroundColor = RGB(240, 240, 240); //背景颜色
@@ -60,7 +59,6 @@ class Dialog : public Canvas
StellarX::MessageBoxResult result = StellarX::MessageBoxResult::Cancel; // 对话框结果
bool shouldClose = false; //是否应该关闭
bool isCleaning = false; //是否正在清理
bool pendingCleanup = false; //延迟清理
public:
@@ -103,8 +101,6 @@ public:
void Show();
// 关闭对话框
void Close();
//初始化
void setInitialization(bool init); // 历史接口:当前语义更接近“请求重新布局/重建”
// 宿主窗口变化时仅重新居中,不拉伸 Dialog 自身
void recenterInHostWindow();