Browse Source

临时保存进销存的改动

张洋 6 days ago
parent
commit
d6bcdddb33

BIN
bin/Win32/Debug/zhipuzi_pos_windows/DuiLib_d.dll


BIN
bin/Win32/Debug/zhipuzi_pos_windows/skin/input_r8_f.png


+ 12 - 12
bin/Win32/Debug/zhipuzi_pos_windows/skin/kc_doc_detail_wnd.xml

@@ -18,36 +18,36 @@
 				<HorizontalLayout name="kd_inforow1" height="46" childpadding="16">
 					<VerticalLayout name="kd_c1" width="196">
 						<Label name="kd_l1" text="标签" height="16" font="12" textcolor="#FF8A9099" align="left" valign="vcenter" />
-						<Control height="4" />
-						<Label name="kd_v1" text="值" height="26" font="113" textcolor="#FF1F2329" align="left" valign="vcenter" maxheight="26" />
+						<Control height="6" />
+						<Label name="kd_v1" text="值" height="24" font="113" textcolor="#FF1F2329" align="left" valign="vcenter" maxheight="24" maxwidth="196" autocalcwidth="true" />
 					</VerticalLayout>
 					<VerticalLayout name="kd_c2" width="196">
 						<Label name="kd_l2" text="标签" height="16" font="12" textcolor="#FF8A9099" align="left" valign="vcenter" />
-						<Control height="4" />
-						<Label name="kd_v2" text="值" height="26" font="113" textcolor="#FF1F2329" align="left" valign="vcenter" maxheight="26" />
+						<Control height="6" />
+						<Label name="kd_v2" text="值" height="24" font="113" textcolor="#FF1F2329" align="left" valign="vcenter" maxheight="24" maxwidth="196" autocalcwidth="true" />
 					</VerticalLayout>
 					<VerticalLayout name="kd_c3" width="196">
 						<Label name="kd_l3" text="标签" height="16" font="12" textcolor="#FF8A9099" align="left" valign="vcenter" />
-						<Control height="4" />
-						<Label name="kd_v3" text="值" height="26" font="113" textcolor="#FF1F2329" align="left" valign="vcenter" maxheight="26" />
+						<Control height="6" />
+						<Label name="kd_v3" text="值" height="24" font="113" textcolor="#FF1F2329" align="left" valign="vcenter" maxheight="24" maxwidth="196" autocalcwidth="true" />
 					</VerticalLayout>
 				</HorizontalLayout>
 				<Control height="12" />
 				<HorizontalLayout name="kd_inforow2" height="46" childpadding="16">
 					<VerticalLayout name="kd_c4" width="196">
 						<Label name="kd_l4" text="标签" height="16" font="12" textcolor="#FF8A9099" align="left" valign="vcenter" />
-						<Control height="4" />
-						<Label name="kd_v4" text="值" height="26" font="113" textcolor="#FF1F2329" align="left" valign="vcenter" maxheight="26" />
+						<Control height="6" />
+						<Label name="kd_v4" text="值" height="24" font="113" textcolor="#FF1F2329" align="left" valign="vcenter" maxheight="24" maxwidth="196" autocalcwidth="true" />
 					</VerticalLayout>
 					<VerticalLayout name="kd_c5" width="196">
 						<Label name="kd_l5" text="标签" height="16" font="12" textcolor="#FF8A9099" align="left" valign="vcenter" />
-						<Control height="4" />
-						<Label name="kd_v5" text="值" height="26" font="113" textcolor="#FF1F2329" align="left" valign="vcenter" maxheight="26" />
+						<Control height="6" />
+						<Label name="kd_v5" text="值" height="24" font="113" textcolor="#FF1F2329" align="left" valign="vcenter" maxheight="24" maxwidth="196" autocalcwidth="true" />
 					</VerticalLayout>
 					<VerticalLayout name="kd_c6" width="196">
 						<Label name="kd_l6" text="标签" height="16" font="12" textcolor="#FF8A9099" align="left" valign="vcenter" />
