godotengine / godotengine/godot

Button using different style types for background and text.

Open
#108,686 2 comments 0 reactions 0 assignees View on GitHub
discussion topic:gui
Dominant language
C++
Stars
117k
Forks
26.8k
PR merge metrics
PR metrics pending

Description

### Tested versions

- Reproducible in: 4.3.stable, 4.4.1.stable, 4.5.beta3,

### System information

Windows 10 - v4.4.1.stable

### Issue description

When a button is focused and hovered, the stylebox used is `focus`, but the font color used is `font_hover_color`.
I expect the stylebox and text to use the same style criteria as eachother. So they should either both use `font:font_hover_color` and `style_box:hover`, or they should both use `font:font_focus_color` and `style_box:focus`.

The button below has a red stylebox for `focus` and a red text for `font_focus_color`. But, it displays green text which is the `font_hover_color` when the mouse is hovering.
Image

### Steps to reproduce

Create a button with `focus` stylebox and `font_focus_color`. Then Focus the button and hover the mouse over it. The stylebox will be shown, but the font color will not be shown.

### Minimal reproduction project (MRP)

[button_style_mismatch.zip](https://github.com/user-attachments/files/21267394/button_style_mismatch.zip)

Contributor guide

Open the contributing guide

Research direction

Start with the attached button_style_mismatch.zip minimal reproduction and trace how Button resolves its focus and hover stylebox and font colors. Confirm the intended matching state behavior, then verify the reproduction no longer shows a focus stylebox with the hover font color.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, godot
Domain
design, game-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.