DearPyGui icon indicating copy to clipboard operation
DearPyGui copied to clipboard

Disabled Button still appears clickable in UI

Open keck-in-space opened this issue 3 years ago • 1 comments

Version of Dear PyGui

Version: 1.4.0 Operating System: Windows 10

My Issue/Question

When a button is set to enabled=False, it still appears to be clickable because the button color changes when a user clicks on it. In previous versions, the entire button was greyed out and clicking it had no effect if it was not enabled.

I tested this in 0.6.415 and the button is grey and doesn't respond to clicks.

To Reproduce

Steps to reproduce the behavior:

  1. Create a button of a relatively large size
  2. Set the button enabled to False
  3. Run the program
  4. Click the button
  5. Notice that the buttons' background color changes when clicked despite the fact that it is not enabled.

Expected behavior

The button should be greyed out and not react to clicks when it is disabled. Instead, it behaves exactly the same way as an enabled button from a UI perspective.

Standalone, minimal, complete and verifiable example

import dearpygui.dearpygui as dpg

dpg.create_context()
dpg.create_viewport(title='Button Test', width=600, height=300)


def test_func():
    print("Testing Button")


with dpg.window(label="button"):
    dpg.add_button(label="Test Button", callback=test_func, enabled=False, width=400, height=40)


dpg.setup_dearpygui()
dpg.show_viewport()
dpg.start_dearpygui()
dpg.destroy_context()

keck-in-space avatar Mar 04 '22 00:03 keck-in-space

You are correct. At the moment, you have to create a "disabled theme" since we don't have a default one. We will be adding it back though shortly.

hoffstadt avatar Apr 21 '22 04:04 hoffstadt