-						<Control height="4" />
-						<Label name="kd_v6" text="值" height="26" font="113" textcolor="#FF1F2329" align="left" valign="vcenter" maxheight="26" />
+						<Control height="6" />
+						<Label name="kd_v6" text="值" height="24" font="113" textcolor="#FF1F2329" align="left" valign="vcenter" maxheight="24" maxwidth="196" autocalcwidth="true" />
 					</VerticalLayout>
 				</HorizontalLayout>
 			</VerticalLayout>

+ 12 - 12
bin/Win32/Debug/zhipuzi_pos_windows/skin/kc_pd_detail_wnd.xml

@@ -14,36 +14,36 @@
 				<HorizontalLayout name="kd_inforow1" height="46" childpadding="16">
 					<VerticalLayout name="kd_c1" width="196">
 						<Label name="kd_l1" text="标签" height="16" font="12" textcolor="#FF8A9099" align="left" valign="vcenter" />
-						<Control height="4" />
-						<Label name="kd_v1" text="值" height="26" font="113" textcolor="#FF1F2329" align="left" valign="vcenter" maxheight="26" />
+						<Control height="6" />
+						<Label name="kd_v1" text="值" height="24" font="113" textcolor="#FF1F2329" align="left" valign="vcenter" maxheight="24" maxwidth="196" autocalcwidth="true" />
 					</VerticalLayout>
 					<VerticalLayout name="kd_c2" width="196">
 						<Label name="kd_l2" text="标签" height="16" font="12" textcolor="#FF8A9099" align="left" valign="vcenter" />
-						<Control height="4" />
-						<Label name="kd_v2" text="值" height="26" font="113" textcolor="#FF1F2329" align="left" valign="vcenter" maxheight="26" />
+						<Control height="6" />
+						<Label name="kd_v2" text="值" height="24" font="113" textcolor="#FF1F2329" align="left" valign="vcenter" maxheight="24" maxwidth="196" autocalcwidth="true" />
 					</VerticalLayout>
 					<VerticalLayout name="kd_c3" width="196">
 						<Label name="kd_l3" text="标签" height="16" font="12" textcolor="#FF8A9099" align="left" valign="vcenter" />
-						<Control height="4" />
-						<Label name="kd_v3" text="值" height="26" font="113" textcolor="#FF1F2329" align="left" valign="vcenter" maxheight="26" />
+						<Control height="6" />
+						<Label name="kd_v3" text="值" height="24" font="113" textcolor="#FF1F2329" align="left" valign="vcenter" maxheight="24" maxwidth="196" autocalcwidth="true" />
 					</VerticalLayout>
 				</HorizontalLayout>
 				<Control height="12" />
 				<HorizontalLayout name="kd_inforow2" height="46" childpadding="16">
 					<VerticalLayout name="kd_c4" width="196">
 						<Label name="kd_l4" text="标签" height="16" font="12" textcolor="#FF8A9099" align="left" valign="vcenter" />
-						<Control height="4" />
-						<Label name="kd_v4" text="值" height="26" font="113" textcolor="#FF1F2329" align="left" valign="vcenter" maxheight="26" />
+						<Control height="6" />
+						<Label name="kd_v4" text="值" height="24" font="113" textcolor="#FF1F2329" align="left" valign="vcenter" maxheight="24" maxwidth="196" autocalcwidth="true" />
 					</VerticalLayout>
 					<VerticalLayout name="kd_c5" width="196">
 						<Label name="kd_l5" text="标签" height="16" font="12" textcolor="#FF8A9099" align="left" valign="vcenter" />
