Skip to content

Commit 6fc6ef8

Browse files
committed
任务栏中插件项目的标签后面的空格不在绘制时添加,而是添加到默认标签文本中,允许用户在“显示文本设置”中删除空格
1 parent 3873fdb commit 6fc6ef8

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

TrafficMonitor/DisplayItem.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ std::wstring CommonDisplayItem::DefaultString(bool is_main_window) const
9393
if (is_plugin)
9494
{
9595
default_text = plugin_item->GetItemLableText();
96+
default_text += L' ';
9697
}
9798
else
9899
{

TrafficMonitor/TaskBarDlg.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,6 @@ void CTaskBarDlg::DrawPluginItem(IDrawCommon& drawer, IPluginItem* item, CRect r
475475
}
476476
//画标签
477477
CString lable_text = theApp.m_taskbar_data.disp_str.GetConst(item).c_str();
478-
lable_text += L' ';
479478
drawer.DrawWindowText(rect_label, lable_text, label_text_color, (vertical ? IDrawCommon::Alignment::CENTER : IDrawCommon::Alignment::LEFT));
480479
//画数值
481480
IDrawCommon::Alignment value_alignment{ theApp.m_taskbar_data.value_right_align ? IDrawCommon::Alignment::RIGHT : IDrawCommon::Alignment::LEFT }; //数值的对齐方式
@@ -841,8 +840,6 @@ void CTaskBarDlg::CalculateWindowSize()
841840
else
842841
{
843842
CString lable_text = theApp.m_taskbar_data.disp_str.GetConst(plugin).c_str();
844-
if (!lable_text.IsEmpty())
845-
lable_text += L' ';
846843
label_width = m_pDC->GetTextExtent(lable_text).cx;
847844
value_width = m_pDC->GetTextExtent(plugin->GetItemValueSampleText()).cx;
848845
}

0 commit comments

Comments
 (0)