修复Camera类中saveLogToolStripMenuItem字段未初始化的问题,并调整保存日志菜单位置到最末尾

This commit is contained in:
zqm
2025-11-05 15:29:20 +08:00
parent d4d50af95d
commit 2f28fb309d
3 changed files with 19 additions and 9 deletions

View File

@@ -8,9 +8,7 @@
:class="['tab-item', { 'active': activeTabIndex === index }]"
@click="setActiveTab(index)"
>
<div class="tab-title-container">
<div class="tab-title">{{ panel.title }}</div>
</div>
<div class="tab-buttons">
<button
class="button-icon p-[2px] rounded hover:opacity-100 opacity-80"
@@ -120,11 +118,6 @@ const closeTab = (tabId) => {
width: fit-content;
}
.tab-title-container {
display: flex;
align-items: center;
}
.tab-title {
text-align: left;
min-width: 0;

View File

@@ -61,13 +61,17 @@ namespace JoyD.Windows.CS.Toprie
//
// contextMenuStrip1
//
// 初始化保存日志菜单项
this.saveLogToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.imageModeToolStripMenuItem,
this.colorModeToolStripMenuItem,
this.temperatureDisplayToolStripMenuItem,
this.toolStripSeparator1,
this.saveTemperatureToolStripMenuItem,
this.pauseDetectionToolStripMenuItem});
this.pauseDetectionToolStripMenuItem,
this.saveLogToolStripMenuItem});
this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(161, 100);
//
@@ -170,6 +174,14 @@ namespace JoyD.Windows.CS.Toprie
this.saveTemperatureToolStripMenuItem.Text = "保存温度";
this.saveTemperatureToolStripMenuItem.Click += new System.EventHandler(this.SaveTemperatureToolStripMenuItem_Click);
//
// saveLogToolStripMenuItem
//
this.saveLogToolStripMenuItem.CheckOnClick = true;
this.saveLogToolStripMenuItem.Name = "saveLogToolStripMenuItem";
this.saveLogToolStripMenuItem.Size = new System.Drawing.Size(160, 22);
this.saveLogToolStripMenuItem.Text = "保存日志";
this.saveLogToolStripMenuItem.Click += new System.EventHandler(this.SaveLogToolStripMenuItem_Click);
//
// pauseDetectionToolStripMenuItem
//
this.pauseDetectionToolStripMenuItem.Name = "pauseDetectionToolStripMenuItem";
@@ -283,5 +295,6 @@ namespace JoyD.Windows.CS.Toprie
private System.Windows.Forms.ToolStripMenuItem maxTemperatureToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem avgTemperatureToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem minTemperatureToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem saveLogToolStripMenuItem;
}
}

View File

@@ -280,6 +280,10 @@ namespace JoyD.Windows.CS.Toprie
// 为右键菜单添加Opening事件用于在菜单显示前更新色彩模式的选中状态
this.contextMenuStrip1.Opening += ContextMenuStrip1_Opening;
// 初始化日志保存状态,确保与菜单项状态同步
_saveLogEnabled = false; // 默认禁用日志保存
saveLogToolStripMenuItem.Checked = _saveLogEnabled;
// 将设计模式状态传递给DeviceManager
UpdateDesignModeStatus();