-						<Control height="4" />
-						<Label name="kd_v5" text="值" height="26" font="113" textcolor="#FF1F2329" align="left" valign="vcenter" maxheight="26" />
+						<Control height="6" />
+						<Label name="kd_v5" text="值" height="24" font="113" textcolor="#FF1F2329" align="left" valign="vcenter" maxheight="24" maxwidth="196" autocalcwidth="true" />
 					</VerticalLayout>
 					<VerticalLayout name="kd_c6" width="196">
 						<Label name="kd_l6" text="标签" height="16" font="12" textcolor="#FF8A9099" align="left" valign="vcenter" />
-						<Control height="4" />
-						<Label name="kd_v6" text="值" height="26" font="113" textcolor="#FF1F2329" align="left" valign="vcenter" maxheight="26" />
+						<Control height="6" />
+						<Label name="kd_v6" text="值" height="24" font="113" textcolor="#FF1F2329" align="left" valign="vcenter" maxheight="24" maxwidth="196" autocalcwidth="true" />
 					</VerticalLayout>
 				</HorizontalLayout>
 			</VerticalLayout>

+ 6 - 3
bin/Win32/Debug/zhipuzi_pos_windows/skin/kucun_page.xml

@@ -546,7 +546,8 @@
 							</VerticalLayout>
 							<VerticalLayout childpadding="7">
 								<Label text="备注" font="13" textcolor="#FF5F6368" height="18" />
-								<Button name="kc_rkn_note" text="采购到货,含配送费" font="13" textcolor="#FFA8ADB3" align="left" valign="vcenter" textpadding="12,0,12,0" height="44" maxheight="44" normalimage="file='input_r8_n.png' corner='8,8,8,8'" hotimage="file='input_r8_h.png' corner='8,8,8,8'" pushedimage="file='input_r8_n.png' corner='8,8,8,8'" />
+								<!--【R56】备注改成常驻输入框:点进去直接打字,不再弹底部文字面板;占位文案走 tipvalue -->
+								<Edit name="kc_rkn_note" tipvalue="采购到货,含配送费" tipvaluecolor="#FFA8ADB3" font="13" textcolor="#FF1F2329" align="left" valign="vcenter" textpadding="12,0,12,0" height="44" maxheight="44" nativebkcolor="#FFFFFFFF" normalimage="file='input_r8_n.png' corner='8,8,8,8'" hotimage="file='input_r8_h.png' corner='8,8,8,8'" focusedimage="file='input_r8_f.png' corner='8,8,8,8'" />
 							</VerticalLayout>
 						</HorizontalLayout>
 					</VerticalLayout>
@@ -636,7 +637,8 @@
 							</VerticalLayout>
 							<VerticalLayout childpadding="7">
 								<Label text="备注" font="13" textcolor="#FF5F6368" height="18" />
-								<Button name="kc_ckn_note" text="晚市备料" font="13" textcolor="#FFA8ADB3" align="left" valign="vcenter" textpadding="12,0,12,0" height="44" maxheight="44" normalimage="file='input_r8_n.png' corner='8,8,8,8'" hotimage="file='input_r8_h.png' corner='8,8,8,8'" pushedimage="file='input_r8_n.png' corner='8,8,8,8'" />
+								<!--【R56】备注改成常驻输入框:点进去直接打字,不再弹底部文字面板;占位文案走 tipvalue -->
+								<Edit name="kc_ckn_note" tipvalue="晚市备料" tipvaluecolor="#FFA8ADB3" font="13" textcolor="#FF1F2329" align="left" valign="vcenter" textpadding="12,0,12,0" height="44" maxheight="44" nativebkcolor="#FFFFFFFF" normalimage="file='input_r8_n.png' corner='8,8,8,8'" hotimage="file='input_r8_h.png' corner='8,8,8,8'" focusedimage="file='input_r8_f.png' corner='8,8,8,8'" />
 							</VerticalLayout>
 						</HorizontalLayout>
 					</VerticalLayout>
