You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-18 14:21:41 +00:00
Draw a checkerboard behind translucent colors in CodeEdit autocompletion previews
This makes translucent colors easier to interpret as such and is consistent with how they're displayed in ColorPicker.
This commit is contained in:
@@ -211,7 +211,13 @@ void CodeEdit::_notification(int p_what) {
|
||||
tl->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_RIGHT);
|
||||
} else {
|
||||
if (code_completion_options[l].default_value.get_type() == Variant::COLOR) {
|
||||
draw_rect(Rect2(Point2(code_completion_rect.position.x + code_completion_rect.size.width - icon_area_size.x, icon_area.position.y), icon_area_size), (Color)code_completion_options[l].default_value);
|
||||
const Color color = code_completion_options[l].default_value;
|
||||
const Rect2 rect = Rect2(Point2(code_completion_rect.position.x + code_completion_rect.size.width - icon_area_size.x, icon_area.position.y), icon_area_size);
|
||||
if (color.a < 1.0) {
|
||||
draw_texture_rect(theme_cache.completion_color_bg, rect, true);
|
||||
}
|
||||
|
||||
draw_rect(rect, color);
|
||||
}
|
||||
tl->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_LEFT);
|
||||
}
|
||||
@@ -2771,6 +2777,7 @@ void CodeEdit::_bind_methods() {
|
||||
BIND_THEME_ITEM_CUSTOM(Theme::DATA_TYPE_ICON, CodeEdit, can_fold_code_region_icon, "can_fold_code_region");
|
||||
BIND_THEME_ITEM_CUSTOM(Theme::DATA_TYPE_ICON, CodeEdit, folded_code_region_icon, "folded_code_region");
|
||||
BIND_THEME_ITEM(Theme::DATA_TYPE_ICON, CodeEdit, folded_eol_icon);
|
||||
BIND_THEME_ITEM(Theme::DATA_TYPE_ICON, CodeEdit, completion_color_bg);
|
||||
|
||||
BIND_THEME_ITEM(Theme::DATA_TYPE_COLOR, CodeEdit, breakpoint_color);
|
||||
BIND_THEME_ITEM_CUSTOM(Theme::DATA_TYPE_ICON, CodeEdit, breakpoint_icon, "breakpoint");
|
||||
|
||||
Reference in New Issue
Block a user