-
Notifications
You must be signed in to change notification settings - Fork 279
Labels
EditorSomething relative with the editorSomething relative with the editorGood First IssueAn easy issue for new contributorsAn easy issue for new contributors
Description
Description
It seems like since the latest ImGui update, buttons that are supposed to be disabled are still clickable.
There are many cases, including (non-exhaustive):
- "Add Script" button in inspector
- Toolbar buttons
- etc...
Expecting the fix to be somewhere in there:
Overload/Sources/Overload/OvUI/src/OvUI/Widgets/Buttons/Button.cpp
Lines 24 to 45 in 8ecae34
| void OvUI::Widgets::Buttons::Button::_Draw_Impl() | |
| { | |
| auto& style = ImGui::GetStyle(); | |
| auto defaultIdleColor = style.Colors[ImGuiCol_Button]; | |
| auto defaultHoveredColor = style.Colors[ImGuiCol_ButtonHovered]; | |
| auto defaultClickedColor = style.Colors[ImGuiCol_ButtonActive]; | |
| auto defaultTextColor = style.Colors[ImGuiCol_Text]; | |
| style.Colors[ImGuiCol_Button] = OvUI::Internal::Converter::ToImVec4(idleBackgroundColor); | |
| style.Colors[ImGuiCol_ButtonHovered] = OvUI::Internal::Converter::ToImVec4(hoveredBackgroundColor); | |
| style.Colors[ImGuiCol_ButtonActive] = OvUI::Internal::Converter::ToImVec4(clickedBackgroundColor); | |
| style.Colors[ImGuiCol_Text] = OvUI::Internal::Converter::ToImVec4(textColor); | |
| if (ImGui::ButtonEx((label + m_widgetID).c_str(), Internal::Converter::ToImVec2(size), disabled ? ImGuiItemFlags_Disabled : 0)) | |
| ClickedEvent.Invoke(); | |
| style.Colors[ImGuiCol_Button] = defaultIdleColor; | |
| style.Colors[ImGuiCol_ButtonHovered] = defaultHoveredColor; | |
| style.Colors[ImGuiCol_ButtonActive] = defaultClickedColor; | |
| style.Colors[ImGuiCol_Text] = defaultTextColor; | |
| } |
To Reproduce
Steps to reproduce the behavior:
- Open the editor
- Click on the "pause" button in the toolbar
- Notice the issue
Expected behavior
A button marked as "disabled" shouldn't be clickable.
Screenshots
OvEditor_HR8QZhjW03.mp4
Metadata
Metadata
Assignees
Labels
EditorSomething relative with the editorSomething relative with the editorGood First IssueAn easy issue for new contributorsAn easy issue for new contributors