@@ -726,7 +728,8 @@
 							</VerticalLayout>
 							<VerticalLayout childpadding="7">
 								<Label text="备注" font="13" textcolor="#FF5F6368" height="18" />
-								<Button name="kc_pdn_note" text="月末盘点" font="13" textcolor="#FFA8ADB3" align="left" valign="vcenter" textpadding="12,0,12,0" height="44" maxheight="44" normalimage="file='input_r8_n.png' corner='8,8,8,8'" hotimage="file='input_r8_h.png' corner='8,8,8,8'" pushedimage="file='input_r8_n.png' corner='8,8,8,8'" />
+								<!--【R56】备注改成常驻输入框:点进去直接打字,不再弹底部文字面板;占位文案走 tipvalue -->
+								<Edit name="kc_pdn_note" tipvalue="月末盘点" tipvaluecolor="#FFA8ADB3" font="13" textcolor="#FF1F2329" align="left" valign="vcenter" textpadding="12,0,12,0" height="44" maxheight="44" nativebkcolor="#FFFFFFFF" normalimage="file='input_r8_n.png' corner='8,8,8,8'" hotimage="file='input_r8_h.png' corner='8,8,8,8'" focusedimage="file='input_r8_f.png' corner='8,8,8,8'" />
 							</VerticalLayout>
 						</HorizontalLayout>
 					</VerticalLayout>

BIN
dll/debug/DuiLib_d.dll


+ 4 - 0
zhipuzi_pos_windows/page/CKucunPageUI.cpp

@@ -225,6 +225,10 @@ void CKucunPageUI::HideAllViews()
 	{
 		if (m_pEdit[i]) m_pEdit[i]->CloseKeypad();
 	}
+
+	// 【R56】三个新建视图里各有一个常驻原生 Edit(单据头「备注」):容器隐下去之后
+	// 必须手工催一次 SetPos,否则原生编辑框会孤零零留在屏幕上(见 KcSyncNativeEdit 注释)。
+	KcSyncNativeEditsIn(this);
 }
 
 void CKucunPageUI::SetTopTab(int idx)

+ 31 - 46
zhipuzi_pos_windows/page/CKucunViews.cpp

@@ -1439,18 +1439,14 @@ void CKucunEditViewBase::InitShow()
 {
 	CloseKeypad();
 	m_lines.clear();
-	m_headNote.clear();
 	SeedLines();
 
-	// 单据头的「备注」字段(Button 当单元格用)
-	// 【R48】占位文案按页取(设计稿 p1「采购到货,含配送费」/ p2「晚市备料」/ p3「月末盘点」)
+	// 单据头的「备注」:【R56】起是常驻输入框(Edit),点进去直接打字,不再弹底部文字面板。
+	// 占位文案与占位色由 XML 的 tipvalue / tipvaluecolor 提供(设计稿 p1「采购到货,含配送费」/
+	// p2「晚市备料」/ p3「月末盘点」),这里只负责把它清回草稿态。
 	std::wstring hn = PrefixW() + L"_note";
-	CButtonUI* pNote = FindC<CButtonUI>(hn.c_str());
-	if (pNote != NULL)
-	{
-		pNote->SetText(HeadNotePh());
-		pNote->SetTextColor(0xFFA8ADB3);
-	}
+	CEditUI* pNote = FindC<CEditUI>(hn.c_str());
+	if (pNote != NULL) pNote->SetText(L"");
 
 	RefreshAll();
 }
