godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.31k stars 21.06k forks source link

```icon_hover_pressed_color```⁠ not working for Buttons #98139

Open berkeerkeskin opened 6 days ago

berkeerkeskin commented 6 days ago

Tested versions

Reproducable in 4.3.stable

System information

Godot v4.3.stable - macOS 14.1.0 - Vulkan (Forward+) - integrated Apple M3 Max - Apple M3 Max (14 Threads)

Issue description

Using ⁠ icon_hover_pressed_color either as a theme override or part of a theme itself does not work. I have a toggleable button in my scene that I've attached an icon to and every time its pressed state changes to true it becomes impossible to notice a colour change upon hovering it even though I have a value set for ⁠ icon_hover_pressed_color.

Steps to reproduce

1.⁠ ⁠Add a Button node to a scene 2.⁠ ⁠Attach an icon to the Button 3.⁠ ⁠Set an icon_hover_pressed_color theme override 4.⁠ ⁠Play the scene and try hovering over the button to notice a colour change

Minimal reproduction project (MRP)

N/A

bruvzg commented 6 days ago

Seems like it only works if hover_pressed style box is set, and by default it is set only for CheckButton and CheckBox, but not for Button.

Gurka2 commented 6 days ago

I would like to give this issue a try, seems like good first issue to me :D

SlienCode commented 5 days ago

This is related to #83393

I've already proposed a fix in my pull request #97335

For the time being you can try using a hovered_pressed style box alongside your color override which fixes the issue till the pull request gets merged.