Skip to content

Commit

Permalink
Add project tags
Browse files Browse the repository at this point in the history
  • Loading branch information
KoBeWi committed May 29, 2023
1 parent 72f7131 commit e767ff5
Show file tree
Hide file tree
Showing 4 changed files with 409 additions and 17 deletions.
1 change: 1 addition & 0 deletions core/config/project_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1251,6 +1251,7 @@ ProjectSettings::ProjectSettings() {
GLOBAL_DEF_BASIC("application/config/name", "");
GLOBAL_DEF_BASIC(PropertyInfo(Variant::DICTIONARY, "application/config/name_localized", PROPERTY_HINT_LOCALIZABLE_STRING), Dictionary());
GLOBAL_DEF_BASIC(PropertyInfo(Variant::STRING, "application/config/description", PROPERTY_HINT_MULTILINE_TEXT), "");
GLOBAL_DEF_INTERNAL(PropertyInfo(Variant::STRING, "application/config/tags"), PackedStringArray());
GLOBAL_DEF_BASIC(PropertyInfo(Variant::STRING, "application/run/main_scene", PROPERTY_HINT_FILE, "*.tscn,*.scn,*.res"), "");
GLOBAL_DEF("application/run/disable_stdout", false);
GLOBAL_DEF("application/run/disable_stderr", false);
Expand Down
27 changes: 27 additions & 0 deletions editor/editor_themes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -939,6 +939,33 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
editor_log_button_pressed->set_border_color(accent_color);
theme->set_stylebox("pressed", "EditorLogFilterButton", editor_log_button_pressed);

// ProjectTag
{
theme->set_type_variation("ProjectTag", "Button");

Ref<StyleBoxFlat> tag = style_widget->duplicate();
tag->set_bg_color(dark_theme ? tag->get_bg_color().lightened(0.2) : tag->get_bg_color().darkened(0.2));
tag->set_corner_radius(CORNER_TOP_LEFT, 0);
tag->set_corner_radius(CORNER_BOTTOM_LEFT, 0);
tag->set_corner_radius(CORNER_TOP_RIGHT, 4);
tag->set_corner_radius(CORNER_BOTTOM_RIGHT, 4);
theme->set_stylebox("normal", "ProjectTag", tag);

tag = style_widget_hover->duplicate();
tag->set_corner_radius(CORNER_TOP_LEFT, 0);
tag->set_corner_radius(CORNER_BOTTOM_LEFT, 0);
tag->set_corner_radius(CORNER_TOP_RIGHT, 4);
tag->set_corner_radius(CORNER_BOTTOM_RIGHT, 4);
theme->set_stylebox("hover", "ProjectTag", tag);

tag = style_widget_pressed->duplicate();
tag->set_corner_radius(CORNER_TOP_LEFT, 0);
tag->set_corner_radius(CORNER_BOTTOM_LEFT, 0);
tag->set_corner_radius(CORNER_TOP_RIGHT, 4);
tag->set_corner_radius(CORNER_BOTTOM_RIGHT, 4);
theme->set_stylebox("pressed", "ProjectTag", tag);
}

// MenuBar
theme->set_stylebox("normal", "MenuBar", style_widget);
theme->set_stylebox("hover", "MenuBar", style_widget_hover);
Expand Down
Loading

0 comments on commit e767ff5

Please sign in to comment.