demo_themes.py 978 B

123456789101112131415161718192021222324252627
  1. """Demo for ImGui theming using ImGui Bundle.
  2. In order to apply a theme, you can use:
  3. =======================================
  4. hello_imgui.apply_theme(hello_imgui.ImGuiTheme_.cherry)
  5. """
  6. # Part of ImGui Bundle - MIT License - Copyright (c) 2022-2026 Pascal Thomet - https://github.com/pthom/imgui_bundle
  7. from imgui_bundle import immapp, hello_imgui, imgui, imgui_md
  8. def demo_gui():
  9. imgui_md.render_unindented(
  10. """
  11. # Theming
  12. HelloImGui adds support for advanced theming to ImGui. Select the menu View/Theme/Theme tweak window to explore all the themes and their customization.
  13. """
  14. )
  15. imgui.new_line()
  16. tweaked_theme = hello_imgui.get_runner_params().imgui_window_params.tweaked_theme
  17. theme_changed = hello_imgui.show_theme_tweak_gui(tweaked_theme)
  18. if theme_changed:
  19. hello_imgui.apply_tweaked_theme(tweaked_theme)
  20. if __name__ == "__main__":
  21. immapp.run(demo_gui, window_size=(1000, 800), with_markdown=True)