Fix(server): keep the full-screen status overlay steady
The window is now measured against a widest-case numeric placeholder plus the current quality name, so changing FPS/bandwidth digits and KB/MB unit switches no longer call SetWindowPos; only a quality label change does. The frame is painted into a memory DC and blitted in one go, so the layered window never shows the intermediate background-only frame that made the bar blink once per second.
This commit is contained in:
1 parent
7eebd3bd6c
commit
326e162d16
2 files changed
+36
-17
No files matched your search
@@ -181,14 +181,15 @@ protected:
|
||||
|
||||
private:
|
||||
CString m_strInfo;
|
||||
CString m_strQuality; // 最近一次的质量名,测宽时按最宽数字占位用它拼样本
|
||||
int m_nOpacityLevel;
|
||||
bool m_bVisible;
|
||||
|
||||
// 宽度按文本自适应。原来写死 170,档位名后面跟出「(链路改善)」这类切档原因时
|
||||
// 会被截断;170 现在只是下限。
|
||||
// 宽度按质量名自适应。原来写死 170,档位名后面跟出「(链路改善)」这类切档原因时
|
||||
// 会被截断;170 只是下限。FPS / 速率的位数变化不再影响宽度,避免每秒 resize。
|
||||
int m_nWidth = 170;
|
||||
CFont m_infoFont; // 绘制与测量共用,Create 里建一次
|
||||
int MeasureWidth(); // 当前文本的窗口宽度(不小于下限,按 16px 取整)
|
||||
int MeasureWidth(); // 按最宽占位算窗口宽度(不小于下限,按 16px 取整)
|
||||
void ResizeToFit(); // 宽度有变化时改窗口大小,保持中心不动
|
||||
|
||||
// 拖动支持
|
||||
|
||||
Reference in new issue
Block a user