[feat] show shield icon when SRTP is enabled

This commit is contained in:
dijunkun
2025-09-30 17:26:42 +08:00
parent 6565816c0e
commit 15bf8ef8c0
4 changed files with 61 additions and 62 deletions

View File

@@ -259,7 +259,7 @@ int Render::NetTrafficStats(std::shared_ptr<SubStreamWindowProperties>& props) {
if (ImGui::BeginTable("NetTrafficStats", 4, ImGuiTableFlags_BordersH, if (ImGui::BeginTable("NetTrafficStats", 4, ImGuiTableFlags_BordersH,
ImVec2(props->control_window_max_width_ - 10.0f, ImVec2(props->control_window_max_width_ - 10.0f,
props->control_window_max_height_ - 40.0f))) { props->control_window_max_height_ - 60.0f))) {
ImGui::TableSetupColumn("", ImGuiTableColumnFlags_WidthFixed); ImGui::TableSetupColumn("", ImGuiTableColumnFlags_WidthFixed);
ImGui::TableSetupColumn("", ImGuiTableColumnFlags_WidthStretch); ImGui::TableSetupColumn("", ImGuiTableColumnFlags_WidthStretch);
ImGui::TableSetupColumn("", ImGuiTableColumnFlags_WidthStretch); ImGui::TableSetupColumn("", ImGuiTableColumnFlags_WidthStretch);
@@ -275,7 +275,6 @@ int Render::NetTrafficStats(std::shared_ptr<SubStreamWindowProperties>& props) {
ImGui::Text("%s", ImGui::Text("%s",
localization::loss_rate[localization_language_index_].c_str()); localization::loss_rate[localization_language_index_].c_str());
ImGui::TableNextRow();
ImGui::TableNextColumn(); ImGui::TableNextColumn();
ImGui::Text("%s", ImGui::Text("%s",
localization::video[localization_language_index_].c_str()); localization::video[localization_language_index_].c_str());
@@ -286,7 +285,6 @@ int Render::NetTrafficStats(std::shared_ptr<SubStreamWindowProperties>& props) {
ImGui::TableNextColumn(); ImGui::TableNextColumn();
LossRateDisplay(props->net_traffic_stats_.video_inbound_stats.loss_rate); LossRateDisplay(props->net_traffic_stats_.video_inbound_stats.loss_rate);
ImGui::TableNextRow();
ImGui::TableNextColumn(); ImGui::TableNextColumn();
ImGui::Text("%s", ImGui::Text("%s",
localization::audio[localization_language_index_].c_str()); localization::audio[localization_language_index_].c_str());
@@ -297,7 +295,6 @@ int Render::NetTrafficStats(std::shared_ptr<SubStreamWindowProperties>& props) {
ImGui::TableNextColumn(); ImGui::TableNextColumn();
LossRateDisplay(props->net_traffic_stats_.audio_inbound_stats.loss_rate); LossRateDisplay(props->net_traffic_stats_.audio_inbound_stats.loss_rate);
ImGui::TableNextRow();
ImGui::TableNextColumn(); ImGui::TableNextColumn();
ImGui::Text("%s", localization::data[localization_language_index_].c_str()); ImGui::Text("%s", localization::data[localization_language_index_].c_str());
ImGui::TableNextColumn(); ImGui::TableNextColumn();
@@ -307,7 +304,6 @@ int Render::NetTrafficStats(std::shared_ptr<SubStreamWindowProperties>& props) {
ImGui::TableNextColumn(); ImGui::TableNextColumn();
LossRateDisplay(props->net_traffic_stats_.data_inbound_stats.loss_rate); LossRateDisplay(props->net_traffic_stats_.data_inbound_stats.loss_rate);
ImGui::TableNextRow();
ImGui::TableNextColumn(); ImGui::TableNextColumn();
ImGui::Text("%s", ImGui::Text("%s",
localization::total[localization_language_index_].c_str()); localization::total[localization_language_index_].c_str());

View File

@@ -86,8 +86,11 @@ int Render::StreamWindow() {
} }
ImGui::SetWindowFontScale(0.6f); ImGui::SetWindowFontScale(0.6f);
if (ImGui::BeginTabItem(props->remote_id_.c_str(), std::string tab_label =
&props->tab_opened_)) { enable_srtp_
? std::string(ICON_FA_SHIELD_HALVED) + " " + props->remote_id_
: props->remote_id_;
if (ImGui::BeginTabItem(tab_label.c_str(), &props->tab_opened_)) {
props->tab_selected_ = true; props->tab_selected_ = true;
ImGui::SetWindowFontScale(1.0f); ImGui::SetWindowFontScale(1.0f);