@@ -1555,11 +1551,14 @@ void CKucunEditViewBase::ApplyCellStyle(int i, int col)
 // ---------------------------------------------------------------- 键盘面板
 void CKucunEditViewBase::OpenKeypad(int row, int col)
 {
+	// 【R56】单据头「备注」已改成常驻输入框,不再走这块面板;面板只服务明细行的三列。
+	// 原来的 row == -1 表示「单据头备注」,那条路已删干净,这里补一道合法性守卫。
+	if (row < 0 || row >= (int)m_lines.size()) return;
+
 	m_nEditRow = row;
 	m_nEditCol = col;
 
-	if (row < 0) m_editBuf = m_headNote;
-	else if (col == KC_ECOL_QTY) m_editBuf = m_lines[row].qty;
+	if (col == KC_ECOL_QTY) m_editBuf = m_lines[row].qty;
 	else if (col == KC_ECOL_PRICE) m_editBuf = m_lines[row].price;
 	else m_editBuf = m_lines[row].note;
 
@@ -1569,6 +1568,10 @@ void CKucunEditViewBase::OpenKeypad(int row, int col)
 	CControlUI* pKp = Find(L"kc_keypad");
 	if (pKp != NULL) pKp->SetVisible(true);
 
+	// 【R56】面板挤在「主体 ↔ 底栏」之间 ⇒ 主体的高度会变,主体内那些常驻的原生 Edit
+	// (单据头备注)必须手工催一次 SetPos,否则原生子窗口会停在旧位置(见 KcSyncNativeEdit)。
+	KcSyncNativeEditsIn(m_pHost);
+
 	for (int i = 0; i < (int)m_lines.size(); i++)
 	{
 		ApplyCellStyle(i, KC_ECOL_QTY);
@@ -1603,18 +1606,17 @@ void CKucunEditViewBase::KeypadRefresh()
 	std::wstring field;
 	std::wstring unit;
 
-	if (m_nEditRow < 0) field = L"备注";
-	else
-	{
-		field = m_lines[m_nEditRow].name;
-		field += L" · ";
-		// 【R49】数量列的字段名按页面给(入库数量 / 出库数量 / 实盘数量),见 QtyColLabel。
-		field += (m_nEditCol == KC_ECOL_QTY) ? QtyColLabel()
-			: ((m_nEditCol == KC_ECOL_PRICE) ? L"单价" : L"备注");
-		// 【R49】设计稿 p6 左栏:数值后跟一个 16px 灰的小号单位(「80 斤」)。
-		// 只有数量列有单位;单价列是「元」不显示(设计稿同)、备注列是文字。
-		if (m_nEditCol == KC_ECOL_QTY) unit = m_lines[m_nEditRow].unit;
-	}
+	// 【R56】面板只服务明细行(单据头备注已改成常驻输入框)
+	if (m_nEditRow < 0 || m_nEditRow >= (int)m_lines.size()) return;
+
+	field = m_lines[m_nEditRow].name;
+	field += L" · ";
+	// 【R49】数量列的字段名按页面给(入库数量 / 出库数量 / 实盘数量),见 QtyColLabel。
+	field += (m_nEditCol == KC_ECOL_QTY) ? QtyColLabel()
+		: ((m_nEditCol == KC_ECOL_PRICE) ? L"单价" : L"备注");
+	// 【R49】设计稿 p6 左栏:数值后跟一个 16px 灰的小号单位(「80 斤」)。
+	// 只有数量列有单位;单价列是「元」不显示(设计稿同)、备注列是文字。
+	if (m_nEditCol == KC_ECOL_QTY) unit = m_lines[m_nEditRow].unit;
 
 	SetLabel(L"kc_kp_field", field.c_str(), 0);
 	SetLabel(L"kc_kp_txtfield", field.c_str(), 0);
@@ -1685,28 +1687,8 @@ void CKucunEditViewBase::KpCommit()
 {
 	CEditUI* pEdit = FindC<CEditUI>(L"kc_kp_edit");
 
-	if (m_nEditRow < 0)
-	{
-		// 单据头备注
-		if (pEdit != NULL) m_headNote = (LPCTSTR)pEdit->GetText();
-		std::wstring hn = PrefixW() + L"_note";
-		CButtonUI* pNote = FindC<CButtonUI>(hn.c_str());
-		if (pNote != NULL)
-		{
-			if (m_headNote.empty())
-			{
-				pNote->SetText(HeadNotePh());
-				pNote->SetTextColor(0xFFA8ADB3);
-			}
-			else
-			{
-				pNote->SetText(m_headNote.c_str());
-				pNote->SetTextColor(0xFF1F2329);
-			}
-		}
-		CloseKeypad();
-		return;
-	}
+	// 【R56】单据头备注的提交分支已删:它现在是常驻输入框,值由 Edit 自己持有,不经过面板。
+	if (m_nEditRow < 0 || m_nEditRow >= (int)m_lines.size()) { CloseKeypad(); return; }
 
 	if (m_nEditCol == KC_ECOL_NOTE)
 	{
@@ -1739,6 +1721,8 @@ void CKucunEditViewBase::CloseKeypad()
 	// 键盘的文本面板里有原生 Edit:容器隐下去之后必须催一次 SetPos,
 	// 否则它会孤零零留在屏幕上(原因见 CKucunViews.h 里 KcSyncNativeEdit 的注释)。
 	if (pKp != NULL) KcSyncNativeEditsIn(pKp);
+	// 【R56】面板收起 ⇒ 主体高度还原,主体内的常驻 Edit(单据头备注)同样要重新定位。
+	KcSyncNativeEditsIn(m_pHost);
 
 	SyncFootTip(false);	// 【R49】收起键盘 ⇔ 底栏提示还原
 
@@ -1773,7 +1757,8 @@ void CKucunEditViewBase::OnClick(TNotifyUI& msg)
 	if (n.size() <= pfx.size() || n.compare(0, pfx.size(), pfx) != 0) return;
 	std::wstring tail = n.substr(pfx.size());          // 例:"_qty_3"
 
-	if (tail == L"_note") { OpenKeypad(-1, KC_ECOL_NOTE); return; }   // 单据头备注
+	// 【R56】单据头「备注」已改成常驻输入框(Edit),「点它弹面板」这条路径已删。
+	// 它的名字形如 kc_rkn_note,落到下面是 tail == "_note"、rfind('_') == 0 ⇒ 直接 return,安全。
 	if (tail.size() < 4 || tail[0] != L'_') return;
 
 	std::wstring::size_type p = tail.rfind(L'_');

+ 0 - 7
zhipuzi_pos_windows/page/CKucunViews.h

@@ -425,9 +425,6 @@ protected:
 	virtual bool    ReplaceOnPick() const { return false; }
 	// 该单元格是否处于「未录入」占位态(盘点未录 ⇒ 灰字)
 	virtual bool    IsCellPlaceholder(int i, int col) const { (void)i; (void)col; return false; }
-	// 【R48】单据头「备注」字段的占位文案(设计稿 p1/p2/p3 各不相同:
-	// 采购到货,含配送费 / 晚市备料 / 月末盘点),显示在 Button 上当 placeholder。
-	virtual LPCWSTR HeadNotePh() const { return L"点此输入备注"; }
 	// 【R49】键盘左栏「商品 · 字段」里的字段名。设计稿 p6 是「大米 · 入库数量」,
 	// 三个新建页各不相同(入库数量 / 出库数量 / 实盘数量),交给子类给。
 	virtual LPCWSTR QtyColLabel() const { return L"数量"; }
@@ -467,7 +464,6 @@ protected:
 
 	std::vector<KcEditLine> m_lines;
 	CContainerUI* m_pKpHost;
-	std::wstring  m_headNote;      // 单据头「备注」字段(row = -1 时复用键盘)
 	int           m_nEditRow;      // -1 = 未在编辑
 	int           m_nEditCol;
 	std::wstring  m_editBuf;       // 键盘正在编辑的值
@@ -491,7 +487,6 @@ protected:
 	virtual void    RefreshRow(int i);
 	virtual void    RefreshTot();
 	virtual void    OnLineAdded(KcEditLine& line);   // 默认数量 1 + 单价取档案
-	virtual LPCWSTR HeadNotePh() const { return L"采购到货,含配送费"; }
 	virtual LPCWSTR QtyColLabel() const { return L"入库数量"; }
 };
 
@@ -513,7 +508,6 @@ protected:
 	virtual void    RefreshTot();
 	virtual bool    IsQtyWarn(int i) const;
 	virtual void    OnLineAdded(KcEditLine& line);   // 默认出库数量 1
-	virtual LPCWSTR HeadNotePh() const { return L"晚市备料"; }
 	virtual LPCWSTR QtyColLabel() const { return L"出库数量"; }
 };
 
@@ -537,6 +531,5 @@ protected:
 	virtual bool    ReplaceOnPick() const { return true; }     // 盘点「部分商品」= 勾选结果即范围
 	virtual bool    IsCellPlaceholder(int i, int col) const;   // 实盘数量空 ⇒ 显示灰色「未录」
 	virtual void    FillByBook();                              // 「按账面库存」一键把实盘填成账面
-	virtual LPCWSTR HeadNotePh() const { return L"月末盘点"; }
 	virtual LPCWSTR QtyColLabel() const { return L"实盘数量"; }
 };

+ 24 - 1
zhipuzi_pos_windows/wnd/CKucunDetailWnd.cpp

@@ -55,20 +55,43 @@ namespace
 		if (p != NULL) p->SetFont(p->GetFont());
 	}
 
