mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Add focus font color to Button and derivatives
This commit is contained in:
parent
c1709e8177
commit
7fe0dab69b
14 changed files with 69 additions and 5 deletions
|
|
@ -84,9 +84,18 @@ void Button::_notification(int p_what) {
|
|||
if (!flat) {
|
||||
style->draw(ci, Rect2(Point2(0, 0), size));
|
||||
}
|
||||
color = get_color("font_color");
|
||||
if (has_color("icon_color_normal")) {
|
||||
color_icon = get_color("icon_color_normal");
|
||||
|
||||
// Focus colors only take precedence over normal state.
|
||||
if (has_focus()) {
|
||||
color = get_color("font_color_focus");
|
||||
if (has_color("icon_color_focus")) {
|
||||
color_icon = get_color("icon_color_focus");
|
||||
}
|
||||
} else {
|
||||
color = get_color("font_color");
|
||||
if (has_color("icon_color_normal")) {
|
||||
color_icon = get_color("icon_color_normal");
|
||||
}
|
||||
}
|
||||
} break;
|
||||
case DRAW_HOVER_PRESSED: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue