Solve the warning of method ImGui::Text()

This commit is contained in:
dijunkun
2024-06-28 15:11:40 +08:00
parent af04b0571e
commit b5f8e92526
3 changed files with 16 additions and 11 deletions

View File

@@ -15,7 +15,7 @@ int Render::LocalWindow() {
ImGui::SetWindowFontScale(1.0f); ImGui::SetWindowFontScale(1.0f);
ImGui::Text( ImGui::Text(
localization::local_desktop[localization_language_index_].c_str()); "%s", localization::local_desktop[localization_language_index_].c_str());
ImGui::Spacing(); ImGui::Spacing();
{ {
@@ -25,7 +25,8 @@ int Render::LocalWindow() {
ImGuiChildFlags_Border); ImGuiChildFlags_Border);
{ {
ImGui::SetWindowFontScale(0.5f); ImGui::SetWindowFontScale(0.5f);
ImGui::Text(localization::local_id[localization_language_index_].c_str()); ImGui::Text("%s",
localization::local_id[localization_language_index_].c_str());
ImGui::Spacing(); ImGui::Spacing();
@@ -41,7 +42,8 @@ int Render::LocalWindow() {
ImGui::SetWindowFontScale(0.5f); ImGui::SetWindowFontScale(0.5f);
ImGui::Text(localization::password[localization_language_index_].c_str()); ImGui::Text("%s",
localization::password[localization_language_index_].c_str());
strncpy(input_password_tmp_, input_password_, sizeof(input_password_)); strncpy(input_password_tmp_, input_password_, sizeof(input_password_));
ImGui::SetNextItemWidth(IPUT_WINDOW_WIDTH); ImGui::SetNextItemWidth(IPUT_WINDOW_WIDTH);

View File

@@ -17,7 +17,7 @@ int Render::RemoteWindow() {
ImGui::SetWindowFontScale(1.0f); ImGui::SetWindowFontScale(1.0f);
ImGui::Text( ImGui::Text(
localization::remote_desktop[localization_language_index_].c_str()); "%s", localization::remote_desktop[localization_language_index_].c_str());
ImGui::Spacing(); ImGui::Spacing();
@@ -27,7 +27,8 @@ int Render::RemoteWindow() {
ImGuiChildFlags_Border); ImGuiChildFlags_Border);
{ {
ImGui::SetWindowFontScale(0.5f); ImGui::SetWindowFontScale(0.5f);
ImGui::Text(localization::remote_id[localization_language_index_].c_str()); ImGui::Text("%s",
localization::remote_id[localization_language_index_].c_str());
ImGui::Spacing(); ImGui::Spacing();
ImGui::SetNextItemWidth(IPUT_WINDOW_WIDTH); ImGui::SetNextItemWidth(IPUT_WINDOW_WIDTH);

View File

@@ -62,7 +62,8 @@ int Render::SettingButton() {
localization::language_en[localization_language_index_].c_str()}; localization::language_en[localization_language_index_].c_str()};
ImGui::SetCursorPosY(32); ImGui::SetCursorPosY(32);
ImGui::Text(localization::language[localization_language_index_].c_str()); ImGui::Text("%s",
localization::language[localization_language_index_].c_str());
if (ConfigCenter::LANGUAGE::CHINESE == localization_language_) { if (ConfigCenter::LANGUAGE::CHINESE == localization_language_) {
ImGui::SetCursorPosX(LANGUAGE_SELECT_WINDOW_PADDING_CN); ImGui::SetCursorPosX(LANGUAGE_SELECT_WINDOW_PADDING_CN);
} else { } else {
@@ -88,6 +89,7 @@ int Render::SettingButton() {
ImGui::SetCursorPosY(62); ImGui::SetCursorPosY(62);
ImGui::Text( ImGui::Text(
"%s",
localization::video_quality[localization_language_index_].c_str()); localization::video_quality[localization_language_index_].c_str());
if (ConfigCenter::LANGUAGE::CHINESE == localization_language_) { if (ConfigCenter::LANGUAGE::CHINESE == localization_language_) {
@@ -111,8 +113,8 @@ int Render::SettingButton() {
ImGui::SetCursorPosY(92); ImGui::SetCursorPosY(92);
ImGui::Text( ImGui::Text(
localization::video_encode_format[localization_language_index_] "%s", localization::video_encode_format[localization_language_index_]
.c_str()); .c_str());
if (ConfigCenter::LANGUAGE::CHINESE == localization_language_) { if (ConfigCenter::LANGUAGE::CHINESE == localization_language_) {
ImGui::SetCursorPosX(VIDEO_ENCODE_FORMAT_SELECT_WINDOW_PADDING_CN); ImGui::SetCursorPosX(VIDEO_ENCODE_FORMAT_SELECT_WINDOW_PADDING_CN);
@@ -131,9 +133,9 @@ int Render::SettingButton() {
{ {
ImGui::SetCursorPosY(122); ImGui::SetCursorPosY(122);
ImGui::Text(localization::enable_hardware_video_codec ImGui::Text("%s", localization::enable_hardware_video_codec
[localization_language_index_] [localization_language_index_]
.c_str()); .c_str());
if (ConfigCenter::LANGUAGE::CHINESE == localization_language_) { if (ConfigCenter::LANGUAGE::CHINESE == localization_language_) {
ImGui::SetCursorPosX(ENABLE_HARDWARE_VIDEO_CODEC_CHECKBOX_PADDING_CN); ImGui::SetCursorPosX(ENABLE_HARDWARE_VIDEO_CODEC_CHECKBOX_PADDING_CN);