-	// 表头 6 格里的「值」:f2tag >= 0 用胶囊,否则纯文本
+	// 表头 6 格里的「值」:f2tag >= 0 用胶囊,否则纯文本(R54)
+//
+// 这里必须把「字号 / 左右内边距 / 底图」都由 C++ 写全,不能只改文字:
+//   · 皮肤里 kd_v? 是 VerticalLayout 的直接子项且不写 width ⇒ 不打开 autocalcwidth 时
+//     CLabelUI::EstimateSize 返回 cx==0,CVerticalLayoutUI::SetPos 会把它撑满整列
+//     196px,运行时贴上的 kc_tag_*.png(40x24 胶囊底图)就被九宫格铺成一整条绿带。
+//     打开 autocalcwidth 后宽度 = 文字宽 + textpadding,胶囊才是胶囊。
+//   · 胶囊态:12 号粗体 + 左右各 12px 内边距(设计稿 .tag{height:24px;padding:0 12px});
+//     纯文本态(盘点单第 2 格 f2tag == -1):必须清掉底图与内边距,否则文字会比标签
+//     缩进 12px,且同一控件复用时会残留上一次的胶囊底图。
 	void KdSetValue(CPaintManagerUI& pm, LPCTSTR name, const std::wstring& text, int tag)
 	{
 		CLabelUI* p = static_cast<CLabelUI*>(pm.FindControl(name));
 		if (p == NULL) return;
+
+		RECT rcPadding = { 0, 0, 0, 0 };
 		if (tag >= 0)
 		{
+			// 胶囊:字号 12 粗体(font 112)+ 左右各 12 内边距
+			rcPadding.left = 12;
+			rcPadding.right = 12;
+			p->SetFont(112);
 			KcApplyTag(p, text, tag);
 		}
 		else
 		{
+			// 纯文本:字号回到 13,清掉可能残留的胶囊底图与内边距
+			p->SetFont(113);
+			p->SetBkImage(L"");
 			p->SetText(text.c_str());
 			p->SetTextColor(0xFF1F2329);
 		}
+
+		// 顺序有讲究:EstimateSize 算宽度读的是 m_rcTextPadding,而 SetTextPadding 与
+		// SetFont 都会置位 m_bNeedEstimateSize ⇒ 先设内边距,最后 KdKick 踢一脚强制重算。
+		p->SetAutoCalcWidth(true);
+		p->SetTextPadding(rcPadding);
 		KdKick(p);
 	}