|
@@ -113,11 +113,12 @@ std::wstring CDiandanNatureItemUI::MakeBtnText(DuiLib::CPaintManagerUI* pManager
|
|
|
// 文本区宽度 = 按钮 185 - 左 padding 12 - 右 padding 12 - 右侧安全边距 2
|
|
// 文本区宽度 = 按钮 185 - 左 padding 12 - 右 padding 12 - 右侧安全边距 2
|
|
|
const int TEXT_AREA_W = 185 - 12 - 12 - 2;
|
|
const int TEXT_AREA_W = 185 - 12 - 12 - 2;
|
|
|
int nameFontId = selected ? 112 : 12; // 选中 13 粗体 / 未选 13 常规
|
|
int nameFontId = selected ? 112 : 12; // 选中 13 粗体 / 未选 13 常规
|
|
|
|
|
+ int priceFontId = 112; // 加价始终 13px 粗体(与属性名同字号;选中/未选中都加粗)
|
|
|
|
|
|
|
|
- // 加价:暖红橙 #F5623D,字号/字重与属性名一致(沿用按钮基础字体,仅改色,不再用 14 粗体)
|
|
|
|
|
|
|
+ // 加价:暖红橙 #F5623D + 13 粗体,与属性名同字号但恒定加粗
|
|
|
// 数字前加人民币符号 ¥(紧贴数字,+ 为加价标识)
|
|
// 数字前加人民币符号 ¥(紧贴数字,+ 为加价标识)
|
|
|
std::wstring price = L"+¥" + std::to_wstring(value);
|
|
std::wstring price = L"+¥" + std::to_wstring(value);
|
|
|
- int priceW = MeasureTextWidth(pManager, nameFontId, price);
|
|
|
|
|
|
|
+ int priceW = MeasureTextWidth(pManager, priceFontId, price);
|
|
|
|
|
|
|
|
const int MIN_GAP = 4; // 名称与加价之间的最小间距
|
|
const int MIN_GAP = 4; // 名称与加价之间的最小间距
|
|
|
|
|
|
|
@@ -140,8 +141,8 @@ std::wstring CDiandanNatureItemUI::MakeBtnText(DuiLib::CPaintManagerUI* pManager
|
|
|
int offset = TEXT_AREA_W - nameW - priceW;
|
|
int offset = TEXT_AREA_W - nameW - priceW;
|
|
|
if (offset < MIN_GAP) offset = MIN_GAP; // 兜底间距,防止极端情况下重叠
|
|
if (offset < MIN_GAP) offset = MIN_GAP; // 兜底间距,防止极端情况下重叠
|
|
|
|
|
|
|
|
- // 仅加红色,字体沿用按钮基础字体(与属性名一致),不加 <f> 标签
|
|
|
|
|
- s = showName + L"{x " + std::to_wstring(offset) + L"}<c #F5623D>" + price + L"</c>";
|
|
|
|
|
|
|
+ // 仅改红色 + 强制 13 粗体(选中/未选中都加粗,font 112),与属性名同字号
|
|
|
|
|
+ s = showName + L"{x " + std::to_wstring(offset) + L"}<c #F5623D><f 112>" + price + L"</f></c>";
|
|
|
}
|
|
}
|
|
|
return s;
|
|
return s;
|
|
|
}
|
|
}
|