[fix] fix incorrect sizing of the online status indicator on high-DPI displays

This commit is contained in:
dijunkun
2026-03-01 16:47:09 +08:00
parent adfab363c1
commit ef02403da6
2 changed files with 10 additions and 8 deletions

View File

@@ -138,15 +138,17 @@ int Render::ShowRecentConnections() {
ImDrawList* draw_list = ImGui::GetWindowDrawList();
ImVec2 circle_pos =
ImVec2(image_screen_pos.x + recent_connection_image_width * 0.07f,
image_screen_pos.y + recent_connection_image_height * 0.13f);
image_screen_pos.y + recent_connection_image_height * 0.12f);
ImU32 fill_color =
online ? IM_COL32(0, 255, 0, 255) : IM_COL32(140, 140, 140, 255);
ImU32 border_color = IM_COL32(255, 255, 255, 230);
draw_list->AddCircleFilled(circle_pos, 6.0f, fill_color);
draw_list->AddCircle(circle_pos, 6.0f, border_color, 100, 2.0f);
ImU32 border_color = IM_COL32(255, 255, 255, 255);
float dot_radius = recent_connection_image_height * 0.06f;
draw_list->AddCircleFilled(circle_pos, dot_radius * 1.25f, border_color,
100);
draw_list->AddCircleFilled(circle_pos, dot_radius, fill_color, 100);
if (ImGui::IsMouseHoveringRect(
ImVec2(circle_pos.x - 6.0f, circle_pos.y - 6.0f),
ImVec2(circle_pos.x + 6.0f, circle_pos.y + 6.0f))) {
ImVec2(circle_pos.x - dot_radius, circle_pos.y - dot_radius),
ImVec2(circle_pos.x + dot_radius, circle_pos.y + dot_radius))) {
ImGui::BeginTooltip();
ImGui::SetWindowFontScale(0.5f);
ImGui::Text(

View File

@@ -24,12 +24,12 @@ int Render::StatusBar() {
ImVec2 dot_pos = ImVec2(status_bar_width * 0.025f,
io.DisplaySize.y * (1 - STATUS_BAR_HEIGHT * 0.5f));
ImDrawList* draw_list = ImGui::GetWindowDrawList();
draw_list->AddCircleFilled(dot_pos, status_bar_height * 0.25f,
ImColor(1.0f, 1.0f, 1.0f), 100);
draw_list->AddCircleFilled(dot_pos, status_bar_height * 0.2f,
ImColor(signal_connected_ ? 0.0f : 1.0f,
signal_connected_ ? 1.0f : 0.0f, 0.0f),
100);
draw_list->AddCircle(dot_pos, status_bar_height * 0.25f,
ImColor(1.0f, 1.0f, 1.0f), 100);
ImGui::SetWindowFontScale(0.6f);
draw_list->AddText(