hoffstadt / DearPyGui

Dear PyGui: A fast and powerful Graphical User Interface Toolkit for Python with minimal dependencies
https://dearpygui.readthedocs.io/en/latest/
MIT License
13.31k stars 691 forks source link

mvMenu: Resetting menu state if it's not open (#2245) #2246

Closed v-ein closed 10 months ago

v-ein commented 10 months ago

name: Pull Request about: Create a pull request to help us improve title: mvMenu: Resetting menu state if it's not open (#2245) assignees: @hoffstadt


Closes #2245

Description: Added a branch to DearPyGui::draw_menu() that resets menu state if the menu is not open.

Also, restored indentation in draw_menu() - it's much easier to read now.

Concerning Areas: I'm not sure that the values that item.state.contextRegionAvail gets are consistent between the opened menu and the closed menu. But, would anyone ever use that property on a menu? So maybe this piece is not much of a concern, after all.