Skip to content

Commit

Permalink
Menu item to enable multi-viewport
Browse files Browse the repository at this point in the history
  • Loading branch information
drhelius committed Jul 30, 2024
1 parent b37544d commit 31d9fb6
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions platforms/desktop-shared/gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ void gui_init(void)
io.IniFilename = config_imgui_file_path;
io.FontGlobalScale /= application_display_scale;

#if defined(__APPLE__) || defined(_WIN32)
if (config_debug.multi_viewport)
io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable;
#endif

gui_roboto_font = io.Fonts->AddFontFromMemoryCompressedTTF(RobotoMedium_compressed_data, RobotoMedium_compressed_size, 17.0f * application_display_scale, NULL, io.Fonts->GetGlyphRangesCyrillic());

ImFontConfig font_cfg;
Expand Down Expand Up @@ -896,14 +901,7 @@ static void main_menu(void)
ImGui::Separator();

#if defined(__APPLE__) || defined(_WIN32)
if (ImGui::MenuItem("Multi-Viewport", "", &config_debug.multi_viewport, config_debug.debug))
{
if (config_debug.multi_viewport)
ImGui::GetIO().ConfigFlags &= ~ImGuiConfigFlags_ViewportsEnable;
else
ImGui::GetIO().ConfigFlags |= ImGuiConfigFlags_ViewportsEnable;
}

ImGui::MenuItem("Multi-Viewport (Restart required)", "", &config_debug.multi_viewport, config_debug.debug);
ImGui::Separator();
#endif

Expand Down

0 comments on commit 31d9fb6

Please sign in to comment.