-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[3.x] Add focus font color to Button
and derivatives
#54264
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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"); | ||
} | ||
Comment on lines
+91
to
+93
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This color isn't defined anywhere. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, all |
||
} else { | ||
color = get_color("font_color"); | ||
if (has_color("icon_color_normal")) { | ||
color_icon = get_color("icon_color_normal"); | ||
} | ||
} | ||
} break; | ||
case DRAW_HOVER_PRESSED: { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's the same as
font_color_hl
, why couldn't you just reuse it?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's the same for the purpose of quickly fixing it, but I fully expect we may want to tune it (granted, probably not in 3.4). I just think that it will be easier to customize if needs be.
The difference would be like one line, this line.