mirror of
https://github.com/godotengine/godot.git
synced 2025-12-07 22:00:10 +00:00
fix popup menu accelerator incorrect highlighting
This commit is contained in:
parent
3a97723ff2
commit
7282a8564b
1 changed files with 3 additions and 3 deletions
|
|
@ -1014,13 +1014,13 @@ void PopupMenu::_draw_items() {
|
||||||
if (theme_cache.font_outline_size > 0 && theme_cache.font_outline_color.a > 0) {
|
if (theme_cache.font_outline_size > 0 && theme_cache.font_outline_color.a > 0) {
|
||||||
items[i].text_buf->draw_outline(ci, text_pos, theme_cache.font_outline_size, theme_cache.font_outline_color);
|
items[i].text_buf->draw_outline(ci, text_pos, theme_cache.font_outline_size, theme_cache.font_outline_color);
|
||||||
}
|
}
|
||||||
items[i].text_buf->draw(ci, text_pos, items[i].disabled ? theme_cache.font_disabled_color : ((active_submenu_index == -1 && i == mouse_over) || i == active_submenu_index ? theme_cache.font_hover_color : theme_cache.font_color));
|
items[i].text_buf->draw(ci, text_pos, items[i].disabled ? theme_cache.font_disabled_color : (((active_submenu_index == -1 && i == mouse_over) || i == active_submenu_index) ? theme_cache.font_hover_color : theme_cache.font_color));
|
||||||
} else {
|
} else {
|
||||||
Vector2 text_pos = item_ofs + Point2(0, Math::floor((h - items[i].text_buf->get_size().y) / 2.0));
|
Vector2 text_pos = item_ofs + Point2(0, Math::floor((h - items[i].text_buf->get_size().y) / 2.0));
|
||||||
if (theme_cache.font_outline_size > 0 && theme_cache.font_outline_color.a > 0) {
|
if (theme_cache.font_outline_size > 0 && theme_cache.font_outline_color.a > 0) {
|
||||||
items[i].text_buf->draw_outline(ci, text_pos, theme_cache.font_outline_size, theme_cache.font_outline_color);
|
items[i].text_buf->draw_outline(ci, text_pos, theme_cache.font_outline_size, theme_cache.font_outline_color);
|
||||||
}
|
}
|
||||||
items[i].text_buf->draw(ci, text_pos, items[i].disabled ? theme_cache.font_disabled_color : ((active_submenu_index == -1 && i == mouse_over) || i == active_submenu_index ? theme_cache.font_hover_color : theme_cache.font_color));
|
items[i].text_buf->draw(ci, text_pos, items[i].disabled ? theme_cache.font_disabled_color : (((active_submenu_index == -1 && i == mouse_over) || i == active_submenu_index) ? theme_cache.font_hover_color : theme_cache.font_color));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1035,7 +1035,7 @@ void PopupMenu::_draw_items() {
|
||||||
if (theme_cache.font_outline_size > 0 && theme_cache.font_outline_color.a > 0) {
|
if (theme_cache.font_outline_size > 0 && theme_cache.font_outline_color.a > 0) {
|
||||||
items[i].accel_text_buf->draw_outline(ci, text_pos, theme_cache.font_outline_size, theme_cache.font_outline_color);
|
items[i].accel_text_buf->draw_outline(ci, text_pos, theme_cache.font_outline_size, theme_cache.font_outline_color);
|
||||||
}
|
}
|
||||||
items[i].accel_text_buf->draw(ci, text_pos, i == mouse_over ? theme_cache.font_hover_color : theme_cache.font_accelerator_color);
|
items[i].accel_text_buf->draw(ci, text_pos, ((active_submenu_index == -1 && i == mouse_over) || i == active_submenu_index) ? theme_cache.font_hover_color : theme_cache.font_accelerator_color);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cache the item vertical offset from the first item and the height.
|
// Cache the item vertical offset from the first item and the height.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue