Merge pull request #68904 from aaronfranke/texture-methods

Rename TextureButton set_*_texture methods to set_texture_*
This commit is contained in:
Rémi Verschelde
2022-11-20 15:37:37 +01:00
13 changed files with 84 additions and 84 deletions
@@ -65,13 +65,13 @@ void EditorAssetLibraryItem::set_image(int p_type, int p_index, const Ref<Textur
ERR_FAIL_COND(p_type != EditorAssetLibrary::IMAGE_QUEUE_ICON);
ERR_FAIL_COND(p_index != 0);
icon->set_normal_texture(p_image);
icon->set_texture_normal(p_image);
}
void EditorAssetLibraryItem::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_ENTER_TREE: {
icon->set_normal_texture(get_theme_icon(SNAME("ProjectIconLoading"), SNAME("EditorIcons")));
icon->set_texture_normal(get_theme_icon(SNAME("ProjectIconLoading"), SNAME("EditorIcons")));
category->add_theme_color_override("font_color", Color(0.5, 0.5, 0.5));
author->add_theme_color_override("font_color", Color(0.5, 0.5, 0.5));
price->add_theme_color_override("font_color", Color(0.5, 0.5, 0.5));
@@ -402,7 +402,7 @@ void EditorAssetLibraryItemDownload::_notification(int p_what) {
case NOTIFICATION_THEME_CHANGED: {
panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("panel"), SNAME("AssetLib")));
status->add_theme_color_override("font_color", get_theme_color(SNAME("status_color"), SNAME("AssetLib")));
dismiss_button->set_normal_texture(get_theme_icon(SNAME("dismiss"), SNAME("AssetLib")));
dismiss_button->set_texture_normal(get_theme_icon(SNAME("dismiss"), SNAME("AssetLib")));
} break;
case NOTIFICATION_PROCESS: {
+2 -2
View File
@@ -38,9 +38,9 @@
void BoneMapperButton::fetch_textures() {
if (selected) {
set_normal_texture(get_theme_icon(SNAME("BoneMapperHandleSelected"), SNAME("EditorIcons")));
set_texture_normal(get_theme_icon(SNAME("BoneMapperHandleSelected"), SNAME("EditorIcons")));
} else {
set_normal_texture(get_theme_icon(SNAME("BoneMapperHandle"), SNAME("EditorIcons")));
set_texture_normal(get_theme_icon(SNAME("BoneMapperHandle"), SNAME("EditorIcons")));
}
set_offset(SIDE_LEFT, 0);
set_offset(SIDE_RIGHT, 0);
+8 -8
View File
@@ -72,15 +72,15 @@ void MaterialEditor::_update_theme_item_cache() {
void MaterialEditor::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_THEME_CHANGED: {
light_1_switch->set_normal_texture(theme_cache.light_1_on);
light_1_switch->set_pressed_texture(theme_cache.light_1_off);
light_2_switch->set_normal_texture(theme_cache.light_2_on);
light_2_switch->set_pressed_texture(theme_cache.light_2_off);
light_1_switch->set_texture_normal(theme_cache.light_1_on);
light_1_switch->set_texture_pressed(theme_cache.light_1_off);
light_2_switch->set_texture_normal(theme_cache.light_2_on);
light_2_switch->set_texture_pressed(theme_cache.light_2_off);
sphere_switch->set_normal_texture(theme_cache.sphere_off);
sphere_switch->set_pressed_texture(theme_cache.sphere_on);
box_switch->set_normal_texture(theme_cache.box_off);
box_switch->set_pressed_texture(theme_cache.box_on);
sphere_switch->set_texture_normal(theme_cache.sphere_off);
sphere_switch->set_texture_pressed(theme_cache.sphere_on);
box_switch->set_texture_normal(theme_cache.box_off);
box_switch->set_texture_pressed(theme_cache.box_on);
} break;
case NOTIFICATION_DRAW: {
+4 -4
View File
@@ -61,10 +61,10 @@ void MeshEditor::_update_theme_item_cache() {
void MeshEditor::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_THEME_CHANGED: {
light_1_switch->set_normal_texture(theme_cache.light_1_on);
light_1_switch->set_pressed_texture(theme_cache.light_1_off);
light_2_switch->set_normal_texture(theme_cache.light_2_on);
light_2_switch->set_pressed_texture(theme_cache.light_2_off);
light_1_switch->set_texture_normal(theme_cache.light_1_on);
light_1_switch->set_texture_pressed(theme_cache.light_1_off);
light_2_switch->set_texture_normal(theme_cache.light_2_on);
light_2_switch->set_texture_pressed(theme_cache.light_2_off);
} break;
}
}
+3 -3
View File
@@ -80,9 +80,9 @@ void StyleBoxPreview::_notification(int p_what) {
// See https://github.com/godotengine/godot/issues/50743.
break;
}
grid_preview->set_normal_texture(get_theme_icon(SNAME("StyleBoxGridInvisible"), SNAME("EditorIcons")));
grid_preview->set_pressed_texture(get_theme_icon(SNAME("StyleBoxGridVisible"), SNAME("EditorIcons")));
grid_preview->set_hover_texture(get_theme_icon(SNAME("StyleBoxGridVisible"), SNAME("EditorIcons")));
grid_preview->set_texture_normal(get_theme_icon(SNAME("StyleBoxGridInvisible"), SNAME("EditorIcons")));
grid_preview->set_texture_pressed(get_theme_icon(SNAME("StyleBoxGridVisible"), SNAME("EditorIcons")));
grid_preview->set_texture_hover(get_theme_icon(SNAME("StyleBoxGridVisible"), SNAME("EditorIcons")));
checkerboard->set_texture(get_theme_icon(SNAME("Checkerboard"), SNAME("EditorIcons")));
} break;
}
@@ -816,8 +816,8 @@ void VisualShaderGraphPlugin::add_node(VisualShader::Type p_type, int p_id) {
if (vsnode->is_output_port_expandable(i)) {
TextureButton *expand = memnew(TextureButton);
expand->set_toggle_mode(true);
expand->set_normal_texture(editor->get_theme_icon(SNAME("GuiTreeArrowDown"), SNAME("EditorIcons")));
expand->set_pressed_texture(editor->get_theme_icon(SNAME("GuiTreeArrowRight"), SNAME("EditorIcons")));
expand->set_texture_normal(editor->get_theme_icon(SNAME("GuiTreeArrowDown"), SNAME("EditorIcons")));
expand->set_texture_pressed(editor->get_theme_icon(SNAME("GuiTreeArrowRight"), SNAME("EditorIcons")));
expand->set_v_size_flags(Control::SIZE_SHRINK_CENTER);
expand->set_pressed(vsnode->_is_output_port_expanded(i));
expand->connect("pressed", callable_mp(editor, &VisualShaderEditor::_expand_output_port).bind(p_id, i, !vsnode->_is_output_port_expanded(i)), CONNECT_DEFERRED);
@@ -826,8 +826,8 @@ void VisualShaderGraphPlugin::add_node(VisualShader::Type p_type, int p_id) {
if (vsnode->has_output_port_preview(i) && port_right != VisualShaderNode::PORT_TYPE_TRANSFORM && port_right != VisualShaderNode::PORT_TYPE_SAMPLER) {
TextureButton *preview = memnew(TextureButton);
preview->set_toggle_mode(true);
preview->set_normal_texture(editor->get_theme_icon(SNAME("GuiVisibilityHidden"), SNAME("EditorIcons")));
preview->set_pressed_texture(editor->get_theme_icon(SNAME("GuiVisibilityVisible"), SNAME("EditorIcons")));
preview->set_texture_normal(editor->get_theme_icon(SNAME("GuiVisibilityHidden"), SNAME("EditorIcons")));
preview->set_texture_pressed(editor->get_theme_icon(SNAME("GuiVisibilityVisible"), SNAME("EditorIcons")));
preview->set_v_size_flags(Control::SIZE_SHRINK_CENTER);
register_output_port(p_id, j, preview);