Finalize colors of modern theme

This commit is contained in:
passivestar
2025-12-18 19:05:02 +04:00
parent 551ce8d47f
commit 8e20f4c289
7 changed files with 147 additions and 59 deletions

View File

@@ -62,10 +62,10 @@ void ProjectListItemControl::_notification(int p_what) {
project_title->begin_bulk_theme_override();
project_title->add_theme_font_override(SceneStringName(font), get_theme_font(SNAME("title"), EditorStringName(EditorFonts)));
project_title->add_theme_font_size_override(SceneStringName(font_size), get_theme_font_size(SNAME("title_size"), EditorStringName(EditorFonts)));
project_title->add_theme_color_override(SceneStringName(font_color), get_theme_color(SceneStringName(font_color), SNAME("Tree")));
project_title->add_theme_color_override(SceneStringName(font_color), get_theme_color(SceneStringName(font_color), SNAME("ProjectList")));
project_title->end_bulk_theme_override();
project_path->add_theme_color_override(SceneStringName(font_color), get_theme_color(SceneStringName(font_color), SNAME("Tree")));
project_path->add_theme_color_override(SceneStringName(font_color), get_theme_color(SceneStringName(font_color), SNAME("ProjectList")));
project_unsupported_features->set_texture(get_editor_theme_icon(SNAME("NodeWarning")));
favorite_focus_color = get_theme_color(SNAME("accent_color"), EditorStringName(Editor));
@@ -136,18 +136,19 @@ void ProjectListItemControl::_notification(int p_what) {
} break;
case NOTIFICATION_DRAW: {
if (is_selected) {
draw_style_box(get_theme_stylebox(SNAME("selected"), SNAME("Tree")), Rect2(Point2(), get_size()));
}
if (is_hovering) {
draw_style_box(get_theme_stylebox(SNAME("hovered"), SNAME("Tree")), Rect2(Point2(), get_size()));
if (is_selected && is_hovering) {
draw_style_box(get_theme_stylebox(SNAME("hover_pressed"), SNAME("ProjectList")), Rect2(Point2(), get_size()));
} else if (is_selected) {
draw_style_box(get_theme_stylebox(SNAME("selected"), SNAME("ProjectList")), Rect2(Point2(), get_size()));
} else if (is_hovering) {
draw_style_box(get_theme_stylebox(SNAME("hovered"), SNAME("ProjectList")), Rect2(Point2(), get_size()));
}
// Due to how this control works, we can't rely on the built-in way of checking for focus visibility.
if (has_focus() && !is_focus_hidden) {
draw_style_box(get_theme_stylebox(SNAME("focus"), SNAME("Tree")), Rect2(Point2(), get_size()));
draw_style_box(get_theme_stylebox(SNAME("focus"), SNAME("ProjectList")), Rect2(Point2(), get_size()));
}
draw_line(Point2(0, get_size().y + 1), Point2(get_size().x, get_size().y + 1), get_theme_color(SNAME("guide_color"), SNAME("Tree")));
draw_line(Point2(0, get_size().y + 1), Point2(get_size().x, get_size().y + 1), get_theme_color(SNAME("guide_color"), SNAME("ProjectList")));
} break;
}
}