You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, the "MenuItem" function currently has an "selected" parameter: bool ImGui::MenuItem(const char* label, const char* shortcut, bool selected, bool enabled)
if (ImGui::BeginMenuBar()) {
if (ImGui::MenuItem("Move", nullptr, Globals::SelectedGizmoMovementType == GizmoMovementType::Move, inLevelViewport)) {
Editor::Gui::Globals::SelectedGizmoMovementType = Editor::Gui::GizmoMovementType::Move;
}
if (ImGui::MenuItem("Rotate", nullptr, Globals::SelectedGizmoMovementType == GizmoMovementType::Rotate, inLevelViewport)) {
Editor::Gui::Globals::SelectedGizmoMovementType = Editor::Gui::GizmoMovementType::Rotate;
}
if (ImGui::MenuItem( Scale", nullptr, Globals::SelectedGizmoMovementType == GizmoMovementType::Scale, inLevelViewport)) {
Editor::Gui::Globals::SelectedGizmoMovementType = GizmoMovementType::Scale;
}
Will result in:
Instead of the results I want to achieve (This was done by passing the "selected" argument to Selectable() instead.)
My question is if this is how it's supposed to work? Should I use something else instead? I would also like to point out the following comment in the MenuItem() code as it may be useful or explain things.
// Mimic the exact layout spacing of BeginMenu() to allow MenuItem() inside a menu bar, which is a little misleading but may be useful
// Note that in this situation we render neither the shortcut neither the selected tick mark
Regards
The text was updated successfully, but these errors were encountered:
I think this sort of use may be confusing but I see no harm in adding the change you suggested. Added now.
However it is possible in the future that we would change the look for it to use a check-mark.
(Note that you could easily simply call Selectable() with the right flags yourself)
Version: Dear ImGui 1.83 WIP (18209)
Branch: docking
Hi, the "MenuItem" function currently has an "selected" parameter:
bool ImGui::MenuItem(const char* label, const char* shortcut, bool selected, bool enabled)
However, this parameter will be ignored if it's in a horizontal layout. The reason for this is because it will always pass "false" to the Selectable().
Using the following code:
Will result in:
Instead of the results I want to achieve (This was done by passing the "selected" argument to Selectable() instead.)
My question is if this is how it's supposed to work? Should I use something else instead? I would also like to point out the following comment in the MenuItem() code as it may be useful or explain things.
Regards
The text was updated successfully, but these errors were encountered: