mirror of
https://github.com/godotengine/godot.git
synced 2025-04-13 01:00:35 +08:00
Merge pull request #100999 from KoBeWi/theme_wariat
Fix ProjectTag button variation
This commit is contained in:
commit
f18bb5ba1a
@ -70,5 +70,5 @@ ProjectTag::ProjectTag(const String &p_text, bool p_display_close) {
|
||||
button->set_text(p_text.capitalize());
|
||||
button->set_focus_mode(FOCUS_NONE);
|
||||
button->set_icon_alignment(HORIZONTAL_ALIGNMENT_RIGHT);
|
||||
button->set_theme_type_variation(SNAME("ProjectTag"));
|
||||
button->set_theme_type_variation(SNAME("ProjectTagButton"));
|
||||
}
|
||||
|
@ -1788,7 +1788,7 @@ void EditorThemeManager::_populate_editor_styles(const Ref<EditorTheme> &p_theme
|
||||
|
||||
// ProjectTag.
|
||||
{
|
||||
p_theme->set_type_variation("ProjectTag", "Button");
|
||||
p_theme->set_type_variation("ProjectTagButton", "Button");
|
||||
|
||||
Ref<StyleBoxFlat> tag = p_config.button_style->duplicate();
|
||||
tag->set_bg_color(p_config.dark_theme ? tag->get_bg_color().lightened(0.2) : tag->get_bg_color().darkened(0.2));
|
||||
@ -1796,21 +1796,21 @@ void EditorThemeManager::_populate_editor_styles(const Ref<EditorTheme> &p_theme
|
||||
tag->set_corner_radius(CORNER_BOTTOM_LEFT, 0);
|
||||
tag->set_corner_radius(CORNER_TOP_RIGHT, 4);
|
||||
tag->set_corner_radius(CORNER_BOTTOM_RIGHT, 4);
|
||||
p_theme->set_stylebox(CoreStringName(normal), "ProjectTag", tag);
|
||||
p_theme->set_stylebox(CoreStringName(normal), "ProjectTagButton", tag);
|
||||
|
||||
tag = p_config.button_style_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);
|
||||
p_theme->set_stylebox(SceneStringName(hover), "ProjectTag", tag);
|
||||
p_theme->set_stylebox(SceneStringName(hover), "ProjectTagButton", tag);
|
||||
|
||||
tag = p_config.button_style_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);
|
||||
p_theme->set_stylebox(SceneStringName(pressed), "ProjectTag", tag);
|
||||
p_theme->set_stylebox(SceneStringName(pressed), "ProjectTagButton", tag);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1112,8 +1112,8 @@ void Theme::get_theme_item_type_list(DataType p_data_type, List<StringName> *p_l
|
||||
void Theme::set_type_variation(const StringName &p_theme_type, const StringName &p_base_type) {
|
||||
ERR_FAIL_COND_MSG(!is_valid_type_name(p_theme_type), vformat("Invalid type name: '%s'", p_theme_type));
|
||||
ERR_FAIL_COND_MSG(!is_valid_type_name(p_base_type), vformat("Invalid type name: '%s'", p_base_type));
|
||||
ERR_FAIL_COND_MSG(p_theme_type == StringName(), "An empty theme type cannot be marked as a variation of another type.");
|
||||
ERR_FAIL_COND_MSG(ClassDB::class_exists(p_theme_type), "A type associated with a built-in class cannot be marked as a variation of another type.");
|
||||
ERR_FAIL_COND_MSG(p_theme_type == StringName(), vformat("An empty theme type cannot be marked as a variation of another type (\"%s\").", p_base_type));
|
||||
ERR_FAIL_COND_MSG(ClassDB::class_exists(p_theme_type), vformat("A type associated with a built-in class cannot be marked as a variation of another type (variation: \"%s\", base: \"%s\").", p_theme_type, p_base_type));
|
||||
ERR_FAIL_COND_MSG(p_base_type == StringName(), "An empty theme type cannot be the base type of a variation. Use clear_type_variation() instead if you want to unmark '" + String(p_theme_type) + "' as a variation.");
|
||||
|
||||
if (variation_map.has(p_theme_type)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user