Skip to content

Commit b05d615

Browse files
committed
Windows8/8.1下任务栏窗口背景颜色默认不使用纯黑色,以获得更好的显示效果
1 parent bee3594 commit b05d615

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

TrafficMonitor/Common.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -944,8 +944,17 @@ void CCommon::SetColorMode(ColorMode mode)
944944
switch (mode)
945945
{
946946
case ColorMode::Default:
947-
CTrafficMonitorApp::self->m_taskbar_data.dft_back_color = 0;
948-
CTrafficMonitorApp::self->m_taskbar_data.dft_transparent_color = 0;
947+
//Win8/8.1下背景色和透明色不使用纯黑色
948+
if (theApp.m_win_version.IsWindows8Or8point1())
949+
{
950+
CTrafficMonitorApp::self->m_taskbar_data.dft_back_color = RGB(0, 0, 1);
951+
CTrafficMonitorApp::self->m_taskbar_data.dft_transparent_color = RGB(0, 0, 1);
952+
}
953+
else
954+
{
955+
CTrafficMonitorApp::self->m_taskbar_data.dft_back_color = 0;
956+
CTrafficMonitorApp::self->m_taskbar_data.dft_transparent_color = 0;
957+
}
949958
CTrafficMonitorApp::self->m_taskbar_data.dft_status_bar_color = 0x005A5A5A;
950959
CTrafficMonitorApp::self->m_taskbar_data.dft_text_colors = 0x00ffffffU;
951960
CTrafficMonitorApp::self->m_cfg_data.m_dft_notify_icon = 0;

TrafficMonitor/TaskbarDefaultStyle.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,11 @@ void CTaskbarDefaultStyle::LoadConfig()
1919
for (int i = 0; i < TASKBAR_DEFAULT_STYLE_NUM; i++)
2020
{
2121
COLORREF default_text_color = (TASKBAR_DEFAULT_LIGHT_STYLE(i) ? RGB(0, 0, 0) : RGB(255, 255, 255));
22-
COLORREF default_back_color = (TASKBAR_DEFAULT_LIGHT_STYLE(i) ? RGB(210, 210, 211) : 0);
23-
COLORREF default_transparent_color = (TASKBAR_DEFAULT_LIGHT_STYLE(i) ? RGB(210, 210, 211) : 0);
22+
COLORREF darkmode_default_back_color = 0;
23+
if (theApp.m_win_version.IsWindows8Or8point1())
24+
darkmode_default_back_color = RGB(0, 0, 1);
25+
COLORREF default_back_color = (TASKBAR_DEFAULT_LIGHT_STYLE(i) ? RGB(210, 210, 211) : darkmode_default_back_color);
26+
COLORREF default_transparent_color = (TASKBAR_DEFAULT_LIGHT_STYLE(i) ? RGB(210, 210, 211) : darkmode_default_back_color);
2427
COLORREF default_status_bar_color = (TASKBAR_DEFAULT_LIGHT_STYLE(i) ? RGB(165, 165, 165) : 0x005A5A5A);
2528
wchar_t buff[64];
2629
swprintf_s(buff, L"default%d_", i + 1);

0 commit comments

Comments
 (0)