Add close button to Studio plugin windows.
Plugin windows could only be closed from the Plugins menu. Pass the plugin's active flag to ImGui::Begin so the window gets a close button that writes the same persisted state as the menu toggle. Skip the update callback while the window is collapsed. PiperOrigin-RevId: 956795070 Change-Id: I61cb5c26e7af935b6bb296f1b89142a72b0daca1
This commit is contained in:
committed by
Copybara-Service
parent
4dd70d2367
commit
24297edfda
@@ -1167,8 +1167,9 @@ void App::BuildGui() {
|
||||
ImGui::EndMainMenuBar();
|
||||
}
|
||||
if (plugin->active) {
|
||||
ImGui::Begin(plugin->name);
|
||||
plugin->update(plugin);
|
||||
if (ImGui::Begin(plugin->name, &plugin->active)) {
|
||||
plugin->update(plugin);
|
||||
}
|
||||
ImGui::End();
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user